#***************************************************************************
#*
#**  File     :  /lua/ai/AIEconomicBuilders.lua
#**
#**  Summary  : Default economic builders for skirmish
#**
#**  Copyright © 2005 Gas Powered Games, Inc.  All rights reserved.
#****************************************************************************

local BBTmplFile = '/lua/basetemplates.lua'
local BuildingTmpl = 'BuildingTemplates'
local BaseTmpl = 'BaseTemplates'
local ExBaseTmpl = 'ExpansionBaseTemplates'
local Adj2x2Tmpl = 'Adjacency2x2'
local UCBC = '/lua/editor/UnitCountBuildConditions.lua'
local MIBC = '/lua/editor/MiscBuildConditions.lua'
local MABC = '/lua/editor/MarkerBuildConditions.lua'
local IBC = '/lua/editor/InstantBuildConditions.lua'
local OAUBC = '/lua/editor/OtherArmyUnitCountBuildConditions.lua'
local EBC = '/lua/editor/EconomyBuildConditions.lua'
local PCBC = '/lua/editor/PlatoonCountBuildConditions.lua'
local SAI = '/lua/ScenarioPlatoonAI.lua'
local TBC = '/lua/editor/ThreatBuildConditions.lua'
local PlatoonFile = '/lua/platoon.lua'
local SIBC = '/lua/editor/SorianInstantBuildConditions.lua'
local SBC = '/lua/editor/SorianBuildConditions.lua'
local UC = '/Mods/Commanders Revenges FA UEF,Cybran,Aeon,Seraphim/hook/lua/UpgradeConditions.lua'

