if ( self.GetIsInCombat ) andnotself:GetIsInCombat() andnotself:isa("PowerPoint") andself:GetTeamNumber() ==1andnotself:GetIsBuilt() andGetIsRoomPowerUp(self) then
-- Print("derp")
self:Construct(0.0125)
end
end
localfunctionLocationsMatch(who,whom)
local whoname =GetLocationForPoint(who:GetOrigin())
@@ -44,80 +67,23 @@ function CommandStructure:OnUpdateAnimationInput(modelMixin)
wherelocation = wherelocation and wherelocation:GetName() or""
ifnot wherelocation thenreturnend
for _, eligable inipairs(GetEntitiesWithMixinForTeamWithinRange("Construct", 1, where, 72)) do
ifnot eligable:isa("PowerPoint") andnot eligable:isa("Extractor") andnotGetIsPointInMarineBase(eligable:GetOrigin()) then
local location =GetLocationForPoint(eligable:GetOrigin())
local locationName = location and location:GetName() or""
local sameLocation = locationName == wherelocation
if sameLocation then
local Janitor =CreateEntity(Janitor.kMapName, FindFreeSpace(eligable:GetOrigin()), 2)
Janitor:SetConstructionComplete()
Janitor:SetMature()
end--
end
end--
end
localfunctionSpawnSurgeForEach(where)
local wherelocation =GetLocationForPoint(where)
wherelocation = wherelocation and wherelocation:GetName() or""
ifnot wherelocation thenreturnend
for _, eligable inipairs(GetEntitiesWithMixinForTeamWithinRange("Construct", 2, where, 72)) do
-- if not eligable:isa("Harvester") and not eligable:isa("Cyst") and not eligable:isa("Hive") then --and not GetIsPointInMarineBase(eligable:GetOrigin()) then
local location =GetLocationForPoint(eligable:GetOrigin())
local locationName = location and location:GetName() or""
local sameLocation = locationName == wherelocation
ifnotself:isa("CommandStructure") andnotself:isa("Cyst") and hitPoint ~=niland (attacker ~=niland attacker:isa("Player") or attacker:isa("Janitor") ) then
ifnotself:isa("CommandStructure") andnotself:isa("Cyst") and hitPoint ~=niland (attacker ~=niland attacker:isa("Player") ) then
local mult =1
local wherelocation =GetLocationForPoint(self:GetOrigin())
ifnot wherelocation thenreturnend
@@ -175,110 +141,10 @@ function ArmsLab:ModifyDamageTaken(damageTable, attacker, doer, damageType, hitP
end
*/
localfunctionGetDestinationGate(self)
local phaseGates = {}
-- Find next phase gate to teleport to
ifself:isa("PhaseAvoca") then
for index, payload inipairs( GetEntitiesForTeam("AvocaArc", self:GetTeamNumber()) ) do
ifGetIsUnitActive(payload) then
return payload
end
end
end
for index, phaseGate inipairs( GetEntitiesForTeam("PhaseGate", self:GetTeamNumber()) ) do
ifGetIsUnitActive(phaseGate) andnot phaseGate:isa("PhaseAvoca") then
table.insert(phaseGates, phaseGate)
end
end
if table.count(phaseGates) <2then
returnnil
end
-- Find our index and add 1
local index = table.find(phaseGates, self)
if (index ~=nil) then
local nextIndex =ConditionalValue(index == table.count(phaseGates), 1, index +1)
ASSERT(nextIndex >=1)
ASSERT(nextIndex <= table.count(phaseGates))
return phaseGates[nextIndex]
end
returnnil
end
--So that we can teleport to the payload without having to run to it all the time :P
if orderType == kTechId.Defaultor orderType == kTechId.Growor orderType == kTechId.Movethen
if orderTarget andHasMixin(orderTarget, "Construct") andnot orderTarget:GetIsBuilt() andGetAreFriends(self, orderTarget) and (not orderTarget.GetCanAutoBuildor orderTarget:GetCanAutoBuild()) then
order:SetType(kTechId.Grow)
elseif orderTarget and orderTarget:isa("Alien") and orderTarget:GetIsAlive() then