Skip to content
Permalink
Browse files

hopefully fixed Zaal DAI

  • Loading branch information
Damgam committed Feb 8, 2020
1 parent 840f755 commit 4de378dc630a4d899a4ad5cfc258dfb95f463a89
Showing with 35 additions and 4 deletions.
  1. +34 −3 LuaRules/Gadgets/ai/EvoRTS/taskqueues.lua
  2. +1 −1 LuaRules/Gadgets/ai/preload/spring_lua/unittype.lua
@@ -1104,7 +1104,24 @@ end
-- end

local function ZaalBuildHatch(tqb, ai, unit)
return "zhatch"
local mc, ms, mp, mi, me = Spring.GetTeamResources(ai.id, "metal")
local ec, es, ep, ei, ee = Spring.GetTeamResources(ai.id, "energy")
local SpawnerCount = GetZaalSpawners(tqb,ai,unit)
if SpawnerCount < 1 then
return "zhatch"
elseif ec >= es*0.7 and mc >= ms*0.5 and GG.TechCheck("tech1", ai.id) then
if SpawnerCount <= Spring.GetGameSeconds()/300
return "zhatch"
else
return "ztenticle"
end
else
return "zmex"
end
end

local function ZaalBuildMetal(tqb, ai, unit)
return "zmex"
end

local function ZaalBuildEnergy(tqb, ai, unit)
@@ -1115,7 +1132,7 @@ local function ZaalBuildEnergy(tqb, ai, unit)
elseif ec <= es*0.7 and GG.TechCheck("tech1", ai.id) then
return "zespire1"
else
return "zhatch"
return "zmex"
end
end

@@ -1128,7 +1145,7 @@ local function ZaalBuildSupply(tqb, ai, unit)
elseif su > sm - 35 and sm ~= MaximumSupply then
return "ztiberium"
else
return "zhatch"
return "zmex"
end
end

@@ -1148,21 +1165,31 @@ local ZaalHive3 = {

local ZaalArm = {
ZaalBuildHatch,
ZaalBuildMetal,
ZaalBuildSupply,
ZaalBuildEnergy,
ZaalBuildMetal,
ZaalBuildSupply,
ZaalBuildEnergy,
ZaalBuildMetal,
ZaalBuildSupply,
ZaalBuildEnergy,
ZaalBuildMetal,
ZaalBuildSupply,
ZaalBuildEnergy,
ZaalBuildMetal,
ZaalBuildSupply,
ZaalBuildEnergy,
ZaalBuildMetal,
}

local ZaalEspire = {
ZaalMorph,
}

local ZaalTenticle = {
assistaround,
}

-- Pattern

@@ -1301,10 +1328,14 @@ taskqueues = {
zhatch_up2 = ZaalHive3,
zhatch = ZaalHive1,
zhatch_up1 = ZaalHive2,
zmex = ZaalEspire,
zmex_up1 = ZaalEspire,
zmex_up2 = ZaalEspire,
zespire1 = ZaalEspire,
zespire4 = ZaalEspire,
xcommander = xcommanderqueue,
xkconstructor = xk1constructor,
xklab = PatternKLab,
ztenticle = ZaalTenticle,
}
----------------------------------------------------------
@@ -71,7 +71,7 @@ function ShardUnitType:WeaponCount()
end

function ShardUnitType:Extractor()
if self.def.name == "xmetalextractor" or self.def.name == "xmetalextractormoho" then
if self.def.name == "xmetalextractor" or self.def.name == "xmetalextractormoho" or string.find(self.def.name, "zmex") then
return true
elseif self.def.customParams.metal_extractor then
return true

0 comments on commit 4de378d

Please sign in to comment.
You can’t perform that action at this time.