BuilderGroup {
    BuilderGroupName = 'SorianACUUpgrades',
    BuildersType = 'PlatoonFormBuilder',
   
####UEF
   #LCH:
   Builder {
        BuilderName = 'Sorian UEF CDR HeavyBolterLUpgrade',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 2000,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'HeavyBolterLUpgrade' }},
                { MIBC, 'FactionIndex', {1, 1}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'HeavyBolterLUpgrade' },
        },
    },
    Builder {
        BuilderName = 'Sorian UEF CDR AdvancedEngineering',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1900,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'AdvancedEngineering' }},
                { MIBC, 'FactionIndex', {1, 1}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'AdvancedEngineering' },
        },
    },
    Builder {
        BuilderName = 'Sorian UEF CDR HeavyOverMegaCanonLUpgrade',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1800,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'HeavyOverMegaCanonLUpgrade' }},
                { MIBC, 'FactionIndex', {1, 1}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'HeavyOverMegaCanonLUpgrade' },
        },
    },
    Builder {
        BuilderName = 'Sorian UEF CDR T3Engineering',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1700,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'T3Engineering' }},
                { MIBC, 'FactionIndex', {1, 1}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'T3Engineering' },
        },
    },
    Builder {
        BuilderName = 'Sorian UEF CDR T4Engineering',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1600,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'T4Engineering' }},
                { MIBC, 'FactionIndex', {1, 1}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'T4Engineering' },
        },
    },
    Builder {
        BuilderName = 'Sorian UEF CDR HeavyAntiAirLUpgrade',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1500,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'HeavyAntiAirLUpgrade' }},
                { MIBC, 'FactionIndex', {1, 1}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'HeavyAntiAirLUpgrade' },
        },
    },
    Builder {
        BuilderName = 'Sorian UEF CDR LeftMinigun',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1400,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'LeftMinigun' }},
                { MIBC, 'FactionIndex', {1, 1}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'LeftMinigun' },
        },
    },
    Builder {
        BuilderName = 'Sorian UEF CDR LeftPod',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1300,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'LeftPod' }},
                { MIBC, 'FactionIndex', {1, 1}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'LeftPod' },
        },
    },
   #Back:
    Builder {
        BuilderName = 'Sorian UEF CDR Shield',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 2000,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'Shield' }},
                { MIBC, 'FactionIndex', {1, 1}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'Shield' },
        },
    },
    Builder {
        BuilderName = 'Sorian UEF CDR ShieldGeneratorField',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1900,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'ShieldGeneratorField' }},
                { MIBC, 'FactionIndex', {1, 1}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'ShieldGeneratorField' },
        },
    },
   	Builder {
        BuilderName = 'Sorian UEF CDR DamageStablization',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1800,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'DamageStablization' }},
                { MIBC, 'FactionIndex', {1, 1}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'DamageStablization' },
        },
    },
    Builder {
        BuilderName = 'Sorian UEF CDR Health',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1700,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'Health' }},
                { MIBC, 'FactionIndex', {1, 1}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'Health' },
        },
    },
    Builder {
        BuilderName = 'Sorian UEF CDR Teleporter',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1600,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'Teleporter' }},
                { MIBC, 'FactionIndex', {1, 1}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'Teleporter' },
        },
    },
   #Right:
    Builder {
        BuilderName = 'Sorian UEF CDR HeavyBolterRUpgrade',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 2000,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'HeavyBolterRUpgrade' }},
                { MIBC, 'FactionIndex', {1, 1}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'HeavyBolterRUpgrade' },
        },
    },
    Builder {
        BuilderName = 'Sorian UEF CDR ResourceAllocationI',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1900,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'ResourceAllocationI' }},
                { MIBC, 'FactionIndex', {1, 1}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'ResourceAllocationI' },
        },
    },
    Builder {
        BuilderName = 'Sorian UEF CDR HeavyOverMegaCanonRUpgrade',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1800,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'HeavyOverMegaCanonRUpgrade' }},
                { MIBC, 'FactionIndex', {1, 1}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'HeavyOverMegaCanonRUpgrade' },
        },
    },
    Builder {
        BuilderName = 'Sorian UEF CDR ResourceAllocationII',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1700,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'ResourceAllocationII' }},
                { MIBC, 'FactionIndex', {1, 1}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'ResourceAllocationII' },
        },
    },
    Builder {
        BuilderName = 'Sorian UEF CDR HeavyAntiAirRUpgrade',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1600,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'HeavyAntiAirRUpgrade' }},
                { MIBC, 'FactionIndex', {1, 1}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'HeavyAntiAirRUpgrade' },
        },
    },
    Builder {
        BuilderName = 'Sorian UEF CDR RightMinigun',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1500,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'RightMinigun' }},
                { MIBC, 'FactionIndex', {1, 1}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'RightMinigun' },
        },
    },
    Builder {
        BuilderName = 'Sorian UEF CDR RightPod',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1400,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'RightPod' }},
                { MIBC, 'FactionIndex', {1, 1}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'RightPod' },
        },
    },
    
