BuilderConditions = {
{ UCBC, 'HaveGreaterThanUnitsWithCategory', { 4, categories.ENGINEER * categories.TECH3}},
{ UCBC, 'UnitsLessAtLocation', { 'LocationType', 8, categories.SHIELD * categories.STRUCTURE}},
{ MIBC, 'FactionIndex', {1, 2, 4}},
{ EBC, 'GreaterThanEconEfficiencyOverTime', { 0.8, 1.1 }},
{ IBC, 'BrainNotLowPowerMode', {} },
},
function GreaterThanEconEfficiencyOverTime(aiBrain, MassEfficiency, EnergyEfficiency)
local econ = AIUtils.AIGetEconomyNumbers(aiBrain)
if (econ.MassEfficiencyOverTime >= MassEfficiency and econ.EnergyEfficiencyOverTime >= EnergyEfficiency) then
return true
end
return false
end
Statistics: Posted by Uveso — 05 Sep 2016, 02:28
function AIGetEconomyNumbers(aiBrain)
[...]
-- LOG('*AI DEBUG: RETURNING ECONOMY NUMBERS FROM AIBRAIN ', repr(aiBrain))
local econ = {}
econ.MassTrend = aiBrain:GetEconomyTrend('MASS')
econ.EnergyTrend = aiBrain:GetEconomyTrend('ENERGY')
econ.MassStorageRatio = aiBrain:GetEconomyStoredRatio('MASS')
econ.EnergyStorageRatio = aiBrain:GetEconomyStoredRatio('ENERGY')
econ.EnergyIncome = aiBrain:GetEconomyIncome('ENERGY')
econ.MassIncome = aiBrain:GetEconomyIncome('MASS')
econ.EnergyUsage = aiBrain:GetEconomyUsage('ENERGY')
econ.MassUsage = aiBrain:GetEconomyUsage('MASS')
econ.EnergyRequested = aiBrain:GetEconomyRequested('ENERGY')
econ.MassRequested = aiBrain:GetEconomyRequested('MASS')
econ.EnergyEfficiency = math.min(econ.EnergyIncome / econ.EnergyRequested, 2)
econ.MassEfficiency = math.min(econ.MassIncome / econ.MassRequested, 2)
econ.MassRequested = aiBrain:GetEconomyRequested('MASS')
econ.EnergyStorage = aiBrain:GetEconomyStored('ENERGY')
econ.MassStorage = aiBrain:GetEconomyStored('MASS')
[...]
Statistics: Posted by Uveso — 04 Sep 2016, 21:05
local aiBrain = self:GetAIBrain()
local massIncome = aiBrain:GetEconomyIncome( 'MASS' )
local energyIncome = aiBrain:GetEconomyIncome( 'ENERGY' )
local massNeed = aiBrain:GetEconomyRequested('MASS')
local energyNeed = aiBrain:GetEconomyRequested('ENERGY')
Statistics: Posted by Uveso — 04 Sep 2016, 21:02
if self:GetAIBrain().BrainType == 'Human' then
self:AddBuildRestriction(categories.xeb0204)
end
if self.BrainType == 'Human' then
AddBuildRestriction(self:GetArmyIndex(),categories.xeb0204)
end
Statistics: Posted by Balthazar — 04 Sep 2016, 03:22
Statistics: Posted by speed2 — 02 Sep 2016, 12:02
Statistics: Posted by Tanksy — 02 Sep 2016, 10:33