Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: AI can now upgrade Hydrocarbon Power Plants #255

Merged
merged 3 commits into from Oct 25, 2018
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -0,0 +1,49 @@


-- LandScoutFormBuilders are used from all basetemplates. Perfect for hooking
BuilderGroup {
BuilderGroupName = 'LandScoutFormBuilders',
BuildersType = 'PlatoonFormBuilder',
-- Hydrocarbon Power Plant upgrade START -----------------------------------------
Builder {
BuilderName = 'T1 HydroUpgrade',
PlatoonTemplate = 'T1PowerHydroUpgrade',
Priority = 200,
InstanceCount = 1,
BuilderConditions = {
{ UCBC, 'HaveGreaterThanUnitsWithCategory', { 0, categories.HYDROCARBON * categories.ENERGYPRODUCTION * categories.TECH1 } },
{ UCBC, 'HaveLessThanUnitsInCategoryBeingBuilt', { 1, categories.HYDROCARBON * categories.ENERGYPRODUCTION * categories.TECH2 } },
{ EBC, 'GreaterThanEconIncome', { 2, 10 } },
{ EBC, 'GreaterThanEconEfficiencyOverTime', { 0, 0 }},
},
FormRadius = 10000,
BuilderType = 'Any',
},
Builder {
BuilderName = 'T2 HydroUpgrade',
PlatoonTemplate = 'T2PowerHydroUpgrade',
Priority = 200,
InstanceCount = 1,
BuilderConditions = {
{ UCBC, 'HaveLessThanUnitsWithCategory', { 1, categories.HYDROCARBON * categories.ENERGYPRODUCTION * categories.TECH1 } },
{ UCBC, 'HaveGreaterThanUnitsWithCategory', { 0, categories.HYDROCARBON * categories.ENERGYPRODUCTION * categories.TECH2 } },
{ UCBC, 'HaveLessThanUnitsInCategoryBeingBuilt', { 1, categories.HYDROCARBON * categories.ENERGYPRODUCTION * categories.TECH3 } },
{ EBC, 'GreaterThanEconIncome', { 2.6, 60 } },
{ EBC, 'GreaterThanEconEfficiencyOverTime', { 0, 0 }},
},
FormRadius = 10000,
BuilderType = 'Any',
},
-- Hydrocarbon Power Plant upgrade END -------------------------------------------
Builder {
BuilderName = 'T1 Land Scout Form',
BuilderConditions = {
#{ UCBC, 'HaveLessThanUnitsWithCategory', { 1, categories.FACTORY * categories.LAND - categories.TECH1 }},
},
PlatoonTemplate = 'T1LandScoutForm',
Priority = 725,
InstanceCount = 3,
LocationType = 'LocationType',
BuilderType = 'Any',
},
}
@@ -0,0 +1,70 @@

