Skip to content

Commit

Permalink
AS Fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
MustaphaTR committed May 21, 2024
1 parent 49898ec commit 3d42128
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
15 changes: 3 additions & 12 deletions OpenRA.Mods.AS/Traits/SupportPowers/AirstrikePowerRV.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

namespace OpenRA.Mods.AS.Traits
{
public class AirstrikePowerRVInfo : SupportPowerInfo
public class AirstrikePowerRVInfo : DirectionalSupportPowerInfo
{
[FieldLoader.Require]
public readonly Dictionary<int, string> UnitTypes = new();
Expand All @@ -44,22 +44,13 @@ public class AirstrikePowerRVInfo : SupportPowerInfo
[Desc("Amount of time to keep the camera alive after the aircraft have finished attacking")]
public readonly int CameraRemoveDelay = 25;

[Desc("Enables the player directional targeting")]
public readonly bool UseDirectionalTarget = false;

[Desc("Animation used to render the direction arrows.")]
public readonly string DirectionArrowAnimation = null;

[Desc("Palette for direction cursor animation.")]
public readonly string DirectionArrowPalette = "chrome";

[Desc("Weapon range offset to apply during the beacon clock calculation")]
public readonly WDist BeaconDistanceOffset = WDist.FromCells(6);

public override object Create(ActorInitializer init) { return new AirstrikePowerRV(init.Self, this); }
}

public class AirstrikePowerRV : SupportPower
public class AirstrikePowerRV : DirectionalSupportPower
{
readonly AirstrikePowerRVInfo info;

Expand All @@ -77,7 +68,7 @@ public override void SelectTarget(Actor self, string order, SupportPowerManager
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech",
Info.SelectTargetSpeechNotification, self.Owner.Faction.InternalName);

self.World.OrderGenerator = new SelectDirectionalTarget(self.World, order, manager, Info.Cursor, info.DirectionArrowAnimation, info.DirectionArrowPalette);
self.World.OrderGenerator = new SelectDirectionalTarget(self.World, order, manager, info);
}
else
base.SelectTarget(self, order, manager);
Expand Down
2 changes: 1 addition & 1 deletion OpenRA.Mods.AS/Traits/SupportPowers/DetonateWeaponPower.cs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ protected override IEnumerable<IRenderable> RenderAnnotations(WorldRenderer wr,

protected override string GetCursor(World world, CPos cell, int2 worldPixel, MouseInput mi)
{
return world.Map.Contains(cell) ? power.Info.Cursor : "generic-blocked";
return world.Map.Contains(cell) ? power.Info.Cursor : power.Info.BlockedCursor;
}
}
}
2 changes: 1 addition & 1 deletion OpenRA.Mods.AS/Traits/SupportPowers/FireArmamentPower.cs
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ protected override IEnumerable<IRenderable> RenderAnnotations(WorldRenderer wr,

protected override string GetCursor(World world, CPos cell, int2 worldPixel, MouseInput mi)
{
return IsValidTargetCell(cell) ? power.FireArmamentPowerInfo.Cursor : "generic-blocked";
return IsValidTargetCell(cell) ? power.FireArmamentPowerInfo.Cursor : power.FireArmamentPowerInfo.BlockedCursor;
}

bool IsValidTargetCell(CPos xy)
Expand Down

0 comments on commit 3d42128

Please sign in to comment.