- Add InitialProductionDelay - Different attacksDelays for early game and late game - Adjust T3 unit production for selected missions - Implement InitialAttackDelay, TimeBetweenAttacks - Implement routines for idle units - Emergency mode - Airstrike rework
75 lines
2.4 KiB
Lua
75 lines
2.4 KiB
Lua
--[[
|
|
Copyright (c) The OpenRA Developers and Contributors
|
|
This file is part of OpenRA, which is free software. It is made
|
|
available to you under the terms of the GNU General Public License
|
|
as published by the Free Software Foundation, either version 3 of
|
|
the License, or (at your option) any later version. For more
|
|
information, see COPYING.
|
|
]]
|
|
|
|
AttackGroupSize =
|
|
{
|
|
easy = 6,
|
|
normal = 8,
|
|
hard = 10
|
|
}
|
|
|
|
ProductionDelays =
|
|
{
|
|
easy = { DateTime.Seconds(4), DateTime.Seconds(7) },
|
|
normal = { DateTime.Seconds(2), DateTime.Seconds(5) },
|
|
hard = { DateTime.Seconds(1), DateTime.Seconds(3) }
|
|
}
|
|
|
|
OrdosInfantryTypes = { "light_inf", "light_inf", "light_inf", "trooper", "trooper" }
|
|
|
|
InitAIUnits = function()
|
|
Defending[Ordos] = {}
|
|
AttackDelay[Ordos] = 12000 * DifficultyModifier[Difficulty]
|
|
TimeBetweenAttacks[Ordos] = 5000 * DifficultyModifier[Difficulty]
|
|
DefencePerimeter[Ordos] = GetCellsInRectangle(CPos.New(9,6), CPos.New(20,27))
|
|
IdlingUnits[Ordos] = Reinforcements.Reinforce(Ordos, InitialOrdosReinforcements, OrdosPaths[2])
|
|
DefendAndRepairBase(Ordos, OrdosBase, 0.75, AttackGroupSize[Difficulty])
|
|
end
|
|
|
|
ActivateAI = function()
|
|
LastHarvesterEaten[Ordos] = true
|
|
Trigger.AfterDelay(0, InitAIUnits)
|
|
|
|
OConyard.Produce(AtreidesUpgrades[1])
|
|
|
|
local delay = function() return Utils.RandomInteger(ProductionDelays[Difficulty][1], ProductionDelays[Difficulty][2] + 1) end
|
|
local toBuild = function() return { Utils.Random(OrdosInfantryTypes) } end
|
|
local attackThresholdSize = AttackGroupSize[Difficulty] * 2.5
|
|
|
|
-- Finish the upgrades first before trying to build something
|
|
Trigger.AfterDelay(DateTime.Seconds(14), function()
|
|
ProduceUnits(Ordos, OBarracks, delay, toBuild, AttackGroupSize[Difficulty], attackThresholdSize)
|
|
end)
|
|
|
|
if Difficulty ~= "easy" then
|
|
Ordos.GrantCondition("base-rebuilder")
|
|
end
|
|
|
|
local productionTypes =
|
|
{
|
|
barracks = toBuild,
|
|
}
|
|
|
|
Trigger.OnBuildingPlaced(Ordos, function(p, building)
|
|
table.insert(OrdosBase, building)
|
|
DefendAndRepairBase(Ordos, {building}, 0.75, AttackGroupSize[Difficulty] )
|
|
if productionTypes[building.Type] == nil then return end
|
|
ProduceUnits(Ordos, building, delay, productionTypes[building.Type], AttackGroupSize[Difficulty], attackThresholdSize)
|
|
end)
|
|
|
|
Utils.Do(OrdosScouts, function(a)
|
|
Trigger.OnKilled(a, function(self, killer)
|
|
if not killer.IsDead then
|
|
CheckArea(Ordos, killer.Location, 4)
|
|
end
|
|
end)
|
|
end)
|
|
|
|
end
|