###Aeon
   #LCH: 
    Builder {
        BuilderName = 'Sorian Aeon CDR LeftDisruptor',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 2000,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'LeftDisruptor' }},
                { MIBC, 'FactionIndex', {2, 2}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'LeftDisruptor' },
        },
    },
    Builder {
        BuilderName = 'Sorian Aeon CDR AdvancedEngineering',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1900,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'AdvancedEngineering' }},
                { MIBC, 'FactionIndex', {2, 2}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'AdvancedEngineering' },
        },
    },
    Builder {
        BuilderName = 'Sorian Aeon CDR LeftQuantum',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1800,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'LeftQuantum' }},
                { MIBC, 'FactionIndex', {2, 2}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'LeftQuantum' },
        },
    },
    Builder {
        BuilderName = 'Sorian Aeon CDR LeftAntiair',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1700,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'LeftAntiair' }},
                { MIBC, 'FactionIndex', {2, 2}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'LeftAntiair' },
        },
    },
    Builder {
        BuilderName = 'Sorian Aeon CDR T3Engineering',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1600,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'T3Engineering' }},
                { MIBC, 'FactionIndex', {2, 2}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'T3Engineering' },
        },
    },
    Builder {
        BuilderName = 'Sorian Aeon CDR T4Engineering',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1500,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'T4Engineering' }},
                { MIBC, 'FactionIndex', {2, 2}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'T4Engineering' },
        },
    },
    Builder {
        BuilderName = 'Sorian Aeon CDR MultiMissile',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1400,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'MultiMissile' }},
                { MIBC, 'FactionIndex', {2, 2}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'MultiMissile' },
        },
    },
   #Back:
    Builder {
        BuilderName = 'Sorian Aeon CDR Shield',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 2000,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'Shield' }},
                { MIBC, 'FactionIndex', {2, 2}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'Shield' },
        },
    },
    Builder {
        BuilderName = 'Sorian Aeon CDR ResourceAllocation',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1900,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'ResourceAllocation' }},
                { MIBC, 'FactionIndex', {2, 2}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'ResourceAllocation' },
        },
    },
    Builder {
        BuilderName = 'Sorian Aeon CDR ChronoDampener',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1800,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'ChronoDampener' }},
                { MIBC, 'FactionIndex', {2, 2}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'ChronoDampener' },
        },
    },
    Builder {
        BuilderName = 'Sorian Aeon CDR ShieldHeavy',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1700,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'ShieldHeavy' }},
                { MIBC, 'FactionIndex', {2, 2}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'ShieldHeavy' },
        },
    },
    Builder {
        BuilderName = 'Sorian Aeon CDR ResourceAllocationAdvanced',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1600,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'ResourceAllocationAdvanced' }},
                { MIBC, 'FactionIndex', {2, 2}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'ResourceAllocationAdvanced' },
        },
    },
    Builder {
        BuilderName = 'Sorian Aeon CDR AdvanceChronoDampener',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1500,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'AdvanceChronoDampener' }},
                { MIBC, 'FactionIndex', {2, 2}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'AdvanceChronoDampener' },
        },
    },
   	Builder {
        BuilderName = 'Sorian Aeon CDR Teleporter',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1400,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'Teleporter' }},
                { MIBC, 'FactionIndex', {2, 2}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'Teleporter' },
        },
    },
   #Right:
   	Builder {
        BuilderName = 'Sorian Aeon CDR CrysalisBeam',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 2000,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'CrysalisBeam' }},
                { MIBC, 'FactionIndex', {2, 2}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'CrysalisBeam' },
        },
    },
    Builder {
        BuilderName = 'Sorian Aeon CDR EnhancedSensors',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1900,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'EnhancedSensors' }},
                { MIBC, 'FactionIndex', {2, 2}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'EnhancedSensors' },
        },
    },
    Builder {
        BuilderName = 'Sorian Aeon CDR HeatSink',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1800,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'HeatSink' }},
                { MIBC, 'FactionIndex', {2, 2}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'HeatSink' },
        },
    },
    Builder {
        BuilderName = 'Sorian Aeon CDR RightAntiair',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1700,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'RightAntiair' }},
                { MIBC, 'FactionIndex', {2, 2}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'RightAntiair' },
        },
    },
    Builder {
        BuilderName = 'Sorian Aeon CDR QuantumCooler',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1600,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'QuantumCooler' }},
                { MIBC, 'FactionIndex', {2, 2}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'QuantumCooler' },
        },
    },
    Builder {
        BuilderName = 'Sorian Aeon CDR OblivionGun',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1500,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'OblivionGun' }},
                { MIBC, 'FactionIndex', {2, 2}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'OblivionGun' },
        },
    },
