Initial commit: OpenRA game engine
Some checks failed
Continuous Integration / Linux (.NET 8.0) (push) Has been cancelled
Continuous Integration / Windows (.NET 8.0) (push) Has been cancelled

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:
let5sne.win10
2026-01-10 21:46:54 +08:00
commit 9cf6ebb986
4065 changed files with 635973 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
--[[
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) }
}
OrdosInfantryTypes = { "light_inf", "light_inf", "light_inf", "trooper", "trooper" }
InitAIUnits = function()
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(AttackDelays[Difficulty][1], AttackDelays[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)
end

View 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, OOutpost, OConyard, ORefinery, OSilo }
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

Binary file not shown.

View 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.

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

View File

@@ -0,0 +1,138 @@
MapFormat: 12
RequiresMod: d2k
Title: Atreides 03b
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:
Actor3: wormspawner
Location: 27,14
Owner: Creeps
Actor8: light_inf
Location: 48,24
Owner: Ordos
Actor9: light_inf
Location: 19,34
Owner: Ordos
Actor10: light_inf
Location: 35,34
Owner: Ordos
Actor11: trooper
Location: 18,35
Owner: Ordos
Actor12: light_inf
Location: 18,37
Owner: Ordos
Actor13: trooper
Location: 19,39
Owner: Ordos
Actor14: light_inf
Location: 34,50
Owner: Ordos
Actor20: light_inf
Location: 34,54
Owner: Ordos
Actor15: light_inf
Location: 50,50
Owner: Atreides
Actor16: quad
Location: 47,51
Owner: Atreides
Actor18: trike
Location: 46,53
Owner: Atreides
Actor19: quad
Location: 53,53
Owner: Atreides
Actor21: trooper
Location: 50,55
Owner: Atreides
Actor22: trike
Location: 52,55
Owner: Atreides
OWindTrap1: wind_trap
Location: 12,9
Owner: Ordos
OWindTrap2: wind_trap
Location: 18,9
Owner: Ordos
OConyard: construction_yard
Location: 15,12
Owner: Ordos
OBarracks: barracks
Location: 13,15
Owner: Ordos
ORefinery: refinery
Location: 14,18
Owner: Ordos
OSilo: silo
Location: 18,20
Owner: Ordos
OOutpost: outpost
Location: 18,23
Owner: Ordos
AConyard: construction_yard
Location: 49,52
Owner: Atreides
AtreidesEntry: waypoint
Owner: Neutral
Location: 65,53
AtreidesRally: waypoint
Owner: Neutral
Location: 45,55
OrdosEntry1: waypoint
Owner: Neutral
Location: 41,65
OrdosRally1: waypoint
Owner: Neutral
Location: 46,62
OrdosEntry2: waypoint
Owner: Neutral
Location: 6,2
OrdosRally2: waypoint
Owner: Neutral
Location: 15,34
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

View File

@@ -0,0 +1,57 @@
Player:
PlayerResources:
DefaultCash: 3000
World:
LuaScript:
Scripts: campaign.lua, utils.lua, atreides03b.lua, atreides03b-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