Initial commit: OpenRA game engine
Fork from OpenRA/OpenRA with one-click launch script (start-ra.cmd) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
77
mods/d2k/maps/atreides-05/atreides05-AI.lua
Normal file
77
mods/d2k/maps/atreides-05/atreides05-AI.lua
Normal file
@@ -0,0 +1,77 @@
|
||||
--[[
|
||||
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
|
||||
}
|
||||
|
||||
AttackDelays =
|
||||
{
|
||||
easy = { DateTime.Seconds(4), DateTime.Seconds(7) },
|
||||
normal = { DateTime.Seconds(2), DateTime.Seconds(5) },
|
||||
hard = { DateTime.Seconds(1), DateTime.Seconds(3) }
|
||||
}
|
||||
|
||||
HarkonnenInfantryTypes = { "light_inf", "light_inf", "trooper", "trooper", "trooper" }
|
||||
HarkonnenVehicleTypes = { "trike", "trike", "trike", "quad", "quad" }
|
||||
HarkonnenTankType = { "combat_tank_h" }
|
||||
|
||||
InitAIUnits = function()
|
||||
IdlingUnits[Harkonnen] = Reinforcements.ReinforceWithTransport(Harkonnen, "carryall.reinforce", InitialHarkonnenReinforcements, HarkonnenPaths[1], { HarkonnenPaths[1][1] })[2]
|
||||
|
||||
DefendAndRepairBase(Harkonnen, HarkonnenBase, 0.75, AttackGroupSize[Difficulty])
|
||||
DefendActor(HarkonnenBarracks, Harkonnen, AttackGroupSize[Difficulty])
|
||||
RepairBuilding(Harkonnen, HarkonnenBarracks, 0.75)
|
||||
|
||||
Utils.Do(SmugglerBase, function(actor)
|
||||
RepairBuilding(Smuggler, actor, 0.75)
|
||||
end)
|
||||
RepairBuilding(Smuggler, Starport, 0.75)
|
||||
end
|
||||
|
||||
-- Not using ProduceUnits because of the custom StopInfantryProduction condition
|
||||
ProduceInfantry = function()
|
||||
if StopInfantryProduction or HarkonnenBarracks.IsDead or HarkonnenBarracks.Owner ~= Harkonnen then
|
||||
return
|
||||
end
|
||||
|
||||
if HoldProduction[Harkonnen] then
|
||||
Trigger.AfterDelay(DateTime.Seconds(30), ProduceInfantry)
|
||||
return
|
||||
end
|
||||
|
||||
local delay = Utils.RandomInteger(AttackDelays[Difficulty][1], AttackDelays[Difficulty][2] + 1)
|
||||
local toBuild = { Utils.Random(HarkonnenInfantryTypes) }
|
||||
Harkonnen.Build(toBuild, function(unit)
|
||||
IdlingUnits[Harkonnen][#IdlingUnits[Harkonnen] + 1] = unit[1]
|
||||
Trigger.AfterDelay(delay, ProduceInfantry)
|
||||
|
||||
if #IdlingUnits[Harkonnen] >= (AttackGroupSize[Difficulty] * 2.5) then
|
||||
SendAttack(Harkonnen, AttackGroupSize[Difficulty])
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
ActivateAI = function()
|
||||
Harkonnen.Cash = 15000
|
||||
LastHarvesterEaten[Harkonnen] = true
|
||||
InitAIUnits()
|
||||
|
||||
local delay = function() return Utils.RandomInteger(AttackDelays[Difficulty][1], AttackDelays[Difficulty][2] + 1) end
|
||||
local vehilcesToBuild = function() return { Utils.Random(HarkonnenVehicleTypes) } end
|
||||
local tanksToBuild = function() return HarkonnenTankType end
|
||||
local attackThresholdSize = AttackGroupSize[Difficulty] * 2.5
|
||||
|
||||
ProduceInfantry()
|
||||
ProduceUnits(Harkonnen, HarkonnenLightFactory, delay, vehilcesToBuild, AttackGroupSize[Difficulty], attackThresholdSize)
|
||||
ProduceUnits(Harkonnen, HarkonnenHeavyFactory, delay, tanksToBuild, AttackGroupSize[Difficulty], attackThresholdSize)
|
||||
end
|
||||
430
mods/d2k/maps/atreides-05/atreides05.lua
Normal file
430
mods/d2k/maps/atreides-05/atreides05.lua
Normal file
@@ -0,0 +1,430 @@
|
||||
--[[
|
||||
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.
|
||||
]]
|
||||
|
||||
HarkonnenBase = { HarkonnenConstructionYard, HarkonnenWindTrap1, HarkonnenWindTrap2, HarkonnenWindTrap3, HarkonnenWindTrap4, HarkonnenWindTrap5, HarkonnenWindTrap6, HarkonnenWindTrap7, HarkonnenWindTrap8, HarkonnenSilo1, HarkonnenSilo2, HarkonnenSilo3, HarkonnenSilo4, HarkonnenGunTurret1, HarkonnenGunTurret2, HarkonnenGunTurret3, HarkonnenGunTurret4, HarkonnenGunTurret5, HarkonnenGunTurret6, HarkonnenGunTurret7, HarkonnenHeavyFactory, HarkonnenRefinery, HarkonnenOutpost, HarkonnenLightFactory }
|
||||
SmugglerBase = { SmugglerWindTrap1, SmugglerWindTrap2 }
|
||||
|
||||
HarkonnenReinforcements =
|
||||
{
|
||||
easy =
|
||||
{
|
||||
{ "combat_tank_h", "trooper", "trooper", "trooper", "trooper" },
|
||||
{ "trooper", "trooper", "trooper", "trooper", "trooper" },
|
||||
{ "combat_tank_h", "light_inf", "light_inf", "trooper", "trooper" },
|
||||
{ "combat_tank_h", "light_inf", "light_inf", "light_inf", "trooper", "trooper" },
|
||||
{ "combat_tank_h", "trike", "light_inf", "light_inf", "trooper", "trooper" }
|
||||
},
|
||||
|
||||
normal =
|
||||
{
|
||||
{ "combat_tank_h", "trooper", "trooper", "trooper", "trooper" },
|
||||
{ "trooper", "trooper", "trooper", "trooper", "trooper" },
|
||||
{ "combat_tank_h", "light_inf", "light_inf", "trooper", "trooper" },
|
||||
{ "combat_tank_h", "light_inf", "light_inf", "light_inf", "trooper", "trooper" },
|
||||
{ "combat_tank_h", "trike", "light_inf", "light_inf", "trooper", "trooper" },
|
||||
{ "combat_tank_h", "trike", "combat_tank_h", "light_inf", "trooper", "trooper", "quad" },
|
||||
{ "combat_tank_h", "trike", "light_inf", "light_inf", "trooper", "trooper", "quad", "quad" }
|
||||
},
|
||||
|
||||
hard =
|
||||
{
|
||||
{ "combat_tank_h", "trooper", "trooper", "trooper", "trooper" },
|
||||
{ "trooper", "trooper", "trooper", "trooper", "trooper" },
|
||||
{ "combat_tank_h", "light_inf", "light_inf", "trooper", "trooper" },
|
||||
{ "combat_tank_h", "light_inf", "light_inf", "light_inf", "trooper", "trooper" },
|
||||
{ "combat_tank_h", "trike", "light_inf", "light_inf", "trooper", "trooper" },
|
||||
{ "combat_tank_h", "trike", "combat_tank_h", "light_inf", "trooper", "trooper", "quad" },
|
||||
{ "combat_tank_h", "trike", "light_inf", "light_inf", "trooper", "trooper", "quad", "quad" },
|
||||
{ "combat_tank_h", "combat_tank_h", "trike", "light_inf", "light_inf", "trooper", "trooper", "quad", "quad" },
|
||||
{ "combat_tank_h", "combat_tank_h", "combat_tank_h", "combat_tank_h", "combat_tank_h", "combat_tank_h" }
|
||||
}
|
||||
}
|
||||
|
||||
HarkonnenInfantryReinforcements =
|
||||
{
|
||||
normal =
|
||||
{
|
||||
{ "light_inf", "light_inf", "light_inf", "trooper", "trooper", "trooper", "trooper", "trooper" }
|
||||
},
|
||||
|
||||
hard =
|
||||
{
|
||||
{ "light_inf", "light_inf", "light_inf", "light_inf", "trooper", "trooper", "trooper", "trooper", "trooper", "trooper", "trooper", "trooper" },
|
||||
{ "light_inf", "light_inf", "light_inf", "light_inf", "light_inf", "light_inf", "light_inf", "light_inf", "light_inf", "trooper", "trooper", "trooper", "trooper", "trooper" }
|
||||
}
|
||||
}
|
||||
InfantryPath = { HarkonnenEntry3.Location }
|
||||
|
||||
HarkonnenAttackDelay =
|
||||
{
|
||||
easy = DateTime.Minutes(3),
|
||||
normal = DateTime.Minutes(2) + DateTime.Seconds(20),
|
||||
hard = DateTime.Minutes(1)
|
||||
}
|
||||
|
||||
HarkonnenAttackWaves =
|
||||
{
|
||||
easy = 5,
|
||||
normal = 7,
|
||||
hard = 9
|
||||
}
|
||||
|
||||
MercenaryReinforcements =
|
||||
{
|
||||
easy =
|
||||
{
|
||||
{ "combat_tank_o", "combat_tank_o", "quad", "quad", "light_inf", "light_inf", "light_inf", "light_inf" },
|
||||
{ "trike", "trike", "quad", "quad", "quad", "trike", "trike", "trike" },
|
||||
{ "combat_tank_o", "combat_tank_o", "combat_tank_o", "combat_tank_o", "light_inf", "light_inf", "light_inf", "trooper", "trooper", "trooper", "trooper" }
|
||||
},
|
||||
|
||||
normal =
|
||||
{
|
||||
{ "trike", "trike", "quad", "quad", "quad", "trike", "trike", "trike" },
|
||||
{ "combat_tank_o", "combat_tank_o", "quad", "quad", "light_inf", "light_inf", "light_inf", "light_inf" },
|
||||
{ "combat_tank_o", "combat_tank_o", "combat_tank_o", "combat_tank_o", "light_inf", "light_inf", "light_inf", "trooper", "trooper", "trooper", "trooper" },
|
||||
{ "combat_tank_o", "combat_tank_o", "quad", "quad", "light_inf", "light_inf", "light_inf", "light_inf", "trooper", "trooper", "trooper" },
|
||||
{ "trike", "trike", "quad", "quad", "quad", "trike", "trike", "trike", "trike", "trike", "trike" },
|
||||
{ "combat_tank_o", "combat_tank_o", "combat_tank_o", "combat_tank_o", "combat_tank_o", "combat_tank_o", "light_inf", "light_inf", "light_inf", "trooper", "trooper", "trooper", "trooper" }
|
||||
},
|
||||
|
||||
hard =
|
||||
{
|
||||
{ "combat_tank_o", "combat_tank_o", "quad", "quad", "light_inf", "light_inf", "light_inf", "light_inf" },
|
||||
{ "trike", "trike", "quad", "quad", "quad", "trike", "trike", "trike" },
|
||||
{ "combat_tank_o", "combat_tank_o", "combat_tank_o", "combat_tank_o", "light_inf", "light_inf", "light_inf", "trooper", "trooper", "trooper", "trooper" },
|
||||
{ "trike", "trike", "quad", "quad", "quad", "trike", "trike", "trike", "trike", "trike", "trike" },
|
||||
{ "combat_tank_o", "combat_tank_o", "quad", "quad", "light_inf", "light_inf", "light_inf", "light_inf", "trooper", "trooper", "trooper" },
|
||||
{ "combat_tank_o", "combat_tank_o", "combat_tank_o", "combat_tank_o", "combat_tank_o", "combat_tank_o", "light_inf", "light_inf", "light_inf", "trooper", "trooper", "trooper", "trooper" },
|
||||
{ "combat_tank_o", "combat_tank_o", "quad", "quad", "trike", "trike", "light_inf", "light_inf", "light_inf", "light_inf", "trooper", "trooper", "trooper" },
|
||||
{ "trike", "trike", "quad", "quad", "quad", "trike", "trike", "trike", "trike", "trike", "trike", "quad", "quad" },
|
||||
{ "combat_tank_o", "combat_tank_o", "combat_tank_o", "combat_tank_o", "combat_tank_o", "combat_tank_o", "trike", "trike", "quad", "quad", "light_inf", "light_inf", "light_inf", "trooper", "trooper", "trooper", "trooper" }
|
||||
}
|
||||
}
|
||||
|
||||
MercenaryAttackDelay =
|
||||
{
|
||||
easy = DateTime.Minutes(2) + DateTime.Seconds(40),
|
||||
normal = DateTime.Minutes(1) + DateTime.Seconds(50),
|
||||
hard = DateTime.Minutes(1) + DateTime.Seconds(10)
|
||||
}
|
||||
|
||||
MercenaryAttackWaves =
|
||||
{
|
||||
easy = 3,
|
||||
normal = 6,
|
||||
hard = 9
|
||||
}
|
||||
|
||||
MercenarySpawn = { HarkonnenRally4.Location + CVec.New(2, -2) }
|
||||
|
||||
-- Ordos tanks because those were intended for the Smugglers not the Atreides
|
||||
ContrabandReinforcements = { "mcv", "quad", "quad", "combat_tank_o", "combat_tank_o", "combat_tank_o" }
|
||||
SmugglerReinforcements = { "quad", "quad", "trike", "trike" }
|
||||
InitialHarkonnenReinforcements = { "trooper", "trooper", "quad", "quad", "trike", "trike", "trike", "light_inf" }
|
||||
|
||||
HarkonnenPaths =
|
||||
{
|
||||
{ HarkonnenEntry1.Location, HarkonnenRally1.Location },
|
||||
{ HarkonnenEntry1.Location, HarkonnenRally3.Location },
|
||||
{ HarkonnenEntry1.Location, HarkonnenRally2.Location },
|
||||
{ HarkonnenEntry1.Location, HarkonnenRally4.Location },
|
||||
{ HarkonnenEntry2.Location }
|
||||
}
|
||||
|
||||
AtreidesReinforcements = { "trike", "combat_tank_a" }
|
||||
AtreidesPath = { AtreidesEntry.Location, AtreidesRally.Location }
|
||||
|
||||
ContrabandTimes =
|
||||
{
|
||||
easy = DateTime.Minutes(10),
|
||||
normal = DateTime.Minutes(5),
|
||||
hard = DateTime.Minutes(2) + DateTime.Seconds(30)
|
||||
}
|
||||
|
||||
Wave = 0
|
||||
SendHarkonnen = function()
|
||||
Trigger.AfterDelay(HarkonnenAttackDelay[Difficulty], function()
|
||||
if Atreides.IsObjectiveCompleted(KillHarkonnen) then
|
||||
return
|
||||
end
|
||||
|
||||
Wave = Wave + 1
|
||||
|
||||
if InfantryReinforcements and Wave % 4 == 0 then
|
||||
local inf = Reinforcements.Reinforce(Harkonnen, HarkonnenInfantryReinforcements[Difficulty][Wave/4], InfantryPath)
|
||||
Utils.Do(inf, function(unit)
|
||||
unit.AttackMove(HarkonnenAttackLocation)
|
||||
IdleHunt(unit)
|
||||
end)
|
||||
end
|
||||
|
||||
local entryPath = Utils.Random(HarkonnenPaths)
|
||||
local units = Reinforcements.ReinforceWithTransport(Harkonnen, "carryall.reinforce", HarkonnenReinforcements[Difficulty][Wave], entryPath, { entryPath[1] })[2]
|
||||
Utils.Do(units, function(unit)
|
||||
unit.AttackMove(HarkonnenAttackLocation)
|
||||
IdleHunt(unit)
|
||||
end)
|
||||
|
||||
if Wave < HarkonnenAttackWaves[Difficulty] then
|
||||
SendHarkonnen()
|
||||
return
|
||||
end
|
||||
|
||||
Trigger.AfterDelay(DateTime.Seconds(3), function() LastHarkonnenArrived = true end)
|
||||
end)
|
||||
end
|
||||
|
||||
MercWave = 0
|
||||
SendMercenaries = function()
|
||||
Trigger.AfterDelay(MercenaryAttackDelay[Difficulty], function()
|
||||
MercWave = MercWave + 1
|
||||
|
||||
Media.DisplayMessage(UserInterface.GetFluentMessage("incoming-mercenary-force"), Mentat)
|
||||
|
||||
local units = Reinforcements.Reinforce(Mercenary, MercenaryReinforcements[Difficulty][MercWave], MercenarySpawn)
|
||||
Utils.Do(units, function(unit)
|
||||
unit.AttackMove(MercenaryAttackLocation1)
|
||||
unit.AttackMove(MercenaryAttackLocation2)
|
||||
IdleHunt(unit)
|
||||
end)
|
||||
|
||||
if MercWave < MercenaryAttackWaves[Difficulty] then
|
||||
SendMercenaries()
|
||||
return
|
||||
end
|
||||
|
||||
Trigger.AfterDelay(DateTime.Seconds(3), function() LastMercenariesArrived = true end)
|
||||
end)
|
||||
end
|
||||
|
||||
SendContraband = function(owner)
|
||||
ContrabandArrived = true
|
||||
UserInterface.SetMissionText(UserInterface.GetFluentMessage("contraband-has-arrived"), Atreides.Color)
|
||||
|
||||
local units = SmugglerReinforcements
|
||||
if owner == Atreides then
|
||||
units = ContrabandReinforcements
|
||||
end
|
||||
|
||||
Reinforcements.ReinforceWithTransport(owner, "frigate", units, { ContrabandEntry.Location, Starport.Location + CVec.New(1, 1) }, { ContrabandExit.Location })
|
||||
|
||||
Trigger.AfterDelay(DateTime.Seconds(3), function()
|
||||
if owner == Atreides then
|
||||
Atreides.MarkCompletedObjective(CaptureStarport)
|
||||
Media.DisplayMessage(UserInterface.GetFluentMessage("contraband-confiscated"), Mentat)
|
||||
else
|
||||
Atreides.MarkFailedObjective(CaptureStarport)
|
||||
Media.DisplayMessage(UserInterface.GetFluentMessage("contraband-not-confiscated"), Mentat)
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.AfterDelay(DateTime.Seconds(5), function()
|
||||
UserInterface.SetMissionText("")
|
||||
end)
|
||||
end
|
||||
|
||||
SmugglersAttack = function()
|
||||
Utils.Do(SmugglerBase, function(building)
|
||||
if not building.IsDead and building.Owner == Smuggler then
|
||||
building.Sell()
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.AfterDelay(DateTime.Seconds(1), function()
|
||||
Utils.Do(Smuggler.GetGroundAttackers(), function(unit)
|
||||
IdleHunt(unit)
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
AttackNotifier = 0
|
||||
Tick = function()
|
||||
if Atreides.HasNoRequiredUnits() then
|
||||
Harkonnen.MarkCompletedObjective(KillAtreides)
|
||||
end
|
||||
|
||||
if LastHarkonnenArrived and not Atreides.IsObjectiveCompleted(KillHarkonnen) and Harkonnen.HasNoRequiredUnits() then
|
||||
Media.DisplayMessage(UserInterface.GetFluentMessage("harkonnen-annihilated"), Mentat)
|
||||
Atreides.MarkCompletedObjective(KillHarkonnen)
|
||||
end
|
||||
|
||||
if LastMercenariesArrived and not Atreides.IsObjectiveCompleted(KillSmuggler) and Smuggler.HasNoRequiredUnits() and Mercenary.HasNoRequiredUnits() then
|
||||
Media.DisplayMessage(UserInterface.GetFluentMessage("smugglers-annihilated"), Mentat)
|
||||
Atreides.MarkCompletedObjective(KillSmuggler)
|
||||
end
|
||||
|
||||
if LastHarvesterEaten[Harkonnen] and DateTime.GameTime % DateTime.Seconds(10) == 0 then
|
||||
local units = Harkonnen.GetActorsByType("harvester")
|
||||
|
||||
if #units > 0 then
|
||||
LastHarvesterEaten[Harkonnen] = false
|
||||
ProtectHarvester(units[1], Harkonnen, AttackGroupSize[Difficulty])
|
||||
end
|
||||
end
|
||||
|
||||
AttackNotifier = AttackNotifier - 1
|
||||
|
||||
if TimerTicks and not ContrabandArrived then
|
||||
TimerTicks = TimerTicks - 1
|
||||
if (TimerTicks % DateTime.Seconds(1)) == 0 then
|
||||
local contrabandArrivesIn = UserInterface.GetFluentMessage("contraband-arrives-in", { ["time"] = Utils.FormatTime(TimerTicks)})
|
||||
UserInterface.SetMissionText(contrabandArrivesIn, Atreides.Color)
|
||||
end
|
||||
|
||||
if TimerTicks <= 0 then
|
||||
SendContraband(Smuggler)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
WorldLoaded = function()
|
||||
Harkonnen = Player.GetPlayer("Harkonnen")
|
||||
Smuggler = Player.GetPlayer("Smugglers")
|
||||
Mercenary = Player.GetPlayer("Mercenaries")
|
||||
Atreides = Player.GetPlayer("Atreides")
|
||||
|
||||
InfantryReinforcements = Difficulty ~= "easy"
|
||||
|
||||
InitObjectives(Atreides)
|
||||
KillAtreides = AddPrimaryObjective(Harkonnen, "")
|
||||
CaptureBarracks = AddPrimaryObjective(Atreides, "capture-barracks-sietch-tabr")
|
||||
KillHarkonnen = AddSecondaryObjective(Atreides, "annihilate-harkonnen-units-reinforcements")
|
||||
CaptureStarport = AddSecondaryObjective(Atreides, "capture-smuggler-starport-confiscate-contraband")
|
||||
|
||||
Camera.Position = ARefinery.CenterPosition
|
||||
HarkonnenAttackLocation = AtreidesRally.Location
|
||||
MercenaryAttackLocation1 = Starport.Location + CVec.New(-16, 0)
|
||||
MercenaryAttackLocation2 = Starport.Location
|
||||
|
||||
Trigger.AfterDelay(DateTime.Seconds(2), function()
|
||||
TimerTicks = ContrabandTimes[Difficulty]
|
||||
local time = Utils.FormatTime(TimerTicks)
|
||||
local contrabandApproaching = UserInterface.GetFluentMessage("contraband-approaching-starport-north-in", { ["time"] = time })
|
||||
Media.DisplayMessage(contrabandApproaching, Mentat)
|
||||
end)
|
||||
|
||||
Trigger.OnAllKilledOrCaptured(HarkonnenBase, function()
|
||||
Utils.Do(Harkonnen.GetGroundAttackers(), IdleHunt)
|
||||
end)
|
||||
|
||||
Trigger.OnKilled(Starport, function()
|
||||
if not Atreides.IsObjectiveCompleted(CaptureStarport) then
|
||||
ContrabandArrived = true
|
||||
UserInterface.SetMissionText(UserInterface.GetFluentMessage("starport-destroyed-no-contraband"), Atreides.Color)
|
||||
Atreides.MarkFailedObjective(CaptureStarport)
|
||||
SmugglersAttack()
|
||||
|
||||
Trigger.AfterDelay(DateTime.Seconds(15), function()
|
||||
UserInterface.SetMissionText("")
|
||||
end)
|
||||
end
|
||||
|
||||
if DefendStarport then
|
||||
Atreides.MarkFailedObjective(DefendStarport)
|
||||
end
|
||||
end)
|
||||
Trigger.OnDamaged(Starport, function(_, attacker)
|
||||
if Starport.Owner ~= Smuggler or attacker.IsDead or attacker.Owner ~= Atreides then
|
||||
return
|
||||
end
|
||||
|
||||
if AttackNotifier <= 0 then
|
||||
AttackNotifier = DateTime.Seconds(10)
|
||||
Media.DisplayMessage(UserInterface.GetFluentMessage("do-not-destroy-starport"), Mentat)
|
||||
|
||||
local defenders = Smuggler.GetGroundAttackers()
|
||||
if #defenders > 0 then
|
||||
Utils.Do(defenders, function(unit)
|
||||
unit.Guard(Starport)
|
||||
end)
|
||||
end
|
||||
end
|
||||
end)
|
||||
Trigger.OnCapture(Starport, function()
|
||||
DefendStarport = AddSecondaryObjective(Atreides, "defend-captured-starport")
|
||||
|
||||
Trigger.ClearAll(Starport)
|
||||
Trigger.AfterDelay(0, function()
|
||||
Trigger.OnRemovedFromWorld(Starport, function()
|
||||
Atreides.MarkFailedObjective(DefendStarport)
|
||||
end)
|
||||
end)
|
||||
|
||||
if not ContrabandArrived then
|
||||
SendContraband(Atreides)
|
||||
end
|
||||
SmugglersAttack()
|
||||
end)
|
||||
|
||||
Trigger.OnKilled(HarkonnenBarracks, function()
|
||||
Atreides.MarkFailedObjective(CaptureBarracks)
|
||||
end)
|
||||
Trigger.OnDamaged(HarkonnenBarracks, function()
|
||||
if AttackNotifier <= 0 and HarkonnenBarracks.Health < HarkonnenBarracks.MaxHealth * 3/4 then
|
||||
AttackNotifier = DateTime.Seconds(10)
|
||||
Media.DisplayMessage(UserInterface.GetFluentMessage("do-not-destroy-barracks"), Mentat)
|
||||
end
|
||||
end)
|
||||
Trigger.OnCapture(HarkonnenBarracks, function()
|
||||
Media.DisplayMessage(UserInterface.GetFluentMessage("hostages-released"), Mentat)
|
||||
|
||||
if DefendStarport then
|
||||
Atreides.MarkCompletedObjective(DefendStarport)
|
||||
end
|
||||
|
||||
Trigger.AfterDelay(DateTime.Seconds(3), function()
|
||||
Atreides.MarkCompletedObjective(CaptureBarracks)
|
||||
end)
|
||||
end)
|
||||
|
||||
SendHarkonnen()
|
||||
Actor.Create("upgrade.barracks", true, { Owner = Harkonnen })
|
||||
Actor.Create("upgrade.light", true, { Owner = Harkonnen })
|
||||
Actor.Create("upgrade.heavy", true, { Owner = Harkonnen })
|
||||
Trigger.AfterDelay(0, ActivateAI)
|
||||
|
||||
Trigger.AfterDelay(DateTime.Minutes(1), function()
|
||||
Media.PlaySpeechNotification(Atreides, "Reinforce")
|
||||
Reinforcements.ReinforceWithTransport(Atreides, "carryall.reinforce", AtreidesReinforcements, AtreidesPath, { AtreidesPath[1] })
|
||||
end)
|
||||
|
||||
local smugglerWaypoint = SmugglerWaypoint1.Location
|
||||
Trigger.OnEnteredFootprint({ smugglerWaypoint + CVec.New(-2, 0), smugglerWaypoint + CVec.New(-1, 0), smugglerWaypoint, smugglerWaypoint + CVec.New(1, -1), smugglerWaypoint + CVec.New(2, -1), SmugglerWaypoint3.Location }, function(a, id)
|
||||
if not Warned and a.Owner == Atreides and a.Type ~= "carryall" then
|
||||
Warned = true
|
||||
Trigger.RemoveFootprintTrigger(id)
|
||||
Media.DisplayMessage(UserInterface.GetFluentMessage("stay-away-from-starport"), UserInterface.GetFluentMessage("smuggler-leader"))
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint({ SmugglerWaypoint2.Location }, function(a, id)
|
||||
if not Paid and a.Owner == Atreides and a.Type ~= "carryall" then
|
||||
Paid = true
|
||||
Trigger.RemoveFootprintTrigger(id)
|
||||
Media.DisplayMessage(UserInterface.GetFluentMessage("were-warned-will-pay"), UserInterface.GetFluentMessage("smuggler-leader"))
|
||||
Utils.Do(Smuggler.GetGroundAttackers(), function(unit)
|
||||
unit.AttackMove(SmugglerWaypoint2.Location)
|
||||
end)
|
||||
|
||||
Trigger.AfterDelay(DateTime.Seconds(3), function()
|
||||
KillSmuggler = AddSecondaryObjective(Atreides, "destroy-smugglers-mercenaries")
|
||||
SendMercenaries()
|
||||
end)
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredProximityTrigger(HarkonnenBarracks.CenterPosition, WDist.New(5 * 1024), function(a, id)
|
||||
if a.Owner == Atreides and a.Type ~= "carryall" then
|
||||
Trigger.RemoveProximityTrigger(id)
|
||||
Media.DisplayMessage(UserInterface.GetFluentMessage("capture-harkonnen-barracks-release-hostages"), Mentat)
|
||||
StopInfantryProduction = true
|
||||
end
|
||||
end)
|
||||
end
|
||||
BIN
mods/d2k/maps/atreides-05/map.bin
Normal file
BIN
mods/d2k/maps/atreides-05/map.bin
Normal file
Binary file not shown.
11
mods/d2k/maps/atreides-05/map.ftl
Normal file
11
mods/d2k/maps/atreides-05/map.ftl
Normal file
@@ -0,0 +1,11 @@
|
||||
## rules.yaml
|
||||
briefing =
|
||||
According to our spies, the Fremen are being held at the far Northwest corner of Sietch Tabr. Push your way through the Harkonnen ranks to rescue the hostages.
|
||||
|
||||
Scout the terrain before you launch the main assault. Our Engineers must reach the Barracks and capture it intact. The rest of the base can be razed to the ground.
|
||||
|
||||
Additionally, rumors suggest an illegal Smuggling operation in the area. A large shipment of contraband is expected at the Smuggler's Starport. Capture the Starport before the contraband arrives, to seize it for the Atreides war effort.
|
||||
|
||||
Be warned, the Smugglers have Mercenary allies who may come to their aid.
|
||||
|
||||
Good luck.
|
||||
BIN
mods/d2k/maps/atreides-05/map.png
Normal file
BIN
mods/d2k/maps/atreides-05/map.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 147 KiB |
371
mods/d2k/maps/atreides-05/map.yaml
Normal file
371
mods/d2k/maps/atreides-05/map.yaml
Normal file
@@ -0,0 +1,371 @@
|
||||
MapFormat: 12
|
||||
|
||||
RequiresMod: d2k
|
||||
|
||||
Title: Atreides 05
|
||||
|
||||
Author: Westwood Studios
|
||||
|
||||
Tileset: ARRAKIS
|
||||
|
||||
MapSize: 68,68
|
||||
|
||||
Bounds: 2,2,64,64
|
||||
|
||||
Visibility: MissionSelector
|
||||
|
||||
Categories: Campaign
|
||||
|
||||
LockPreview: True
|
||||
|
||||
Players:
|
||||
PlayerReference@Neutral:
|
||||
Name: Neutral
|
||||
OwnsWorld: True
|
||||
NonCombatant: True
|
||||
Faction: Random
|
||||
PlayerReference@Creeps:
|
||||
Name: Creeps
|
||||
NonCombatant: True
|
||||
Faction: Random
|
||||
Enemies: Harkonnen, Atreides, Mercenaries, Smugglers
|
||||
PlayerReference@Atreides:
|
||||
Name: Atreides
|
||||
Playable: True
|
||||
LockFaction: True
|
||||
Faction: atreides
|
||||
LockColor: True
|
||||
Color: 5A7394
|
||||
Enemies: Harkonnen, Smugglers, Mercenaries, Creeps
|
||||
PlayerReference@Harkonnen:
|
||||
Name: Harkonnen
|
||||
LockFaction: True
|
||||
Faction: harkonnen
|
||||
LockColor: True
|
||||
Color: D64A42
|
||||
Enemies: Atreides, Creeps
|
||||
Bot: campaign
|
||||
PlayerReference@Smugglers:
|
||||
Name: Smugglers
|
||||
LockFaction: True
|
||||
Faction: smuggler
|
||||
LockColor: True
|
||||
Color: 7B2910
|
||||
Allies: Mercenaries
|
||||
Enemies: Atreides, Creeps
|
||||
Bot: campaign
|
||||
PlayerReference@Mercenaries:
|
||||
Name: Mercenaries
|
||||
LockFaction: True
|
||||
Faction: mercenary
|
||||
LockColor: True
|
||||
Color: 9C8408
|
||||
Allies: Smugglers
|
||||
Enemies: Atreides, Creeps
|
||||
Bot: campaign
|
||||
|
||||
Actors:
|
||||
Actor4: trike
|
||||
Location: 44,3
|
||||
Owner: Harkonnen
|
||||
Actor5: wormspawner
|
||||
Location: 58,5
|
||||
Owner: Creeps
|
||||
Actor6: wall
|
||||
Location: 4,7
|
||||
Owner: Harkonnen
|
||||
Actor7: wall
|
||||
Location: 2,8
|
||||
Owner: Harkonnen
|
||||
Actor8: wall
|
||||
Location: 3,8
|
||||
Owner: Harkonnen
|
||||
Actor10: spicebloom
|
||||
Location: 15,8
|
||||
Owner: Neutral
|
||||
Actor12: wall
|
||||
Location: 26,11
|
||||
Owner: Harkonnen
|
||||
Actor15: wall
|
||||
Location: 27,12
|
||||
Owner: Harkonnen
|
||||
Actor16: spicebloom
|
||||
Location: 38,12
|
||||
Owner: Neutral
|
||||
Actor20: spicebloom
|
||||
Location: 4,15
|
||||
Owner: Neutral
|
||||
Actor28: carryall
|
||||
Location: 26,18
|
||||
Owner: Harkonnen
|
||||
Actor29: spicebloom
|
||||
Location: 49,18
|
||||
Owner: Neutral
|
||||
Actor33: wall
|
||||
Location: 31,19
|
||||
Owner: Harkonnen
|
||||
Actor34: wall
|
||||
Location: 32,19
|
||||
Owner: Harkonnen
|
||||
Actor35: wall
|
||||
Location: 33,19
|
||||
Owner: Harkonnen
|
||||
Actor38: wall
|
||||
Location: 34,20
|
||||
Owner: Harkonnen
|
||||
Actor41: wall
|
||||
Location: 8,23
|
||||
Owner: Harkonnen
|
||||
Actor43: wall
|
||||
Location: 10,23
|
||||
Owner: Harkonnen
|
||||
Actor45: wall
|
||||
Location: 24,23
|
||||
Owner: Harkonnen
|
||||
Actor46: wall
|
||||
Location: 22,24
|
||||
Owner: Harkonnen
|
||||
Actor47: wall
|
||||
Location: 23,24
|
||||
Owner: Harkonnen
|
||||
Actor49: light_inf
|
||||
Location: 59,24
|
||||
Owner: Smugglers
|
||||
Actor50: wall
|
||||
Location: 20,25
|
||||
Owner: Harkonnen
|
||||
Actor51: wall
|
||||
Location: 21,25
|
||||
Owner: Harkonnen
|
||||
Actor52: wall
|
||||
Location: 22,25
|
||||
Owner: Harkonnen
|
||||
Actor53: light_inf
|
||||
Location: 60,25
|
||||
Owner: Smugglers
|
||||
Actor54: trooper
|
||||
Location: 62,25
|
||||
Owner: Smugglers
|
||||
Actor56: wall
|
||||
Location: 16,26
|
||||
Owner: Harkonnen
|
||||
Actor57: wall
|
||||
Location: 17,26
|
||||
Owner: Harkonnen
|
||||
Actor58: wall
|
||||
Location: 18,26
|
||||
Owner: Harkonnen
|
||||
Actor59: wall
|
||||
Location: 19,26
|
||||
Owner: Harkonnen
|
||||
Actor60: wall
|
||||
Location: 20,26
|
||||
Owner: Harkonnen
|
||||
Actor61: light_inf
|
||||
Location: 58,26
|
||||
Owner: Smugglers
|
||||
Actor62: light_inf
|
||||
Location: 60,27
|
||||
Owner: Smugglers
|
||||
Actor63: trooper
|
||||
Location: 47,30
|
||||
Owner: Harkonnen
|
||||
Actor64: trooper
|
||||
Location: 42,31
|
||||
Owner: Harkonnen
|
||||
Actor65: trooper
|
||||
Location: 37,32
|
||||
Owner: Harkonnen
|
||||
Actor66: trooper
|
||||
Location: 27,38
|
||||
Owner: Harkonnen
|
||||
Actor67: spicebloom
|
||||
Location: 21,41
|
||||
Owner: Neutral
|
||||
Actor68: trooper
|
||||
Location: 26,41
|
||||
Owner: Harkonnen
|
||||
Actor69: spicebloom
|
||||
Location: 46,42
|
||||
Owner: Neutral
|
||||
Actor70: quad
|
||||
Location: 58,43
|
||||
Owner: Harkonnen
|
||||
Actor71: spicebloom
|
||||
Location: 23,46
|
||||
Owner: Neutral
|
||||
Actor72: light_factory
|
||||
Location: 48,50
|
||||
Owner: Atreides
|
||||
Actor73: spicebloom
|
||||
Location: 39,51
|
||||
Owner: Neutral
|
||||
Actor74: barracks
|
||||
Location: 52,52
|
||||
Owner: Atreides
|
||||
Actor75: trike
|
||||
Location: 54,52
|
||||
Owner: Atreides
|
||||
Actor76: quad
|
||||
Location: 51,53
|
||||
Owner: Atreides
|
||||
Actor77: light_inf
|
||||
Location: 57,53
|
||||
Owner: Atreides
|
||||
Actor79: wind_trap
|
||||
Location: 59,54
|
||||
Owner: Atreides
|
||||
Actor80: wind_trap
|
||||
Location: 62,54
|
||||
Owner: Atreides
|
||||
Actor81: trooper
|
||||
Location: 51,55
|
||||
Owner: Atreides
|
||||
Actor84: light_inf
|
||||
Location: 57,57
|
||||
Owner: Atreides
|
||||
Actor85: light_inf
|
||||
Location: 52,58
|
||||
Owner: Atreides
|
||||
Actor86: spicebloom
|
||||
Location: 17,62
|
||||
Owner: Neutral
|
||||
HarkonnenConstructionYard: construction_yard
|
||||
Location: 9,11
|
||||
Owner: Harkonnen
|
||||
HarkonnenBarracks: barracks.harkonnen
|
||||
Location: 3,3
|
||||
Owner: Harkonnen
|
||||
HarkonnenWindTrap1: wind_trap
|
||||
Location: 5,3
|
||||
Owner: Harkonnen
|
||||
HarkonnenWindTrap2: wind_trap
|
||||
Location: 7,3
|
||||
Owner: Harkonnen
|
||||
HarkonnenWindTrap3: wind_trap
|
||||
Location: 23,12
|
||||
Owner: Harkonnen
|
||||
HarkonnenWindTrap4: wind_trap
|
||||
Location: 26,14
|
||||
Owner: Harkonnen
|
||||
HarkonnenWindTrap5: wind_trap
|
||||
Location: 13,17
|
||||
Owner: Harkonnen
|
||||
HarkonnenWindTrap6: wind_trap
|
||||
Location: 10,19
|
||||
Owner: Harkonnen
|
||||
HarkonnenWindTrap7: wind_trap
|
||||
Location: 20,19
|
||||
Owner: Harkonnen
|
||||
HarkonnenWindTrap8: wind_trap
|
||||
Location: 18,23
|
||||
Owner: Harkonnen
|
||||
HarkonnenSilo1: silo
|
||||
Location: 9,3
|
||||
Owner: Harkonnen
|
||||
HarkonnenSilo2: silo
|
||||
Location: 18,15
|
||||
Owner: Harkonnen
|
||||
HarkonnenSilo3: silo
|
||||
Location: 21,18
|
||||
Owner: Harkonnen
|
||||
HarkonnenSilo4: silo
|
||||
Location: 26,13
|
||||
Owner: Harkonnen
|
||||
HarkonnenGunTurret1: medium_gun_turret
|
||||
Location: 4,8
|
||||
Owner: Harkonnen
|
||||
HarkonnenGunTurret2: medium_gun_turret
|
||||
Location: 27,11
|
||||
Owner: Harkonnen
|
||||
HarkonnenGunTurret3: medium_gun_turret
|
||||
Location: 33,20
|
||||
Owner: Harkonnen
|
||||
HarkonnenGunTurret4: medium_gun_turret
|
||||
Location: 35,20
|
||||
Owner: Harkonnen
|
||||
HarkonnenGunTurret5: medium_gun_turret
|
||||
Location: 9,23
|
||||
Owner: Harkonnen
|
||||
HarkonnenGunTurret6: medium_gun_turret
|
||||
Location: 24,24
|
||||
Owner: Harkonnen
|
||||
HarkonnenGunTurret7: medium_gun_turret
|
||||
Location: 15,26
|
||||
Owner: Harkonnen
|
||||
HarkonnenHeavyFactory: heavy_factory
|
||||
Location: 19,14
|
||||
Owner: Harkonnen
|
||||
HarkonnenRefinery: refinery
|
||||
Location: 23,15
|
||||
Owner: Harkonnen
|
||||
HarkonnenOutpost: outpost
|
||||
Location: 16,17
|
||||
Owner: Harkonnen
|
||||
HarkonnenLightFactory: light_factory
|
||||
Location: 17,20
|
||||
Owner: Harkonnen
|
||||
Starport: starport
|
||||
Location: 61,21
|
||||
Owner: Smugglers
|
||||
SmugglerWindTrap1: wind_trap
|
||||
Location: 61,17
|
||||
Owner: Smugglers
|
||||
SmugglerWindTrap2: wind_trap
|
||||
Location: 63,17
|
||||
Owner: Smugglers
|
||||
ARefinery: refinery
|
||||
Location: 54,57
|
||||
Owner: Atreides
|
||||
Engineer1: engineer
|
||||
Location: 56,54
|
||||
Owner: Atreides
|
||||
Engineer2: engineer
|
||||
Location: 52,56
|
||||
Owner: Atreides
|
||||
ContrabandEntry: waypoint
|
||||
Owner: Neutral
|
||||
Location: 65,22
|
||||
ContrabandExit: waypoint
|
||||
Owner: Neutral
|
||||
Location: 2,22
|
||||
SmugglerWaypoint1: waypoint
|
||||
Owner: Neutral
|
||||
Location: 51,28
|
||||
SmugglerWaypoint2: waypoint
|
||||
Owner: Neutral
|
||||
Location: 57,29
|
||||
SmugglerWaypoint3: waypoint
|
||||
Owner: Neutral
|
||||
Location: 64,36
|
||||
AtreidesEntry: waypoint
|
||||
Owner: Neutral
|
||||
Location: 65,58
|
||||
AtreidesRally: waypoint
|
||||
Owner: Neutral
|
||||
Location: 54,56
|
||||
HarkonnenEntry1: waypoint
|
||||
Owner: Neutral
|
||||
Location: 25,2
|
||||
HarkonnenEntry2: waypoint
|
||||
Owner: Neutral
|
||||
Location: 38,65
|
||||
HarkonnenEntry3: waypoint
|
||||
Owner: Neutral
|
||||
Location: 65,32
|
||||
HarkonnenRally1: waypoint
|
||||
Owner: Neutral
|
||||
Location: 12,9
|
||||
HarkonnenRally2: waypoint
|
||||
Owner: Neutral
|
||||
Location: 39,41
|
||||
HarkonnenRally3: waypoint
|
||||
Owner: Neutral
|
||||
Location: 36,46
|
||||
HarkonnenRally4: waypoint
|
||||
Owner: Neutral
|
||||
Location: 49,4
|
||||
|
||||
Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml
|
||||
|
||||
FluentMessages: d2k|fluent/lua.ftl, d2k|fluent/campaign.ftl, map.ftl
|
||||
67
mods/d2k/maps/atreides-05/rules.yaml
Normal file
67
mods/d2k/maps/atreides-05/rules.yaml
Normal file
@@ -0,0 +1,67 @@
|
||||
Player:
|
||||
PlayerResources:
|
||||
DefaultCash: 7000
|
||||
|
||||
World:
|
||||
LuaScript:
|
||||
Scripts: campaign.lua, utils.lua, atreides05.lua, atreides05-AI.lua
|
||||
MissionData:
|
||||
Briefing: briefing
|
||||
BriefingVideo: A_BR05_E.VQA
|
||||
MapOptions:
|
||||
TechLevel: medium
|
||||
ScriptLobbyDropdown@difficulty:
|
||||
ID: difficulty
|
||||
Label: dropdown-difficulty.label
|
||||
Description: dropdown-difficulty.description
|
||||
Values:
|
||||
easy: options-difficulty.easy
|
||||
normal: options-difficulty.normal
|
||||
hard: options-difficulty.hard
|
||||
Default: easy
|
||||
|
||||
carryall.reinforce:
|
||||
Cargo:
|
||||
MaxWeight: 10
|
||||
|
||||
frigate:
|
||||
Aircraft:
|
||||
LandableTerrainTypes: Sand, Rock, Transition, Spice, SpiceSand, Dune, Concrete
|
||||
|
||||
barracks.harkonnen:
|
||||
Inherits: barracks
|
||||
Buildable:
|
||||
Prerequisites: ~disabled
|
||||
-MustBeDestroyed:
|
||||
|
||||
concreteb:
|
||||
Buildable:
|
||||
Prerequisites: ~disabled
|
||||
|
||||
upgrade.conyard:
|
||||
Buildable:
|
||||
Prerequisites: ~disabled
|
||||
|
||||
grenadier:
|
||||
Buildable:
|
||||
Prerequisites: ~disabled
|
||||
|
||||
mpsardaukar:
|
||||
Buildable:
|
||||
Prerequisites: ~disabled
|
||||
|
||||
large_gun_turret:
|
||||
Buildable:
|
||||
Prerequisites: ~disabled
|
||||
|
||||
research_centre:
|
||||
Buildable:
|
||||
Prerequisites: outpost, heavy_factory, upgrade.heavy
|
||||
|
||||
siege_tank:
|
||||
Buildable:
|
||||
Prerequisites: ~disabled
|
||||
|
||||
missile_tank:
|
||||
Buildable:
|
||||
Prerequisites: upgrade.heavy, research_centre
|
||||
Reference in New Issue
Block a user