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,50 @@
--[[
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) }
}
AtreidesInfantryTypes = { "light_inf", "light_inf", "light_inf", "trooper", "trooper" }
AtreidesVehicleTypes = { "trike", "trike", "quad" }
InitAIUnits = function()
IdlingUnits[Atreides] = Reinforcements.Reinforce(Atreides, AtreidesInitialReinforcements, AtreidesInitialPath)
DefendAndRepairBase(Atreides, AtreidesBase, 0.75, AttackGroupSize[Difficulty])
end
ActivateAI = function()
LastHarvesterEaten[Atreides] = true
Trigger.AfterDelay(0, InitAIUnits)
AConyard.Produce(HarkonnenUpgrades[1])
AConyard.Produce(HarkonnenUpgrades[2])
local delay = function() return Utils.RandomInteger(AttackDelays[Difficulty][1], AttackDelays[Difficulty][2] + 1) end
local infantryToBuild = function() return { Utils.Random(AtreidesInfantryTypes) } end
local vehilcesToBuild = function() return { Utils.Random(AtreidesVehicleTypes) } end
local attackThresholdSize = AttackGroupSize[Difficulty] * 2.5
-- Finish the upgrades first before trying to build something
Trigger.AfterDelay(DateTime.Seconds(14), function()
ProduceUnits(Atreides, ABarracks, delay, infantryToBuild, AttackGroupSize[Difficulty], attackThresholdSize)
ProduceUnits(Atreides, ALightFactory, delay, vehilcesToBuild, AttackGroupSize[Difficulty], attackThresholdSize)
end)
end

View File

