RCS0056 - roslynator_max_line_length = 160
This commit is contained in:
committed by
Matthias Mailänder
parent
9d5d2ab493
commit
0649f3dc32
@@ -100,8 +100,12 @@ namespace OpenRA.Mods.Common.Traits
|
||||
return;
|
||||
|
||||
playerBuildings = world.ActorsHavingTrait<Building>().Where(a => a.Owner == player).ToArray();
|
||||
var excessPowerBonus = baseBuilder.Info.ExcessPowerIncrement * (playerBuildings.Length / baseBuilder.Info.ExcessPowerIncreaseThreshold.Clamp(1, int.MaxValue));
|
||||
minimumExcessPower = (baseBuilder.Info.MinimumExcessPower + excessPowerBonus).Clamp(baseBuilder.Info.MinimumExcessPower, baseBuilder.Info.MaximumExcessPower);
|
||||
var excessPowerBonus =
|
||||
baseBuilder.Info.ExcessPowerIncrement *
|
||||
(playerBuildings.Length / baseBuilder.Info.ExcessPowerIncreaseThreshold.Clamp(1, int.MaxValue));
|
||||
minimumExcessPower =
|
||||
(baseBuilder.Info.MinimumExcessPower + excessPowerBonus)
|
||||
.Clamp(baseBuilder.Info.MinimumExcessPower, baseBuilder.Info.MaximumExcessPower);
|
||||
|
||||
// PERF: Queue only one actor at a time per category
|
||||
itemQueuedThisTick = false;
|
||||
@@ -344,7 +348,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
var buildingVariantInfo = actorInfo.TraitInfoOrDefault<PlaceBuildingVariantsInfo>();
|
||||
var variants = buildingVariantInfo?.Actors ?? Array.Empty<string>();
|
||||
|
||||
var count = playerBuildings.Count(a => a.Info.Name == name || variants.Contains(a.Info.Name)) + (baseBuilder.BuildingsBeingProduced.TryGetValue(name, out var num) ? num : 0);
|
||||
var count = playerBuildings.Count(a =>
|
||||
a.Info.Name == name || variants.Contains(a.Info.Name)) +
|
||||
(baseBuilder.BuildingsBeingProduced.TryGetValue(name, out var num) ? num : 0);
|
||||
|
||||
// Do we want to build this structure?
|
||||
if (count * 100 > frac.Value * playerBuildings.Length)
|
||||
|
||||
@@ -148,7 +148,8 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
foreach (var minelayer in minelayers)
|
||||
{
|
||||
var cells = pathFinder.FindPathToTargetCell(minelayer.Actor, new[] { minelayer.Actor.Location }, enemy.Location, BlockedByActor.Immovable, laneBias: false);
|
||||
var cells = pathFinder.FindPathToTargetCell(
|
||||
minelayer.Actor, new[] { minelayer.Actor.Location }, enemy.Location, BlockedByActor.Immovable, laneBias: false);
|
||||
if (cells != null && cells.Count != 0)
|
||||
{
|
||||
AIUtils.BotDebug($"{player}: try find a location to lay mine.");
|
||||
@@ -192,7 +193,8 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
foreach (var minelayer in minelayers)
|
||||
{
|
||||
var cells = pathFinder.FindPathToTargetCell(minelayer.Actor, new[] { minelayer.Actor.Location }, minelayingPosition, BlockedByActor.Immovable, laneBias: false);
|
||||
var cells = pathFinder.FindPathToTargetCell(
|
||||
minelayer.Actor, new[] { minelayer.Actor.Location }, minelayingPosition, BlockedByActor.Immovable, laneBias: false);
|
||||
if (cells != null && cells.Count != 0)
|
||||
{
|
||||
orderedActors.Add(minelayer.Actor);
|
||||
|
||||
@@ -24,10 +24,16 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("What support power does this decision apply to?")]
|
||||
public readonly string OrderName = "AirstrikePowerInfoOrder";
|
||||
|
||||
[Desc("What is the coarse scan radius of this power?", "For finding the general target area, before doing a detail scan", "Should be 10 or more to avoid lag")]
|
||||
[Desc(
|
||||
"What is the coarse scan radius of this power?",
|
||||
"For finding the general target area, before doing a detail scan",
|
||||
"Should be 10 or more to avoid lag")]
|
||||
public readonly int CoarseScanRadius = 20;
|
||||
|
||||
[Desc("What is the fine scan radius of this power?", "For doing a detailed scan in the general target area.", "Minimum is 1")]
|
||||
[Desc(
|
||||
"What is the fine scan radius of this power?",
|
||||
"For doing a detailed scan in the general target area.",
|
||||
"Minimum is 1")]
|
||||
public readonly int FineScanRadius = 2;
|
||||
|
||||
[FieldLoader.LoadUsing(nameof(LoadConsiderations))]
|
||||
|
||||
@@ -111,7 +111,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
waitingPowers[sp] += 10;
|
||||
|
||||
// Note: SelectDirectionalTarget uses uint.MaxValue in ExtraData to indicate that the player did not pick a direction.
|
||||
bot.QueueOrder(new Order(sp.Key, supportPowerManager.Self, Target.FromCell(world, attackLocation.Value), false) { SuppressVisualFeedback = true, ExtraData = uint.MaxValue });
|
||||
bot.QueueOrder(
|
||||
new Order(sp.Key, supportPowerManager.Self, Target.FromCell(world, attackLocation.Value), false)
|
||||
{ SuppressVisualFeedback = true, ExtraData = uint.MaxValue });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,8 @@ namespace OpenRA.Mods.Common.Traits
|
||||
// Reason: If this is less than SquadSize, the bot might get stuck between not producing more units due to this,
|
||||
// but also not creating squads since there aren't enough idle units.
|
||||
[Desc("If > 0, only produce units as long as there are less than this amount of units idling inside the base.",
|
||||
"Beware: if it is less than squad size, e.g. the `SquadSize` from `SquadManagerBotModule`, the bot might get stuck as there aren't enough idle units to create squad.")]
|
||||
"Beware: if it is less than squad size, e.g. the `SquadSize` from `SquadManagerBotModule`, " +
|
||||
"the bot might get stuck as there aren't enough idle units to create squad.")]
|
||||
public readonly int IdleBaseUnitsMaximum = -1;
|
||||
|
||||
[Desc("Production queues AI uses for producing units.")]
|
||||
|
||||
Reference in New Issue
Block a user