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:
52
mods/d2k/maps/atreides-03a/atreides03a-AI.lua
Normal file
52
mods/d2k/maps/atreides-03a/atreides03a-AI.lua
Normal file
@@ -0,0 +1,52 @@
|
||||
--[[
|
||||
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(9) },
|
||||
normal = { DateTime.Seconds(2), DateTime.Seconds(7) },
|
||||
hard = { DateTime.Seconds(1), DateTime.Seconds(5) }
|
||||
}
|
||||
|
||||
OrdosInfantryTypes = { "light_inf", "light_inf", "light_inf", "trooper", "trooper" }
|
||||
OrdosVehicleTypes = { "raider", "raider", "quad" }
|
||||
|
||||
InitAIUnits = function()
|
||||
IdlingUnits[Ordos] = Reinforcements.Reinforce(Ordos, InitialOrdosReinforcements, OrdosPaths[2])
|
||||
IdlingUnits[Ordos][#IdlingUnits + 1] = OTrooper1
|
||||
IdlingUnits[Ordos][#IdlingUnits + 1] = OTrooper2
|
||||
IdlingUnits[Ordos][#IdlingUnits + 1] = ORaider
|
||||
|
||||
DefendAndRepairBase(Ordos, OrdosBase, 0.75, AttackGroupSize[Difficulty])
|
||||
end
|
||||
|
||||
ActivateAI = function()
|
||||
LastHarvesterEaten[Ordos] = true
|
||||
Trigger.AfterDelay(0, InitAIUnits)
|
||||
|
||||
OConyard.Produce(AtreidesUpgrades[1])
|
||||
OConyard.Produce(AtreidesUpgrades[2])
|
||||
|
||||
local delay = function() return Utils.RandomInteger(AttackDelays[Difficulty][1], AttackDelays[Difficulty][2] + 1) end
|
||||
local infantryToBuild = function() return { Utils.Random(OrdosInfantryTypes) } end
|
||||
local vehiclesToBuild = function() return { Utils.Random(OrdosVehicleTypes) } 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, infantryToBuild, AttackGroupSize[Difficulty], attackThresholdSize)
|
||||
ProduceUnits(Ordos, OLightFactory, delay, vehiclesToBuild, AttackGroupSize[Difficulty], attackThresholdSize)
|
||||
end)
|
||||
end
|
||||
179
mods/d2k/maps/atreides-03a/atreides03a.lua
Normal file
179
mods/d2k/maps/atreides-03a/atreides03a.lua
Normal file
@@ -0,0 +1,179 @@
|
||||
--[[
|
||||
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.
|
||||
]]
|
||||
|
||||
OrdosBase = { OBarracks, OWindTrap1, OWindTrap2, OWindTrap3, OWindTrap4, OLightFactory, OOutpost, OConyard, ORefinery, OSilo1, OSilo2, OSilo3, OSilo4 }
|
||||
|
||||
OrdosReinforcements =
|
||||
{
|
||||
easy =
|
||||
{
|
||||
{ "light_inf", "raider", "trooper" },
|
||||
{ "light_inf", "raider", "quad" },
|
||||
{ "light_inf", "light_inf", "trooper", "raider", "raider", "quad" }
|
||||
},
|
||||
|
||||
normal =
|
||||
{
|
||||
{ "light_inf", "raider", "trooper" },
|
||||
{ "light_inf", "raider", "raider" },
|
||||
{ "light_inf", "light_inf", "trooper", "raider", "raider", "quad" },
|
||||
{ "light_inf", "light_inf", "trooper", "trooper" },
|
||||
{ "light_inf", "light_inf", "light_inf", "light_inf" },
|
||||
{ "light_inf", "raider", "quad", "quad" }
|
||||
},
|
||||
|
||||
hard =
|
||||
{
|
||||
{ "raider", "raider", "quad" },
|
||||
{ "light_inf", "raider", "raider" },
|
||||
{ "trooper", "trooper", "light_inf", "raider" },
|
||||
{ "light_inf", "light_inf", "light_inf", "raider", "raider" },
|
||||
{ "light_inf", "light_inf", "trooper", "trooper" },
|
||||
{ "raider", "raider", "quad", "quad", "quad", "raider" },
|
||||
{ "light_inf", "light_inf", "light_inf", "raider", "raider" },
|
||||
{ "light_inf", "raider", "light_inf", "trooper", "trooper", "quad" },
|
||||
{ "raider", "raider", "quad", "quad", "quad", "raider" }
|
||||
}
|
||||
}
|
||||
|
||||
OrdosAttackDelay =
|
||||
{
|
||||
easy = DateTime.Minutes(5),
|
||||
normal = DateTime.Minutes(2) + DateTime.Seconds(40),
|
||||
hard = DateTime.Minutes(1) + DateTime.Seconds(20)
|
||||
}
|
||||
|
||||
OrdosAttackWaves =
|
||||
{
|
||||
easy = 3,
|
||||
normal = 6,
|
||||
hard = 9
|
||||
}
|
||||
|
||||
ToHarvest =
|
||||
{
|
||||
easy = 5000,
|
||||
normal = 6000,
|
||||
hard = 7000
|
||||
}
|
||||
|
||||
InitialOrdosReinforcements = { "light_inf", "light_inf", "quad", "quad", "raider", "raider", "trooper", "trooper" }
|
||||
|
||||
OrdosPaths =
|
||||
{
|
||||
{ OrdosEntry1.Location, OrdosRally1.Location },
|
||||
{ OrdosEntry2.Location, OrdosRally2.Location }
|
||||
}
|
||||
|
||||
AtreidesReinforcements = { "quad", "quad", "trike", "trike" }
|
||||
AtreidesPath = { AtreidesEntry.Location, AtreidesRally.Location }
|
||||
|
||||
AtreidesBaseBuildings = { "barracks", "light_factory" }
|
||||
AtreidesUpgrades = { "upgrade.barracks", "upgrade.light" }
|
||||
|
||||
MessageCheck = function(index)
|
||||
return #Atreides.GetActorsByType(AtreidesBaseBuildings[index]) > 0 and not Atreides.HasPrerequisites({ AtreidesUpgrades[index] })
|
||||
end
|
||||
|
||||
CachedResources = -1
|
||||
Tick = function()
|
||||
if Atreides.HasNoRequiredUnits() then
|
||||
Ordos.MarkCompletedObjective(KillAtreides)
|
||||
end
|
||||
|
||||
if Ordos.HasNoRequiredUnits() and not Atreides.IsObjectiveCompleted(KillOrdos) then
|
||||
Media.DisplayMessage(UserInterface.GetFluentMessage("ordos-annihilated"), Mentat)
|
||||
Atreides.MarkCompletedObjective(KillOrdos)
|
||||
end
|
||||
|
||||
if DateTime.GameTime % DateTime.Seconds(10) == 0 and LastHarvesterEaten[Ordos] then
|
||||
local units = Ordos.GetActorsByType("harvester")
|
||||
|
||||
if #units > 0 then
|
||||
LastHarvesterEaten[Ordos] = false
|
||||
ProtectHarvester(units[1], Ordos, AttackGroupSize[Difficulty])
|
||||
end
|
||||
end
|
||||
|
||||
if Atreides.Resources > SpiceToHarvest - 1 then
|
||||
Atreides.MarkCompletedObjective(GatherSpice)
|
||||
end
|
||||
|
||||
if DateTime.GameTime % DateTime.Seconds(32) == 0 and (MessageCheck(1) or MessageCheck(2)) then
|
||||
Media.DisplayMessage(UserInterface.GetFluentMessage("upgrade-barracks-light-factory"), Mentat)
|
||||
end
|
||||
|
||||
if Atreides.Resources ~= CachedResources then
|
||||
local harvestedResources = UserInterface.GetFluentMessage("harvested-resources",
|
||||
{ ["harvested"] = Atreides.Resources, ["goal"] = SpiceToHarvest })
|
||||
UserInterface.SetMissionText(harvestedResources)
|
||||
CachedResources = Atreides.Resources
|
||||
end
|
||||
end
|
||||
|
||||
WorldLoaded = function()
|
||||
Ordos = Player.GetPlayer("Ordos")
|
||||
Atreides = Player.GetPlayer("Atreides")
|
||||
|
||||
SpiceToHarvest = ToHarvest[Difficulty]
|
||||
|
||||
InitObjectives(Atreides)
|
||||
KillAtreides = AddPrimaryObjective(Ordos, "")
|
||||
local harvestSpice = UserInterface.GetFluentMessage("harvest-spice", { ["spice"] = SpiceToHarvest })
|
||||
GatherSpice = AddPrimaryObjective(Atreides, harvestSpice)
|
||||
KillOrdos = AddSecondaryObjective(Atreides, "eliminate-ordos-units-reinforcements")
|
||||
|
||||
Camera.Position = AConyard.CenterPosition
|
||||
|
||||
local checkResourceCapacity = function()
|
||||
Trigger.AfterDelay(0, function()
|
||||
if Atreides.ResourceCapacity < SpiceToHarvest then
|
||||
Media.DisplayMessage(UserInterface.GetFluentMessage("not-enough-silos"), Mentat)
|
||||
Trigger.AfterDelay(DateTime.Seconds(3), function()
|
||||
Ordos.MarkCompletedObjective(KillAtreides)
|
||||
end)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
Trigger.OnRemovedFromWorld(AConyard, function()
|
||||
|
||||
-- Mission already failed, no need to check the other conditions as well
|
||||
if checkResourceCapacity() then
|
||||
return
|
||||
end
|
||||
|
||||
local refs = Utils.Where(Map.ActorsInWorld, function(actor) return actor.Type == "refinery" and actor.Owner == Atreides end)
|
||||
if #refs == 0 then
|
||||
Ordos.MarkCompletedObjective(KillAtreides)
|
||||
else
|
||||
Trigger.OnAllRemovedFromWorld(refs, function()
|
||||
Ordos.MarkCompletedObjective(KillAtreides)
|
||||
end)
|
||||
|
||||
local silos = Utils.Where(Map.ActorsInWorld, function(actor) return actor.Type == "silo" and actor.Owner == Atreides end)
|
||||
Utils.Do(refs, function(actor) Trigger.OnRemovedFromWorld(actor, checkResourceCapacity) end)
|
||||
Utils.Do(silos, function(actor) Trigger.OnRemovedFromWorld(actor, checkResourceCapacity) end)
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.OnAllKilled(OrdosBase, function()
|
||||
Utils.Do(Ordos.GetGroundAttackers(), IdleHunt)
|
||||
end)
|
||||
|
||||
local path = function() return OrdosPaths[1] end
|
||||
local waveCondition = function() return Atreides.IsObjectiveCompleted(KillOrdos) end
|
||||
SendCarryallReinforcements(Ordos, 0, OrdosAttackWaves[Difficulty], OrdosAttackDelay[Difficulty], path, OrdosReinforcements[Difficulty], waveCondition)
|
||||
ActivateAI()
|
||||
|
||||
Trigger.AfterDelay(DateTime.Minutes(2) + DateTime.Seconds(30), function()
|
||||
Media.PlaySpeechNotification(Atreides, "Reinforce")
|
||||
Reinforcements.ReinforceWithTransport(Atreides, "carryall.reinforce", AtreidesReinforcements, AtreidesPath, { AtreidesPath[1] })
|
||||
end)
|
||||
end
|
||||
BIN
mods/d2k/maps/atreides-03a/map.bin
Normal file
BIN
mods/d2k/maps/atreides-03a/map.bin
Normal file
Binary file not shown.
9
mods/d2k/maps/atreides-03a/map.ftl
Normal file
9
mods/d2k/maps/atreides-03a/map.ftl
Normal file
@@ -0,0 +1,9 @@
|
||||
## rules.yaml
|
||||
briefing =
|
||||
Bring the Atreides forces up to combat strength - quickly. Guard against surprise attacks and ensure Spice production.
|
||||
|
||||
The Ordos forces are lightly armored but numerous. To combat them, you are authorized to produce Quads, which have a greater anti-vehicle capability than Trikes. Upgrade your Light Factories to allow production of these units.
|
||||
|
||||
Meet any aggression with overwhelming force.
|
||||
|
||||
Good luck.
|
||||
BIN
mods/d2k/maps/atreides-03a/map.png
Normal file
BIN
mods/d2k/maps/atreides-03a/map.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 147 KiB |
141
mods/d2k/maps/atreides-03a/map.yaml
Normal file
141
mods/d2k/maps/atreides-03a/map.yaml
Normal file
@@ -0,0 +1,141 @@
|
||||
MapFormat: 12
|
||||
|
||||
RequiresMod: d2k
|
||||
|
||||
Title: Atreides 03a
|
||||
|
||||
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
|
||||
PlayerReference@Creeps:
|
||||
Name: Creeps
|
||||
NonCombatant: True
|
||||
Enemies: Atreides, Ordos
|
||||
PlayerReference@Atreides:
|
||||
Name: Atreides
|
||||
Playable: True
|
||||
LockFaction: True
|
||||
Faction: atreides
|
||||
LockColor: True
|
||||
Color: 5A7394
|
||||
Enemies: Ordos, Creeps
|
||||
PlayerReference@Ordos:
|
||||
Name: Ordos
|
||||
LockFaction: True
|
||||
Faction: ordos
|
||||
LockColor: True
|
||||
Color: 5A9473
|
||||
Enemies: Atreides, Creeps
|
||||
Bot: campaign
|
||||
|
||||
Actors:
|
||||
Actor0: light_inf
|
||||
Location: 14,10
|
||||
Owner: Atreides
|
||||
Actor1: trike
|
||||
Location: 10,12
|
||||
Owner: Atreides
|
||||
Actor2: quad
|
||||
Location: 18,12
|
||||
Owner: Atreides
|
||||
Actor5: trike
|
||||
Location: 18,16
|
||||
Owner: Atreides
|
||||
Actor8: quad
|
||||
Location: 11,17
|
||||
Owner: Atreides
|
||||
Actor10: light_inf
|
||||
Location: 15,18
|
||||
Owner: Atreides
|
||||
Actor23: wormspawner
|
||||
Location: 24,49
|
||||
Owner: Creeps
|
||||
AConyard: construction_yard
|
||||
Location: 13,13
|
||||
Owner: Atreides
|
||||
OTrooper1: trooper
|
||||
Location: 41,27
|
||||
Owner: Ordos
|
||||
OTrooper2: trooper
|
||||
Location: 36,28
|
||||
Owner: Ordos
|
||||
ORaider: raider
|
||||
Location: 39,28
|
||||
Owner: Ordos
|
||||
OBarracks: barracks
|
||||
Location: 56,15
|
||||
Owner: Ordos
|
||||
OWindTrap1: wind_trap
|
||||
Location: 62,16
|
||||
Owner: Ordos
|
||||
OWindTrap2: wind_trap
|
||||
Location: 64,16
|
||||
Owner: Ordos
|
||||
OWindTrap3: wind_trap
|
||||
Location: 64,19
|
||||
Owner: Ordos
|
||||
OWindTrap4: wind_trap
|
||||
Location: 60,17
|
||||
Owner: Ordos
|
||||
OLightFactory: light_factory
|
||||
Location: 51,18
|
||||
Owner: Ordos
|
||||
OOutpost: outpost
|
||||
Location: 54,20
|
||||
Owner: Ordos
|
||||
OConyard: construction_yard
|
||||
Location: 60,21
|
||||
Owner: Ordos
|
||||
ORefinery: refinery
|
||||
Location: 57,23
|
||||
Owner: Ordos
|
||||
OSilo1: silo
|
||||
Location: 62,25
|
||||
Owner: Ordos
|
||||
OSilo2: silo
|
||||
Location: 63,25
|
||||
Owner: Ordos
|
||||
OSilo3: silo
|
||||
Location: 62,26
|
||||
Owner: Ordos
|
||||
OSilo4: silo
|
||||
Location: 63,26
|
||||
Owner: Ordos
|
||||
AtreidesEntry: waypoint
|
||||
Owner: Neutral
|
||||
Location: 12,2
|
||||
AtreidesRally: waypoint
|
||||
Owner: Neutral
|
||||
Location: 15,9
|
||||
OrdosEntry1: waypoint
|
||||
Owner: Neutral
|
||||
Location: 2,6
|
||||
OrdosEntry2: waypoint
|
||||
Owner: Neutral
|
||||
Location: 65,30
|
||||
OrdosRally1: waypoint
|
||||
Owner: Neutral
|
||||
Location: 6,6
|
||||
OrdosRally2: waypoint
|
||||
Owner: Neutral
|
||||
Location: 39,30
|
||||
|
||||
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
|
||||
57
mods/d2k/maps/atreides-03a/rules.yaml
Normal file
57
mods/d2k/maps/atreides-03a/rules.yaml
Normal file
@@ -0,0 +1,57 @@
|
||||
Player:
|
||||
PlayerResources:
|
||||
DefaultCash: 3000
|
||||
|
||||
World:
|
||||
LuaScript:
|
||||
Scripts: campaign.lua, utils.lua, atreides03a.lua, atreides03a-AI.lua
|
||||
MissionData:
|
||||
Briefing: briefing
|
||||
BriefingVideo: A_BR03_E.VQA
|
||||
MapOptions:
|
||||
TechLevel: low
|
||||
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
|
||||
|
||||
concreteb:
|
||||
Buildable:
|
||||
Prerequisites: ~disabled
|
||||
|
||||
heavy_factory:
|
||||
Buildable:
|
||||
Prerequisites: ~disabled
|
||||
|
||||
medium_gun_turret:
|
||||
Buildable:
|
||||
Prerequisites: ~disabled
|
||||
|
||||
outpost:
|
||||
Buildable:
|
||||
Prerequisites: barracks
|
||||
|
||||
quad:
|
||||
Buildable:
|
||||
Prerequisites: upgrade.light
|
||||
|
||||
trooper:
|
||||
Buildable:
|
||||
Prerequisites: upgrade.barracks
|
||||
|
||||
upgrade.conyard:
|
||||
Buildable:
|
||||
Prerequisites: ~disabled
|
||||
|
||||
upgrade.heavy:
|
||||
Buildable:
|
||||
Prerequisites: ~disabled
|
||||
Reference in New Issue
Block a user