@@ -0,0 +1,153 @@
--[[
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.
]]
AtreidesBase = { ABarracks, AWindTrap1, AWindTrap2, AWindTrap3, ALightFactory, AOutpost, AConyard, ARefinery, ASilo1, ASilo2, ASilo3, ASilo4 }
AtreidesBaseAreaTriggers =
{
{ CPos.New(10, 53), CPos.New(11, 53), CPos.New(12, 53), CPos.New(13, 53), CPos.New(14, 53), CPos.New(15, 53), CPos.New(16, 53), CPos.New(17, 53), CPos.New(17, 52), CPos.New(17, 51), CPos.New(17, 50), CPos.New(17, 49), CPos.New(17, 48), CPos.New(17, 47), CPos.New(17, 46), CPos.New(17, 45), CPos.New(17, 44), CPos.New(17, 43), CPos.New(17, 42), CPos.New(17, 41), CPos.New(17, 40), CPos.New(17, 39), CPos.New(17, 38), CPos.New(2, 35), CPos.New(3, 35), CPos.New(4, 35), CPos.New(5, 35), CPos.New(6, 35), CPos.New(7, 35), CPos.New(8, 35), CPos.New(9, 35), CPos.New(10, 35), CPos.New(11, 35), CPos.New(12, 35) },
{ CPos.New(49, 25), CPos.New(50, 25), CPos.New(51, 25), CPos.New(52, 25), CPos.New(53, 25), CPos.New(54, 25), CPos.New(54, 26), CPos.New(54, 27), CPos.New(54, 28), CPos.New(54, 29) },
{ CPos.New(19, 2), CPos.New(19, 3), CPos.New(19, 4), CPos.New(41, 2), CPos.New(41, 3), CPos.New(41, 4), CPos.New(41, 5), CPos.New(41, 6), CPos.New(41, 7), CPos.New(41, 8), CPos.New(41, 9), CPos.New(41, 10), CPos.New(41, 11) },
{ CPos.New(2, 16), CPos.New(3, 16), CPos.New(4, 16), CPos.New(5, 16), CPos.New(19, 2), CPos.New(19, 3), CPos.New(19, 4) }
}
AtreidesReinforcements =
{
easy =
{
{ "light_inf", "trike", "trooper" },
{ "light_inf", "trike", "quad" },
{ "light_inf", "light_inf", "trooper", "trike", "trike", "quad" }
},
normal =
{
{ "light_inf", "trike", "trooper" },
{ "light_inf", "trike", "trike" },
{ "light_inf", "light_inf", "trooper", "trike", "trike", "quad" },
{ "light_inf", "light_inf", "trooper", "trooper" },
{ "light_inf", "light_inf", "light_inf", "light_inf" },
{ "light_inf", "trike", "quad", "quad" }
},
hard =
{
{ "trike", "trike", "quad" },
{ "light_inf", "trike", "trike" },
{ "trooper", "trooper", "light_inf", "trike" },
{ "light_inf", "light_inf", "light_inf", "trike", "trike" },
{ "light_inf", "light_inf", "trooper", "trooper" },
{ "trike", "trike", "quad", "quad", "quad", "trike" },
{ "light_inf", "light_inf", "light_inf", "trike", "trike" },
{ "light_inf", "trike", "light_inf", "trooper", "trooper", "quad" },
{ "trike", "trike", "quad", "quad", "quad", "trike" }
}
}
AtreidesAttackDelay =
{
easy = DateTime.Minutes(5),
normal = DateTime.Minutes(2) + DateTime.Seconds(40),
hard = DateTime.Minutes(1) + DateTime.Seconds(20)
}
AtreidesAttackWaves =
{
easy = 3,
normal = 6,
hard = 9
}
AtreidesHunters =
{
{ "trooper", "trooper", "trooper" },
{ "trike", "light_inf", "light_inf", "light_inf", "light_inf" },
{ "trooper", "trooper", "trooper", "trike", "trike" },
{ "light_inf", "light_inf", "light_inf", "light_inf", "light_inf", "trooper", "trooper", "trooper", "trooper", "trooper" }
}
AtreidesPaths =
{
{ AtreidesEntry4.Location, AtreidesRally4.Location },
{ AtreidesEntry7.Location, AtreidesRally7.Location },
{ AtreidesEntry8.Location, AtreidesRally8.Location }
}
AtreidesHunterPaths =
{
{ AtreidesEntry6.Location, AtreidesRally6.Location },
{ AtreidesEntry5.Location, AtreidesRally5.Location },
{ AtreidesEntry3.Location, AtreidesRally3.Location },
{ AtreidesEntry1.Location, AtreidesRally1.Location }
}
AtreidesInitialPath = { AtreidesEntry2.Location, AtreidesRally2.Location }
AtreidesInitialReinforcements = { "light_inf", "light_inf", "quad", "quad", "trike", "trike", "trooper", "trooper" }
HarkonnenReinforcements = { "quad", "quad" }
HarkonnenPath = { HarkonnenEntry.Location, HarkonnenRally.Location }
HarkonnenBaseBuildings = { "barracks", "light_factory" }
HarkonnenUpgrades = { "upgrade.barracks", "upgrade.light" }
MessageCheck = function(index)
return #Harkonnen.GetActorsByType(HarkonnenBaseBuildings[index]) > 0 and not Harkonnen.HasPrerequisites({ HarkonnenUpgrades[index] })
end
Tick = function()
if Harkonnen.HasNoRequiredUnits() then
Atreides.MarkCompletedObjective(KillHarkonnen)
end
if Atreides.HasNoRequiredUnits() and not Harkonnen.IsObjectiveCompleted(KillAtreides) then
Media.DisplayMessage(UserInterface.GetFluentMessage("atreides-annihilated"), Mentat)
Harkonnen.MarkCompletedObjective(KillAtreides)
end
if DateTime.GameTime % DateTime.Seconds(10) == 0 and LastHarvesterEaten[Atreides] then
local units = Atreides.GetActorsByType("harvester")
if #units > 0 then
LastHarvesterEaten[Atreides] = false
ProtectHarvester(units[1], Atreides, AttackGroupSize[Difficulty])
end
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
end
WorldLoaded = function()
Atreides = Player.GetPlayer("Atreides")
Harkonnen = Player.GetPlayer("Harkonnen")
InitObjectives(Harkonnen)
KillHarkonnen = AddPrimaryObjective(Atreides, "")
KillAtreides = AddPrimaryObjective(Harkonnen, "eliminate-atreides-units-reinforcements")
Camera.Position = HConyard.CenterPosition
Trigger.OnAllKilled(AtreidesBase, function()
Utils.Do(Atreides.GetGroundAttackers(), IdleHunt)
end)
local path = function() return Utils.Random(AtreidesPaths) end
local waveCondition = function() return Harkonnen.IsObjectiveCompleted(KillAtreides) end
SendCarryallReinforcements(Atreides, 0, AtreidesAttackWaves[Difficulty], AtreidesAttackDelay[Difficulty], path, AtreidesReinforcements[Difficulty], waveCondition)
ActivateAI()
Trigger.AfterDelay(DateTime.Minutes(2) + DateTime.Seconds(30), function()
Reinforcements.ReinforceWithTransport(Harkonnen, "carryall.reinforce", HarkonnenReinforcements, HarkonnenPath, { HarkonnenPath[1] })
end)
TriggerCarryallReinforcements(Harkonnen, Atreides, AtreidesBaseAreaTriggers[1], AtreidesHunters[1], AtreidesHunterPaths[1])
TriggerCarryallReinforcements(Harkonnen, Atreides, AtreidesBaseAreaTriggers[2], AtreidesHunters[2], AtreidesHunterPaths[2])
TriggerCarryallReinforcements(Harkonnen, Atreides, AtreidesBaseAreaTriggers[3], AtreidesHunters[3], AtreidesHunterPaths[3])
TriggerCarryallReinforcements(Harkonnen, Atreides, AtreidesBaseAreaTriggers[4], AtreidesHunters[4], AtreidesHunterPaths[4])
end

Binary file not shown.

View File