####Cybran
  	#Left
  	Builder {
        BuilderName = 'Sorian Cybran CDR CoolingUpgrade',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 2000,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'CoolingUpgrade' }},
                { MIBC, 'FactionIndex', {3, 3}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'CoolingUpgrade' },
        },
    },
    Builder {
        BuilderName = 'Sorian Cybran CDR AdvancedEngineering',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1900,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'AdvancedEngineering' }},
                { MIBC, 'FactionIndex', {3, 3}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'AdvancedEngineering' },
        },
    },
    Builder {
        BuilderName = 'Sorian Cybran CDR ImprovedRipper',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1800,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'ImprovedRipper' }},
                { MIBC, 'FactionIndex', {3, 3}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'ImprovedRipper' },
        },
    },
    Builder {
        BuilderName = 'Sorian Cybran CDR T3Engineering',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1700,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'T3Engineering' }},
                { MIBC, 'FactionIndex', {3, 3}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'T3Engineering' },
        },
    },
    Builder {
        BuilderName = 'Sorian Cybran CDR T4Engineering',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1600,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'T4Engineering' }},
                { MIBC, 'FactionIndex', {3, 3}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'T4Engineering' },
        },
    },
    Builder {
        BuilderName = 'Sorian Cybran CDR BigArmor',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1500,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'BigArmor' }},
                { MIBC, 'FactionIndex', {3, 3}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'BigArmor' },
        },
    },
    #Back
    Builder {
        BuilderName = 'Sorian Cybran CDR StealthGenerator',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 2000,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'StealthGenerator' }},
                { MIBC, 'FactionIndex', {3, 3}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'StealthGenerator' },
        },
    },
    Builder {
        BuilderName = 'Sorian Cybran CDR ResourceAllocation',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1900,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'ResourceAllocation' }},
                { MIBC, 'FactionIndex', {3, 3}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'ResourceAllocation' },
        },
    },
    Builder {
        BuilderName = 'Sorian Cybran CDR CloakingGenerator',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1800,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'CloakingGenerator' }},
                { MIBC, 'FactionIndex', {3, 3}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'CloakingGenerator' },
        },
    },
    Builder {
        BuilderName = 'Sorian Cybran CDR Bullseye',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1700,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'Bullseye' }},
                { MIBC, 'FactionIndex', {3, 3}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'Bullseye' },
        },
    },
    Builder {
        BuilderName = 'Sorian Cybran CDR AntiMissile',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1600,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'AntiMissile' }},
                { MIBC, 'FactionIndex', {3, 3}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'AntiMissile' },
        },
    },
    Builder {
        BuilderName = 'Sorian Cybran CDR Teleporter',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1500,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'Teleporter' }},
                { MIBC, 'FactionIndex', {3, 3}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'Teleporter' },
        },
    },
    #Right
    Builder {
        BuilderName = 'Sorian Cybran CDR RRipper',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 2000,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'RRipper' }},
                { MIBC, 'FactionIndex', {3, 3}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'RRipper' },
        },
    },
    Builder {
        BuilderName = 'Sorian Cybran CDR NaniteTorpedoTube',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1900,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'NaniteTorpedoTube' }},
                { MIBC, 'FactionIndex', {3, 3}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'NaniteTorpedoTube' },
        },
    },
    Builder {
        BuilderName = 'Sorian Cybran CDR MicrowaveLaserGenerator',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1800,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'MicrowaveLaserGenerator' }},
                { MIBC, 'FactionIndex', {3, 3}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'MicrowaveLaserGenerator' },
        },
    },
    Builder {
        BuilderName = 'Sorian Cybran CDR AntiAir',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1700,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'AntiAir' }},
                { MIBC, 'FactionIndex', {3, 3}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'AntiAir' },
        },
    },
    Builder {
        BuilderName = 'Sorian Cybran CDR Artillery',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1600,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'Artillery' }},
                { MIBC, 'FactionIndex', {3, 3}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'Artillery' },
        },
    },
