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:
115
mods/ra/maps/sarin-gas-1-crackdown/crackdown-AI.lua
Normal file
115
mods/ra/maps/sarin-gas-1-crackdown/crackdown-AI.lua
Normal file
@@ -0,0 +1,115 @@
|
||||
--[[
|
||||
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.
|
||||
]]
|
||||
IdlingUnits = { }
|
||||
AttackGroup = { }
|
||||
AttackGroupSize = 10
|
||||
BGAttackGroup = { }
|
||||
BGAttackGroupSize = 8
|
||||
SovietInfantry = { "e1", "e2", "e4" }
|
||||
SovietVehicles = { "ttnk", "3tnk", "3tnk", "v2rl" }
|
||||
ProductionInterval =
|
||||
{
|
||||
easy = DateTime.Seconds(25),
|
||||
normal = DateTime.Seconds(15),
|
||||
hard = DateTime.Seconds(5)
|
||||
}
|
||||
|
||||
GroundAttackUnits = { { "ttnk", "ttnk", "e2", "e2", "e2" }, { "3tnk", "v2rl", "e4", "e4", "e4" } }
|
||||
GroundAttackPaths =
|
||||
{
|
||||
{ EscapeSouth5.Location, Patrol1.Location },
|
||||
{ EscapeNorth10.Location, EscapeNorth7.Location }
|
||||
}
|
||||
GroundWavesDelays =
|
||||
{
|
||||
easy = 4,
|
||||
normal = 3,
|
||||
hard = 2
|
||||
}
|
||||
|
||||
SendBGAttackGroup = function()
|
||||
if #BGAttackGroup < BGAttackGroupSize then
|
||||
return
|
||||
end
|
||||
|
||||
Utils.Do(BGAttackGroup, function(unit)
|
||||
if not unit.IsDead then
|
||||
Trigger.OnIdle(unit, unit.Hunt)
|
||||
end
|
||||
end)
|
||||
|
||||
BGAttackGroup = { }
|
||||
end
|
||||
|
||||
ProduceBadGuyInfantry = function()
|
||||
if BadGuyRax.IsDead or BadGuyRax.Owner ~= BadGuy then
|
||||
return
|
||||
end
|
||||
|
||||
BadGuy.Build({ Utils.Random(SovietInfantry) }, function(units)
|
||||
table.insert(BGAttackGroup, units[1])
|
||||
SendBGAttackGroup()
|
||||
Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceBadGuyInfantry)
|
||||
end)
|
||||
end
|
||||
|
||||
SendAttackGroup = function()
|
||||
if #AttackGroup < AttackGroupSize then
|
||||
return
|
||||
end
|
||||
|
||||
Utils.Do(AttackGroup, function(unit)
|
||||
if not unit.IsDead then
|
||||
Trigger.OnIdle(unit, unit.Hunt)
|
||||
end
|
||||
end)
|
||||
|
||||
AttackGroup = { }
|
||||
end
|
||||
|
||||
ProduceUSSRInfantry = function()
|
||||
if USSRRax.IsDead or USSRRax.Owner ~= USSR then
|
||||
return
|
||||
end
|
||||
|
||||
USSR.Build({ Utils.Random(SovietInfantry) }, function(units)
|
||||
table.insert(AttackGroup, units[1])
|
||||
SendAttackGroup()
|
||||
Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceUSSRInfantry)
|
||||
end)
|
||||
end
|
||||
|
||||
ProduceVehicles = function()
|
||||
if USSRWarFactory.IsDead or USSRWarFactory.Owner ~= USSR then
|
||||
return
|
||||
end
|
||||
|
||||
USSR.Build({ Utils.Random(SovietVehicles) }, function(units)
|
||||
table.insert(AttackGroup, units[1])
|
||||
SendAttackGroup()
|
||||
Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceVehicles)
|
||||
end)
|
||||
end
|
||||
|
||||
GroundWaves = function()
|
||||
Reinforcements.Reinforce(USSR, Utils.Random(GroundAttackUnits), Utils.Random(GroundAttackPaths), 0, function(unit)
|
||||
unit.Hunt()
|
||||
end)
|
||||
|
||||
Trigger.AfterDelay(DateTime.Minutes(GroundWavesDelays), GroundWaves)
|
||||
end
|
||||
|
||||
ActivateAI = function()
|
||||
GroundWavesDelays = GroundWavesDelays[Difficulty]
|
||||
|
||||
ProduceBadGuyInfantry()
|
||||
ProduceUSSRInfantry()
|
||||
Trigger.AfterDelay(DateTime.Minutes(1), ProduceVehicles)
|
||||
Trigger.AfterDelay(DateTime.Minutes(4), GroundWaves)
|
||||
end
|
||||
160
mods/ra/maps/sarin-gas-1-crackdown/crackdown.lua
Normal file
160
mods/ra/maps/sarin-gas-1-crackdown/crackdown.lua
Normal file
@@ -0,0 +1,160 @@
|
||||
--[[
|
||||
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.
|
||||
]]
|
||||
MammothPath = { Patrol1.Location, Patrol2.Location, Patrol3.Location, Patrol4.Location }
|
||||
ConvoyTrucks = { Truck1, Truck2, Truck3, Truck4, Truck5, IntroTruck1, IntroTruck2 }
|
||||
IntroTrucks = { IntroTruck1, IntroTruck2 }
|
||||
TruckEscapeNorth = { EscapeNorth1, EscapeNorth2, EscapeNorth3, EscapeNorth4, EscapeNorth5, EscapeNorth6, EscapeNorth7, EscapeNorth8, EscapeNorth9, EscapeNorth10 }
|
||||
TruckEscapeSouth = { EscapeSouth1, EscapeSouth2, EscapeSouth3, EscapeSouth4, EscapeSouth5 }
|
||||
SovAttackStart = { StartTank, StartRifle1, StartRifle2, StartRifle3, StartRifle4 }
|
||||
SovAttackStart2 = { StartRifle5, StartRifle6, StartGren }
|
||||
RunAway = { IntroTruck2, StartRifle3, StartRifle4 }
|
||||
GreeceRifles = { GreeceRifle1, GreeceRifle2, GreeceRifle3, GreeceRifle4, GreeceRifle5 }
|
||||
CombatTeam1 = { "mnly", "spy", "spy", "mcv" }
|
||||
CombatTeam2 =
|
||||
{
|
||||
easy = { "2tnk", "2tnk", "2tnk", "e3", "e3", "e3" },
|
||||
normal = { "e3", "e3", "e3", "2tnk", "1tnk" },
|
||||
hard = { "e3", "e3", "e3", "1tnk" }
|
||||
}
|
||||
|
||||
SetupTriggers = function()
|
||||
Trigger.OnInfiltrated(RadarDome, function()
|
||||
Greece.MarkCompletedObjective(RadarSpyObjective)
|
||||
Actor.Create("camera", true, { Owner = Greece, Location = Cam1.Location })
|
||||
Actor.Create("camera", true, { Owner = Greece, Location = Cam2.Location })
|
||||
Actor.Create("camera", true, { Owner = Greece, Location = Cam3.Location })
|
||||
Actor.Create("camera", true, { Owner = Greece, Location = Cam4.Location })
|
||||
end)
|
||||
|
||||
Trigger.OnKilled(RadarDome, function()
|
||||
if not Greece.IsObjectiveCompleted(RadarSpyObjective) then
|
||||
Greece.MarkFailedObjective(RadarSpyObjective)
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.OnAllKilled(ConvoyTrucks, function()
|
||||
Greece.MarkCompletedObjective(DestroyAllTrucksObjective)
|
||||
end)
|
||||
end
|
||||
|
||||
MissionStart = function()
|
||||
Trigger.AfterDelay(DateTime.Seconds(1), function()
|
||||
Reinforcements.Reinforce(Greece, CombatTeam1, { TruckEscapeCenter.Location, DefaultCameraPosition.Location })
|
||||
local StartCamera = Actor.Create("camera", true, { Owner = Greece, Location = DefaultCameraPosition.Location })
|
||||
Trigger.AfterDelay(DateTime.Seconds(10), function()
|
||||
StartCamera.Destroy()
|
||||
end)
|
||||
end)
|
||||
|
||||
Utils.Do(GreeceRifles, function(actor)
|
||||
actor.Move(DefaultCameraPosition.Location)
|
||||
end)
|
||||
|
||||
Utils.Do(SovAttackStart, function(actor)
|
||||
actor.AttackMove(DefaultCameraPosition.Location)
|
||||
end)
|
||||
|
||||
Utils.Do(IntroTrucks, function(truck)
|
||||
truck.Move(TruckEscapeCenter.Location)
|
||||
end)
|
||||
|
||||
Trigger.AfterDelay(DateTime.Seconds(3), function()
|
||||
Utils.Do(RunAway, function(actor)
|
||||
if actor.IsDead then
|
||||
return
|
||||
else
|
||||
actor.Stop()
|
||||
actor.Move(Cam4.Location)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
Trigger.AfterDelay(DateTime.Seconds(10), function()
|
||||
Utils.Do(SovAttackStart2, function(actor)
|
||||
if actor.IsDead then
|
||||
return
|
||||
else
|
||||
actor.AttackMove(DefaultCameraPosition.Location)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
Trigger.AfterDelay(DateTime.Minutes(1), function()
|
||||
CombatTeam2 = CombatTeam2[Difficulty]
|
||||
Reinforcements.Reinforce(Greece, CombatTeam2, { TruckEscapeCenter.Location, DefaultCameraPosition.Location })
|
||||
Media.PlaySpeechNotification(Greece, "ReinforcementsArrived")
|
||||
end)
|
||||
end
|
||||
|
||||
SendPatrol = function(mammoth)
|
||||
if not mammoth.IsDead then
|
||||
mammoth.Patrol(MammothPath, true, 20)
|
||||
end
|
||||
end
|
||||
|
||||
MoveTruckEscapeRoute = function(truck, route)
|
||||
if truck.IsDead then
|
||||
return
|
||||
else
|
||||
Media.DisplayMessage(UserInterface.GetFluentMessage("convoy-truck-escaping"))
|
||||
Media.PlaySoundNotification(Greece, "AlertBleep")
|
||||
Utils.Do(route, function(waypoint)
|
||||
truck.Move(waypoint.Location)
|
||||
end)
|
||||
|
||||
Trigger.OnIdle(truck, function()
|
||||
if truck.Location == route[#route].Location then
|
||||
truck.Destroy()
|
||||
Greece.MarkFailedObjective(DestroyAllTrucksObjective)
|
||||
else
|
||||
truck.Move(route[#route].Location)
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
Tick = function()
|
||||
USSR.Cash = 5000
|
||||
BadGuy.Cash = 5000
|
||||
|
||||
if USSR.HasNoRequiredUnits() and BadGuy.HasNoRequiredUnits() then
|
||||
Greece.MarkCompletedObjective(KillAllObjective)
|
||||
end
|
||||
|
||||
if Greece.HasNoRequiredUnits() then
|
||||
USSR.MarkCompletedObjective(USSRobjective)
|
||||
end
|
||||
end
|
||||
|
||||
WorldLoaded = function()
|
||||
Greece = Player.GetPlayer("Greece")
|
||||
USSR = Player.GetPlayer("USSR")
|
||||
BadGuy = Player.GetPlayer("BadGuy")
|
||||
|
||||
InitObjectives(Greece)
|
||||
|
||||
DestroyAllTrucksObjective = AddPrimaryObjective(Greece, "prevent-soviet-trucks-escaping")
|
||||
KillAllObjective = AddPrimaryObjective(Greece, "clear-sector-soviet-presence")
|
||||
RadarSpyObjective = AddSecondaryObjective(Greece, "infiltrate-radar-reveal-escape-routes")
|
||||
USSRobjective = USSR.AddObjective("")
|
||||
|
||||
ActivateAI()
|
||||
SetupTriggers()
|
||||
MissionStart()
|
||||
|
||||
Camera.Position = DefaultCameraPosition.CenterPosition
|
||||
|
||||
Trigger.AfterDelay(DateTime.Minutes(5), function() SendPatrol(PatrolMammoth) end)
|
||||
Trigger.AfterDelay(DateTime.Minutes(5), function() MoveTruckEscapeRoute(Truck1, TruckEscapeNorth) end)
|
||||
Trigger.AfterDelay(DateTime.Minutes(9), function() MoveTruckEscapeRoute(Truck2, TruckEscapeNorth) end)
|
||||
Trigger.AfterDelay(DateTime.Minutes(12), function() MoveTruckEscapeRoute(Truck3, TruckEscapeSouth) end)
|
||||
Trigger.AfterDelay(DateTime.Minutes(15), function() MoveTruckEscapeRoute(Truck4, TruckEscapeNorth) end)
|
||||
Trigger.AfterDelay(DateTime.Minutes(17), function() MoveTruckEscapeRoute(Truck5, TruckEscapeSouth) end)
|
||||
Trigger.AfterDelay(DateTime.Minutes(18), function() MoveTruckEscapeRoute(IntroTruck2, TruckEscapeSouth) end)
|
||||
end
|
||||
BIN
mods/ra/maps/sarin-gas-1-crackdown/map.bin
Normal file
BIN
mods/ra/maps/sarin-gas-1-crackdown/map.bin
Normal file
Binary file not shown.
7
mods/ra/maps/sarin-gas-1-crackdown/map.ftl
Normal file
7
mods/ra/maps/sarin-gas-1-crackdown/map.ftl
Normal file
@@ -0,0 +1,7 @@
|
||||
## rules.yaml
|
||||
briefing =
|
||||
A Soviet convoy of Sarin nerve gas has stopped at a riverside outpost for refuelling. This is a perfect opportunity to destroy the Sarin shipment, and remove the Soviet threat in the area.
|
||||
|
||||
Use your forces to destroy the convoy trucks and the base. It is imperative that none of the convoy trucks escape.
|
||||
|
||||
The Soviets keep their convoy information in their radar center. If a spy was to infiltrate the facility, it may help us locate the convoy escape routes.
|
||||
BIN
mods/ra/maps/sarin-gas-1-crackdown/map.png
Normal file
BIN
mods/ra/maps/sarin-gas-1-crackdown/map.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
1014
mods/ra/maps/sarin-gas-1-crackdown/map.yaml
Normal file
1014
mods/ra/maps/sarin-gas-1-crackdown/map.yaml
Normal file
File diff suppressed because it is too large
Load Diff
114
mods/ra/maps/sarin-gas-1-crackdown/rules.yaml
Normal file
114
mods/ra/maps/sarin-gas-1-crackdown/rules.yaml
Normal file
@@ -0,0 +1,114 @@
|
||||
World:
|
||||
LuaScript:
|
||||
Scripts: campaign.lua, utils.lua, crackdown.lua, crackdown-AI.lua
|
||||
MissionData:
|
||||
Briefing: briefing
|
||||
WinVideo: allymorf.vqa
|
||||
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: normal
|
||||
|
||||
Player:
|
||||
PlayerResources:
|
||||
DefaultCash: 5000
|
||||
|
||||
APC:
|
||||
Buildable:
|
||||
Prerequisites: ~vehicles.allies
|
||||
|
||||
E3:
|
||||
Buildable:
|
||||
Prerequisites: ~infantry.allies
|
||||
|
||||
3TNK:
|
||||
Buildable:
|
||||
Prerequisites: ~vehicles.soviet
|
||||
|
||||
V2RL:
|
||||
Buildable:
|
||||
Prerequisites: ~vehicles.soviet
|
||||
|
||||
TTNK:
|
||||
Buildable:
|
||||
Prerequisites: tsla, ~vehicles.soviet
|
||||
|
||||
2TNK:
|
||||
Buildable:
|
||||
Prerequisites: ~disabled
|
||||
|
||||
ARTY:
|
||||
Buildable:
|
||||
Prerequisites: ~disabled
|
||||
|
||||
MRJ:
|
||||
Buildable:
|
||||
Prerequisites: ~disabled
|
||||
|
||||
THF:
|
||||
Buildable:
|
||||
Prerequisites: ~disabled
|
||||
|
||||
MSUB:
|
||||
Buildable:
|
||||
Prerequisites: ~disabled
|
||||
|
||||
CA:
|
||||
Buildable:
|
||||
Prerequisites: ~disabled
|
||||
|
||||
ATEK:
|
||||
Buildable:
|
||||
Prerequisites: ~disabled
|
||||
|
||||
APWR:
|
||||
Buildable:
|
||||
Prerequisites: ~disabled
|
||||
|
||||
GAP:
|
||||
Buildable:
|
||||
Prerequisites: ~disabled
|
||||
|
||||
PDOX:
|
||||
Buildable:
|
||||
Prerequisites: ~disabled
|
||||
|
||||
MSLO:
|
||||
Buildable:
|
||||
Prerequisites: ~disabled
|
||||
|
||||
AGUN:
|
||||
Buildable:
|
||||
Prerequisites: ~disabled
|
||||
|
||||
HPAD:
|
||||
Buildable:
|
||||
Prerequisites: ~disabled
|
||||
|
||||
TRUK:
|
||||
-SpawnActorOnDeath:
|
||||
|
||||
MGG:
|
||||
Buildable:
|
||||
Prerequisites: ~disabled
|
||||
|
||||
FTRK:
|
||||
Buildable:
|
||||
Prerequisites: ~disabled
|
||||
|
||||
CTNK:
|
||||
Buildable:
|
||||
Prerequisites: ~disabled
|
||||
|
||||
STNK:
|
||||
Buildable:
|
||||
Prerequisites: ~disabled
|
||||
|
||||
E7:
|
||||
Buildable:
|
||||
Prerequisites: ~disabled
|
||||
Reference in New Issue
Block a user