Merge pull request #4694 from Unit158/fix
Changed things to do with Shroud to WRange. Updated Utility. Closes #4679
This commit is contained in:
@@ -75,9 +75,9 @@ namespace OpenRA.Mods.RA
|
||||
{
|
||||
// Move within sight range of the frozen actor
|
||||
var sight = self.TraitOrDefault<RevealsShroud>();
|
||||
var range = sight != null ? sight.Range : 2;
|
||||
var range = sight != null ? sight.Range : WRange.FromCells(2);
|
||||
|
||||
self.QueueActivity(move.MoveWithinRange(Target.FromPos(frozen.CenterPosition), WRange.FromCells(range)));
|
||||
self.QueueActivity(move.MoveWithinRange(Target.FromPos(frozen.CenterPosition), range));
|
||||
}
|
||||
|
||||
return Target.Invalid;
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace OpenRA.Mods.RA
|
||||
{
|
||||
public class MPStartLocationsInfo : TraitInfo<MPStartLocations>
|
||||
{
|
||||
public readonly int InitialExploreRange = 5;
|
||||
public readonly WRange InitialExploreRange = WRange.FromCells(5);
|
||||
}
|
||||
|
||||
public class MPStartLocations : IWorldLoaded
|
||||
|
||||
@@ -462,10 +462,10 @@ namespace OpenRA.Mods.RA.Missions
|
||||
SetupAlliedBase();
|
||||
|
||||
var shroud = allies1.Shroud;
|
||||
shroud.Explore(w, sam1.Location, 2);
|
||||
shroud.Explore(w, sam2.Location, 2);
|
||||
shroud.Explore(w, sam3.Location, 2);
|
||||
shroud.Explore(w, sam4.Location, 2);
|
||||
shroud.Explore(w, sam1.Location, WRange.FromCells(2));
|
||||
shroud.Explore(w, sam2.Location, WRange.FromCells(2));
|
||||
shroud.Explore(w, sam3.Location, WRange.FromCells(2));
|
||||
shroud.Explore(w, sam4.Location, WRange.FromCells(2));
|
||||
|
||||
if (w.LocalPlayer == null || w.LocalPlayer == allies1)
|
||||
wr.Viewport.Center(chinookHusk.CenterPosition);
|
||||
|
||||
@@ -333,8 +333,8 @@ namespace OpenRA.Mods.RA.Missions
|
||||
sam2 = actors["Sam2"];
|
||||
|
||||
var shroud = allies.PlayerActor.Trait<Shroud>();
|
||||
shroud.Explore(w, sam1.Location, 4);
|
||||
shroud.Explore(w, sam2.Location, 4);
|
||||
shroud.Explore(w, sam1.Location, WRange.FromCells(4));
|
||||
shroud.Explore(w, sam2.Location, WRange.FromCells(4));
|
||||
|
||||
wr.Viewport.Center(alliesbase.CenterPosition);
|
||||
StartCountDownTimer();
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace OpenRA.Mods.RA
|
||||
var total = (double)world.Map.Bounds.Width * world.Map.Bounds.Height;
|
||||
MapControl = world.Actors
|
||||
.Where(a => !a.IsDead() && a.IsInWorld && a.Owner == player && a.HasTrait<RevealsShroud>())
|
||||
.SelectMany(a => world.FindTilesInCircle(a.Location, a.Trait<RevealsShroud>().Range.Clamp(0, 50)))
|
||||
.SelectMany(a => world.FindTilesInCircle(a.Location, a.Trait<RevealsShroud>().Range.Clamp(WRange.Zero, WRange.FromCells(50)).Range / 1024))
|
||||
.Distinct()
|
||||
.Count() / total;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace OpenRA.Mods.RA
|
||||
{
|
||||
wr.DrawRangeCircleWithContrast(
|
||||
centerPosition,
|
||||
WRange.FromCells(ai.Traits.Get<CreatesShroudInfo>().Range),
|
||||
ai.Traits.Get<CreatesShroudInfo>().Range,
|
||||
Color.FromArgb(128, Color.Cyan),
|
||||
Color.FromArgb(96, Color.Black)
|
||||
);
|
||||
@@ -46,7 +46,7 @@ namespace OpenRA.Mods.RA
|
||||
|
||||
wr.DrawRangeCircleWithContrast(
|
||||
self.CenterPosition,
|
||||
WRange.FromCells(self.Info.Traits.Get<CreatesShroudInfo>().Range),
|
||||
self.Info.Traits.Get<CreatesShroudInfo>().Range,
|
||||
Color.FromArgb(128, Color.Cyan),
|
||||
Color.FromArgb(96, Color.Black)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user