@@ -0,0 +1,5 @@
## rules.yaml
briefing =
Attack and destroy the Atreides base at the Sietch Tabr. Strike hard and eliminate all resistance.
Heavier Quad vehicles have been made available for this assault - upgrade your Light Factory to access them.

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

View File

@@ -0,0 +1,213 @@
MapFormat: 12
RequiresMod: d2k
Title: Harkonnen 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: Harkonnen, Atreides
PlayerReference@Harkonnen:
Name: Harkonnen
Playable: True
LockFaction: True
Faction: harkonnen
LockColor: True
Color: D64A42
Enemies: Atreides, Creeps
PlayerReference@Atreides:
Name: Atreides
LockFaction: True
Faction: atreides
LockColor: True
Color: 5A7394
Enemies: Harkonnen, Creeps
Bot: campaign
Actors:
Actor0: wall
Location: 37,2
Owner: Atreides
AConyard: construction_yard
Location: 27,3
Owner: Atreides
ARefinery: refinery
Location: 31,3
Owner: Atreides
ASilo1: silo
Location: 35,3
Owner: Atreides
Actor4: wall
Location: 37,3
Owner: Atreides
ASilo2: silo
Location: 35,4
Owner: Atreides
Actor6: wall
Location: 37,4
Owner: Atreides
Actor7: wall
Location: 36,5
Owner: Atreides
Actor8: wall
Location: 37,5
Owner: Atreides
ASilo3: silo
Location: 28,7
Owner: Atreides
ASilo4: silo
Location: 28,8
Owner: Atreides
Actor11: wall
Location: 38,8
Owner: Atreides
Actor12: wall
Location: 39,8
Owner: Atreides
Actor13: wall
Location: 39,9
Owner: Atreides
ALightFactory: light_factory
Location: 28,10
Owner: Atreides
AOutpost: outpost
Location: 33,10
Owner: Atreides
Actor16: wall
Location: 39,10
Owner: Atreides
Actor17: wall
Location: 39,11
Owner: Atreides
Actor18: wall
Location: 39,12
Owner: Atreides
Actor19: wall
Location: 40,12
Owner: Atreides
AWindTrap1: wind_trap
Location: 28,13
Owner: Atreides
AWindTrap2: wind_trap
Location: 30,13
Owner: Atreides
ABarracks: barracks
Location: 32,14
Owner: Atreides
AWindTrap3: wind_trap
Location: 36,14
Owner: Atreides
Actor24: wormspawner
Location: 3,21
Owner: Creeps
Actor25: wormspawner
Location: 29,29
Owner: Creeps
HConyard: construction_yard
Location: 57,39
Owner: Harkonnen
Actor27: trike
Location: 54,40
Owner: Harkonnen
Actor28: light_inf
Location: 54,42
Owner: Harkonnen
Actor29: trike
Location: 56,42
Owner: Harkonnen
Actor30: quad
Location: 62,42
Owner: Harkonnen
Actor31: light_inf
Location: 54,43
Owner: Harkonnen
Actor32: trooper
Location: 58,44
Owner: Harkonnen
Actor33: quad
Location: 59,44
Owner: Harkonnen
Actor34: trooper
Location: 62,44
Owner: Harkonnen
Actor35: light_inf
Location: 58,46
Owner: Harkonnen
AtreidesRally1: waypoint
Owner: Neutral
Location: 20,3
AtreidesEntry1: waypoint
Owner: Neutral
Location: 20,2
AtreidesRally3: waypoint
Owner: Neutral
Location: 33,8
AtreidesRally2: waypoint
Owner: Neutral
Location: 32,7
AtreidesEntry2: waypoint
Owner: Neutral
Location: 32,2
AtreidesEntry3: waypoint
Owner: Neutral
Location: 65,8
AtreidesRally4: waypoint
Owner: Neutral
Location: 42,45
AtreidesEntry4: waypoint
Owner: Neutral
Location: 42,65
AtreidesRally5: waypoint
Owner: Neutral
Location: 60,13
AtreidesEntry5: waypoint
Owner: Neutral
Location: 65,13
AtreidesRally6: waypoint
Owner: Neutral
Location: 14,43
AtreidesEntry6: waypoint
Owner: Neutral
Location: 2,43
AtreidesRally7: waypoint
Owner: Neutral
Location: 21,49
AtreidesEntry7: waypoint
Owner: Neutral
Location: 21,65
AtreidesRally8: waypoint
Owner: Neutral
Location: 64,55
AtreidesEntry8: waypoint
Owner: Neutral
Location: 64,65
HarkonnenRally: waypoint
Owner: Neutral
Location: 60,45
HarkonnenEntry: waypoint
Owner: Neutral
Location: 65,45
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: 5000
World:
LuaScript:
Scripts: campaign.lua, utils.lua, harkonnen03b.lua, harkonnen03b-AI.lua
MissionData:
Briefing: briefing
BriefingVideo: H_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