Permalink
Browse files

legit morphing for AI metal extractors

  • Loading branch information...
Damgam committed Oct 7, 2018
1 parent e36a1ab commit 3a6b5af5e84e6a9ef1465c1271b66c2ca3b705b1
@@ -67,9 +67,13 @@ end
function AttackerBehaviour:AttackCell(cell)
local unit = self.unit:Internal()
local unitID = unit.id
local teamID = ai.id
local r = math.random(0,1000)
if r == 0 then
Spring.GiveOrderToUnit(unitID, 31337, {}, {})
local ec = Spring.GetTeamResources(ai.id, "energy")
if ec > 100 then
Spring.GiveOrderToUnit(unitID, 31337, {}, {})
end
end
--attack
if unitID%60 == Spring.GetGameFrame()%60 then
@@ -5,9 +5,9 @@ Attackers!
attackerlist = {
------------- Morphs
---Buildings, just to make them upgrade
--"emetalextractor",
--"emetalextractor_up1",
--"emetalextractor_up2",
"emetalextractor",
"emetalextractor_up1",
"emetalextractor_up2",
"etech1",
"etech2",
---Amphibs
@@ -187,15 +187,17 @@ function gadget:GameFrame(n)
local isAiTeam = select(4, Spring.GetTeamInfo(TeamID))
local aiCheatHandicapMetal = aiCheatHandicapMetal*0.1
if isAiTeam then
local aimexamount = Spring.GetTeamUnitDefCount(TeamID, UnitDefNames.emetalextractor.id)
local UDC = Spring.GetTeamUnitDefCount
local UDN = UnitDefNames
local aimexamount = UDC(TeamID, UDN.emetalextractor.id) + UDC(TeamID, UDN.emetalextractor_up1.id) + UDC(TeamID, UDN.emetalextractor_up2.id) + UDC(TeamID, UDN.emetalextractor_up3.id)
if GG.TechCheck("tech3", TeamID) == true then
Spring.AddTeamResource(TeamID,"m", aimexamount+aiCheatHandicapMetal*aimexamount*2.5)
Spring.AddTeamResource(TeamID,"m", aiCheatHandicapMetal*aimexamount*2)
elseif GG.TechCheck("tech2", TeamID) == true then
Spring.AddTeamResource(TeamID,"m", aimexamount*0.66+aiCheatHandicapMetal*aimexamount*2)
Spring.AddTeamResource(TeamID,"m", aiCheatHandicapMetal*aimexamount*1.66)
elseif GG.TechCheck("tech1", TeamID) == true then
Spring.AddTeamResource(TeamID,"m", aimexamount*0.33+aiCheatHandicapMetal*aimexamount*1.5)
Spring.AddTeamResource(TeamID,"m", aiCheatHandicapMetal*aimexamount*1.33)
else
Spring.AddTeamResource(TeamID,"m", aimexamount*aiCheatHandicapMetal)
Spring.AddTeamResource(TeamID,"m", aiCheatHandicapMetal*aimexamount)
end
--Spring.AddTeamResource(TeamID,"m", aiCheatHandicapMetal)
end

0 comments on commit 3a6b5af

Please sign in to comment.