####Seraphim
		#Left
		Builder {
        BuilderName = 'Sorian Seraphim CDR BlastAttack',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 2000,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'BlastAttack' }},
                { MIBC, 'FactionIndex', {4, 4}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'BlastAttack' },
        },
    },
		Builder {
        BuilderName = 'Sorian Seraphim CDR AdvancedEngineering',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1900,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'AdvancedEngineering' }},
                { MIBC, 'FactionIndex', {4, 4}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'AdvancedEngineering' },
        },
    },
		Builder {
        BuilderName = 'Sorian Seraphim CDR MultiGun',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1800,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'MultiGun' }},
                { MIBC, 'FactionIndex', {4, 4}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'MultiGun' },
        },
    },
		Builder {
        BuilderName = 'Sorian Seraphim CDR T3Engineering',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1700,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'T3Engineering' }},
                { MIBC, 'FactionIndex', {4, 4}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'T3Engineering' },
        },
    },
		Builder {
        BuilderName = 'Sorian Seraphim CDR T4Engineering',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1600,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'T4Engineering' }},
                { MIBC, 'FactionIndex', {4, 4}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'T4Engineering' },
        },
    },
    #Back
    Builder {
        BuilderName = 'Sorian Seraphim CDR ResourceAllocation',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 2000,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'ResourceAllocation' }},
                { MIBC, 'FactionIndex', {4, 4}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'ResourceAllocation' },
        },
    },
		Builder {
        BuilderName = 'Sorian Seraphim CDR DamageStabilization',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1900,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'DamageStabilization' }},
                { MIBC, 'FactionIndex', {4, 4}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'DamageStabilization' },
        },
    },
		Builder {
        BuilderName = 'Sorian Seraphim CDR ResourceAllocationAdvanced',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1800,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'ResourceAllocationAdvanced' }},
                { MIBC, 'FactionIndex', {4, 4}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'ResourceAllocationAdvanced' },
        },
    },
		Builder {
        BuilderName = 'Sorian Seraphim CDR DamageStabilizationAdvanced',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1700,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'DamageStabilizationAdvanced' }},
                { MIBC, 'FactionIndex', {4, 4}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'DamageStabilizationAdvanced' },
        },
    },
		Builder {
        BuilderName = 'Sorian Seraphim CDR Teleporter',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1600,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'Teleporter' }},
                { MIBC, 'FactionIndex', {4, 4}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'Teleporter' },
        },
    },
		#Right
		Builder {
        BuilderName = 'Sorian Seraphim CDR RegenAura',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 2000,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'RegenAura' }},
                { MIBC, 'FactionIndex', {4, 4}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'RegenAura' },
        },
    },
    Builder {
        BuilderName = 'Sorian Seraphim CDR RateOfFire',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1900,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'RateOfFire' }},
                { MIBC, 'FactionIndex', {4, 4}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'RateOfFire' },
        },
    },
		Builder {
        BuilderName = 'Sorian Seraphim CDR AdvancedRegenAura',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1800,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'AdvancedRegenAura' }},
                { MIBC, 'FactionIndex', {4, 4}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'AdvancedRegenAura' },
        },
    },
		Builder {
        BuilderName = 'Sorian Seraphim CDR Antiair',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1700,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'Antiair' }},
                { MIBC, 'FactionIndex', {4, 4}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'Antiair' },
        },
    },
		Builder {
        BuilderName = 'Sorian Seraphim CDR Electrobolter',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1600,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'Electrobolter' }},
                { MIBC, 'FactionIndex', {4, 4}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'Electrobolter' },
        },
    },
		Builder {
        BuilderName = 'Sorian Seraphim CDR AdvanceAntiair',
        PlatoonTemplate = 'CommanderEnhanceSorian',
		Priority = 1500,
        BuilderConditions = {
                { SIBC, 'HaveGreaterThanUnitsWithCategory', { 1, 'FACTORY' }},
                { UC, 'CanUpgrade', { 'AdvanceAntiair' }},
                { MIBC, 'FactionIndex', {4, 4}},
            },
        PlatoonAddFunctions = { {SAI, 'BuildOnce'}, },
        BuilderType = 'Any',
        BuilderData = {
            Enhancement = { 'AdvanceAntiair' },
        },
    },
}