From 943751547ea1a6417b7897cc2dcab9664005b197 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Thu, 22 Dec 2022 20:22:53 +0100 Subject: [PATCH] Don't hardcode enemy aircraft ignorance. --- .../Traits/BotModules/SquadManagerBotModule.cs | 2 +- mods/cnc/rules/ai.yaml | 3 +++ mods/d2k/rules/ai.yaml | 6 +++--- mods/ra/maps/soviet-05/rules.yaml | 1 + mods/ra/rules/ai.yaml | 4 ++++ mods/ts/rules/ai.yaml | 1 + 6 files changed, 13 insertions(+), 4 deletions(-) diff --git a/OpenRA.Mods.Common/Traits/BotModules/SquadManagerBotModule.cs b/OpenRA.Mods.Common/Traits/BotModules/SquadManagerBotModule.cs index 07ed5a8c79..6c0a9b394b 100644 --- a/OpenRA.Mods.Common/Traits/BotModules/SquadManagerBotModule.cs +++ b/OpenRA.Mods.Common/Traits/BotModules/SquadManagerBotModule.cs @@ -144,7 +144,7 @@ namespace OpenRA.Mods.Common.Traits // Use for proactive targeting. public bool IsPreferredEnemyUnit(Actor a) { - if (a == null || a.IsDead || Player.RelationshipWith(a.Owner) != PlayerRelationship.Enemy || a.Info.HasTraitInfo() || a.Info.HasTraitInfo()) + if (a == null || a.IsDead || Player.RelationshipWith(a.Owner) != PlayerRelationship.Enemy || a.Info.HasTraitInfo()) return false; var targetTypes = a.GetEnabledTargetTypes(); diff --git a/mods/cnc/rules/ai.yaml b/mods/cnc/rules/ai.yaml index 7d569178db..3d97c08375 100644 --- a/mods/cnc/rules/ai.yaml +++ b/mods/cnc/rules/ai.yaml @@ -223,6 +223,7 @@ Player: ConstructionYardTypes: fact AirUnitsTypes: heli, orca ProtectionTypes: fact, fact.gdi, fact.nod, nuke, nuk2, proc, silo, pyle, hand, afld, weap, hpad, hq, fix, eye, tmpl, gun, sam, obli, gtwr, atwr, mcv, harv, miss + IgnoredEnemyTargetTypes: Air UnitBuilderBotModule@cabal: RequiresCondition: enable-cabal-ai UnitQueues: Vehicle.Nod, Vehicle.GDI, Infantry.Nod, Infantry.GDI, Aircraft.Nod, Aircraft.GDI @@ -259,6 +260,7 @@ Player: ConstructionYardTypes: fact AirUnitsTypes: heli, orca ProtectionTypes: fact, fact.gdi, fact.nod, nuke, nuk2, proc, silo, pyle, hand, afld, weap, hpad, hq, fix, eye, tmpl, gun, sam, obli, gtwr, atwr, mcv, harv, miss + IgnoredEnemyTargetTypes: Air UnitBuilderBotModule@watson: RequiresCondition: enable-watson-ai UnitQueues: Vehicle.Nod, Vehicle.GDI, Infantry.Nod, Infantry.GDI, Aircraft.Nod, Aircraft.GDI @@ -290,6 +292,7 @@ Player: ConstructionYardTypes: fact AirUnitsTypes: heli, orca ProtectionTypes: fact, fact.gdi, fact.nod, nuke, nuk2, proc, silo, pyle, hand, afld, weap, hpad, hq, fix, eye, tmpl, gun, sam, obli, gtwr, atwr, mcv, harv, miss + IgnoredEnemyTargetTypes: Air UnitBuilderBotModule@hal9001: RequiresCondition: enable-hal9001-ai UnitQueues: Vehicle.Nod, Vehicle.GDI, Infantry.Nod, Infantry.GDI, Aircraft.Nod, Aircraft.GDI diff --git a/mods/d2k/rules/ai.yaml b/mods/d2k/rules/ai.yaml index 517952a6ed..b46d19aafc 100644 --- a/mods/d2k/rules/ai.yaml +++ b/mods/d2k/rules/ai.yaml @@ -224,7 +224,7 @@ Player: MaxBaseRadius: 40 ExcludeFromSquadsTypes: harvester, mcv, carryall, carryall.reinforce, ornithopter ConstructionYardTypes: construction_yard - IgnoredEnemyTargetTypes: Creep + IgnoredEnemyTargetTypes: Creep, Air ProtectionTypes: mcv, harvester, construction_yard, conyard.atreides, conyard.harkonnen, conyard.ordos, wind_trap, barracks, refinery, silo, light_factory, heavy_factory, outpost, starport, medium_gun_turret, large_gun_turret, repair_pad, high_tech_factory, research_centre, palace, mcv.starport, harvester.starport UnitBuilderBotModule@omnius: RequiresCondition: enable-omnius-ai @@ -269,7 +269,7 @@ Player: MaxBaseRadius: 40 ExcludeFromSquadsTypes: harvester, mcv, carryall, carryall.reinforce, ornithopter ConstructionYardTypes: construction_yard - IgnoredEnemyTargetTypes: Creep + IgnoredEnemyTargetTypes: Creep, Air ProtectionTypes: mcv, harvester, construction_yard, conyard.atreides, conyard.harkonnen, conyard.ordos, wind_trap, barracks, refinery, silo, light_factory, heavy_factory, outpost, starport, medium_gun_turret, large_gun_turret, repair_pad, high_tech_factory, research_centre, palace, mcv.starport, harvester.starport UnitBuilderBotModule@vidious: RequiresCondition: enable-vidious-ai @@ -309,7 +309,7 @@ Player: MaxBaseRadius: 40 ExcludeFromSquadsTypes: harvester, mcv, carryall, carryall.reinforce, ornithopter ConstructionYardTypes: construction_yard - IgnoredEnemyTargetTypes: Creep + IgnoredEnemyTargetTypes: Creep, Air ProtectionTypes: mcv, harvester, construction_yard, conyard.atreides, conyard.harkonnen, conyard.ordos, wind_trap, barracks, refinery, silo, light_factory, heavy_factory, outpost, starport, medium_gun_turret, large_gun_turret, repair_pad, high_tech_factory, research_centre, palace, mcv.starport, harvester.starport UnitBuilderBotModule@gladius: RequiresCondition: enable-gladius-ai diff --git a/mods/ra/maps/soviet-05/rules.yaml b/mods/ra/maps/soviet-05/rules.yaml index 29237fb65f..d34f5e0829 100644 --- a/mods/ra/maps/soviet-05/rules.yaml +++ b/mods/ra/maps/soviet-05/rules.yaml @@ -45,6 +45,7 @@ Player: ExcludeFromSquadsTypes: harv, mcv NavalUnitsTypes: dd, ca, lst, pt ConstructionYardTypes: fact + IgnoredEnemyTargetTypes: AirborneActor UnitBuilderBotModule@campaign: RequiresCondition: ai-active UnitsToBuild: diff --git a/mods/ra/rules/ai.yaml b/mods/ra/rules/ai.yaml index 9c7a983ce0..d8c9f61974 100644 --- a/mods/ra/rules/ai.yaml +++ b/mods/ra/rules/ai.yaml @@ -283,6 +283,7 @@ Player: ConstructionYardTypes: fact AirUnitsTypes: mig, yak, heli, hind, mh60 ProtectionTypes: harv, mcv, mslo, gap, spen, syrd, iron, pdox, tsla, agun, dome, pbox, hbox, gun, ftur, sam, atek, weap, fact, proc, silo, hpad, afld, afld.ukraine, powr, apwr, stek, barr, kenn, tent, fix, fpwr, tenf, syrf, spef, weaf, domf, fixf, fapw, atef, pdof, mslf, facf + IgnoredEnemyTargetTypes: AirborneActor McvManagerBotModule: RequiresCondition: enable-rush-ai || enable-normal-ai || enable-turtle-ai || enable-naval-ai McvTypes: mcv @@ -323,6 +324,7 @@ Player: NavalProductionTypes: spen, syrd AirUnitsTypes: mig, yak, heli, hind, mh60 ProtectionTypes: harv, mcv, mslo, gap, spen, syrd, iron, pdox, tsla, agun, dome, pbox, hbox, gun, ftur, sam, atek, weap, fact, proc, silo, hpad, afld, afld.ukraine, powr, apwr, stek, barr, kenn, tent, fix, fpwr, tenf, syrf, spef, weaf, domf, fixf, fapw, atef, pdof, mslf, facf + IgnoredEnemyTargetTypes: AirborneActor UnitBuilderBotModule@normal: RequiresCondition: enable-normal-ai UnitsToBuild: @@ -367,6 +369,7 @@ Player: NavalProductionTypes: spen, syrd AirUnitsTypes: mig, yak, heli, hind, mh60 ProtectionTypes: harv, mcv, mslo, gap, spen, syrd, iron, pdox, tsla, agun, dome, pbox, hbox, gun, ftur, sam, atek, weap, fact, proc, silo, hpad, afld, afld.ukraine, powr, apwr, stek, barr, kenn, tent, fix, fpwr, tenf, syrf, spef, weaf, domf, fixf, fapw, atef, pdof, mslf, facf + IgnoredEnemyTargetTypes: AirborneActor UnitBuilderBotModule@turtle: RequiresCondition: enable-turtle-ai UnitsToBuild: @@ -411,6 +414,7 @@ Player: NavalProductionTypes: spen, syrd AirUnitsTypes: mig, yak, heli, hind, mh60 ProtectionTypes: harv, mcv, mslo, gap, spen, syrd, iron, pdox, tsla, agun, dome, pbox, hbox, gun, ftur, sam, atek, weap, fact, proc, silo, hpad, afld, afld.ukraine, powr, apwr, stek, barr, kenn, tent, fix, fpwr, tenf, syrf, spef, weaf, domf, fixf, fapw, atef, pdof, mslf, facf + IgnoredEnemyTargetTypes: AirborneActor UnitBuilderBotModule@naval: RequiresCondition: enable-naval-ai UnitsToBuild: diff --git a/mods/ts/rules/ai.yaml b/mods/ts/rules/ai.yaml index 8f0b8f31eb..31fafa239d 100644 --- a/mods/ts/rules/ai.yaml +++ b/mods/ts/rules/ai.yaml @@ -75,6 +75,7 @@ Player: ConstructionYardTypes: gacnst AirUnitsTypes: orca, orcab, scrin, apache, jumpjet ProtectionTypes: gapowr, gapowrup, gapile, gaweap, gahpad, gadept, garadr, gatech, gaplug, gagate_a, gagate_b, gactwr, gavulc, garock, gacsam, napowr, naapwr, nahand, naweap, nahpad, naradr, natech, nastlh, natmpl, namisl, nawast, nagate_a, nagate_b, nalasr, naobel, nasam, weed, gacnst, proc, gasilo, napuls, mcv, harv + IgnoredEnemyTargetTypes: Air UnitBuilderBotModule@test: RequiresCondition: enable-test-ai UnitQueues: Vehicle, Infantry, Air