-- SorianEngineerFactoryBuilders are used from all basetemplates. Perfect for hooking
BuilderGroup {
BuilderGroupName = 'SorianLandScoutFormBuilders',
BuildersType = 'PlatoonFormBuilder',
-- Hydrocarbon Power Plant upgrade START -----------------------------------------
Builder {
BuilderName = 'Sorian T1 HydroUpgrade',
PlatoonTemplate = 'T1PowerHydroUpgrade',
Priority = 200,
InstanceCount = 1,
BuilderConditions = {
{ UCBC, 'HaveGreaterThanUnitsWithCategory', { 0, categories.HYDROCARBON * categories.ENERGYPRODUCTION * categories.TECH1 } },
{ UCBC, 'HaveLessThanUnitsInCategoryBeingBuilt', { 1, categories.HYDROCARBON * categories.ENERGYPRODUCTION * categories.TECH2 } },
{ SIBC, 'GreaterThanEconIncome', { 2, 10 } },
{ SIBC, 'GreaterThanEconEfficiencyOverTime', { 0, 0 }},
},
FormRadius = 10000,
BuilderType = 'Any',
},
Builder {
BuilderName = 'Sorian T2 HydroUpgrade',
PlatoonTemplate = 'T2PowerHydroUpgrade',
Priority = 200,
InstanceCount = 1,
BuilderConditions = {
{ UCBC, 'HaveLessThanUnitsWithCategory', { 1, categories.HYDROCARBON * categories.ENERGYPRODUCTION * categories.TECH1 } },
{ UCBC, 'HaveGreaterThanUnitsWithCategory', { 0, categories.HYDROCARBON * categories.ENERGYPRODUCTION * categories.TECH2 } },
{ UCBC, 'HaveLessThanUnitsInCategoryBeingBuilt', { 1, categories.HYDROCARBON * categories.ENERGYPRODUCTION * categories.TECH3 } },
{ SIBC, 'GreaterThanEconIncome', { 2.6, 60 } },
{ SIBC, 'GreaterThanEconEfficiencyOverTime', { 0, 0 }},
},
FormRadius = 10000,
BuilderType = 'Any',
},
-- Hydrocarbon Power Plant upgrade END -------------------------------------------
Builder {
BuilderName = 'Sorian T1 Land Scout Form init',
BuilderConditions = {
#{ UCBC, 'HaveLessThanUnitsWithCategory', { 1, categories.FACTORY * categories.LAND - categories.TECH1 }},
{ SBC, 'LessThanGameTime', { 300 } },
{ SBC, 'NoRushTimeCheck', { 0 }},
},
PlatoonTemplate = 'T1LandScoutFormSorian',
Priority = 10000, #725,
InstanceCount = 30,
BuilderData = {
UseCloak = false,
},
LocationType = 'LocationType',
BuilderType = 'Any',
},
Builder {
BuilderName = 'Sorian T1 Land Scout Form',
BuilderConditions = {
{ UCBC, 'HaveLessThanUnitsWithCategory', { 2, categories.FACTORY * categories.AIR * categories.TECH3 }},
{ SBC, 'GreaterThanGameTime', { 300 } },
{ SBC, 'NoRushTimeCheck', { 0 }},
},
PlatoonTemplate = 'T1LandScoutFormSorian',
Priority = 10000, #725,
InstanceCount = 30,
BuilderData = {
UseCloak = true,
},
LocationType = 'LocationType',
BuilderType = 'Any',
},

}
@@ -0,0 +1,35 @@

-- Platoon template for Hydrocarbon Power Plant upgrade.
-- called from AIBuilders

PlatoonTemplate {
Name = 'T1PowerHydroUpgrade',
Plan = 'UnitUpgradeAI',
GlobalSquads = {
{ categories.HYDROCARBON * categories.ENERGYPRODUCTION * categories.TECH1, 1, 1, 'support', 'None' },
}
}
PlatoonTemplate {
Name = 'T2PowerHydroUpgrade',
Plan = 'UnitUpgradeAI',
GlobalSquads = {
{ categories.HYDROCARBON * categories.ENERGYPRODUCTION * categories.TECH2, 1, 1, 'support', 'None' },
}
}


-- StructureUpgradeTemplates for Hydrocarbon Power Plant upgrade.
-- called from platoon.lua -> UnitUpgradeAI()

-- earth structure upgrades
table.insert(StructureUpgradeTemplates[1], { 'ueb1102', 'beb1202'} ) -- Hydrocarbon Power Plant. Upgrade from TECH1 to TECH2
table.insert(StructureUpgradeTemplates[1], { 'beb1202', 'beb1302'} ) -- Hydrocarbon Power Plant. Upgrade from TECH2 to TECH3
-- alien structure upgrades
table.insert(StructureUpgradeTemplates[2], { 'uab1102', 'bab1202'} ) -- Hydrocarbon Power Plant. Upgrade from TECH1 to TECH2
table.insert(StructureUpgradeTemplates[2], { 'bab1202', 'bab1302'} ) -- Hydrocarbon Power Plant. Upgrade from TECH2 to TECH3
-- recycler structure upgrades
table.insert(StructureUpgradeTemplates[3], { 'urb1102', 'brb1202'} ) -- Hydrocarbon Power Plant. Upgrade from TECH1 to TECH2
table.insert(StructureUpgradeTemplates[3], { 'brb1202', 'brb1302'} ) -- Hydrocarbon Power Plant. Upgrade from TECH2 to TECH3
-- seraphim structure upgrades
table.insert(StructureUpgradeTemplates[4], { 'xsb1102', 'bsb1202'} ) -- Hydrocarbon Power Plant. Upgrade from TECH1 to TECH2
table.insert(StructureUpgradeTemplates[4], { 'bsb1202', 'bsb1302'} ) -- Hydrocarbon Power Plant. Upgrade from TECH2 to TECH3
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.