Merge pull request #10121 from RoosterDragon/spelling
Fix some spellings
This commit is contained in:
@@ -704,7 +704,7 @@ namespace OpenRA
|
||||
}
|
||||
}
|
||||
|
||||
// mirrors DescriptionAttribute from System.ComponentModel but we dont want to have to use that everywhere.
|
||||
// Mirrors DescriptionAttribute from System.ComponentModel but we don't want to have to use that everywhere.
|
||||
[AttributeUsage(AttributeTargets.All)]
|
||||
public sealed class DescAttribute : Attribute
|
||||
{
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace OpenRA.FileFormats
|
||||
var coded = br.ReadBits(8);
|
||||
|
||||
if (coded < 0 || coded > 1)
|
||||
throw new NotImplementedException("Invalid datastream");
|
||||
throw new NotImplementedException("Invalid data stream");
|
||||
var encodedLiterals = coded == 1;
|
||||
|
||||
// log2(dictionary size) - 6
|
||||
@@ -160,7 +160,7 @@ namespace OpenRA.FileFormats
|
||||
return ms.ToArray();
|
||||
}
|
||||
|
||||
// Decode a code using huffman table h.
|
||||
// Decode a code using Huffman table h.
|
||||
static int Decode(Huffman h, BitReader br)
|
||||
{
|
||||
var code = 0; // len bits being decoded
|
||||
|
||||
@@ -111,11 +111,11 @@ namespace OpenRA.FileFormats
|
||||
|
||||
/// <summary>
|
||||
/// A fast (native) CRC32 implementation that can be used on a pinned byte array using
|
||||
/// default polynomal.
|
||||
/// default polynomial.
|
||||
/// </summary>
|
||||
/// <param name="data"> [in,out] If non-null, the.</param>
|
||||
/// <param name="len"> The length of the data data.</param>
|
||||
/// <param name="polynomial">The polynomal to xor with.</param>
|
||||
/// <param name="len"> The length of the data.</param>
|
||||
/// <param name="polynomial">The polynomial to XOR with.</param>
|
||||
/// <returns>The calculated checksum.</returns>
|
||||
public static unsafe uint Calculate(byte* data, uint len, uint polynomial)
|
||||
{
|
||||
|
||||
@@ -187,7 +187,7 @@ namespace OpenRA.FileFormats
|
||||
if (bitDepth == 8 && colorType == (PngColorType.Indexed | PngColorType.Color))
|
||||
return PixelFormat.Format8bppIndexed;
|
||||
|
||||
throw new InvalidDataException("Unknown pixelformat");
|
||||
throw new InvalidDataException("Unknown pixel format");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -468,7 +468,7 @@ namespace OpenRA.FileSystem
|
||||
return GetContentById(fileDes.LinkToPrevious);
|
||||
|
||||
if ((fileDes.Flags & FileObfuscated) != 0)
|
||||
throw new NotImplementedException("Haven't implemented obfustcated files");
|
||||
throw new NotImplementedException("Haven't implemented obfuscated files");
|
||||
|
||||
var output = new MemoryStream((int)fileDes.ExpandedSize);
|
||||
|
||||
@@ -495,7 +495,7 @@ namespace OpenRA.FileSystem
|
||||
}
|
||||
|
||||
if ((fileDes.Flags & FileObfuscated) != 0)
|
||||
throw new NotImplementedException("Haven't implemented obfustcated files");
|
||||
throw new NotImplementedException("Haven't implemented obfuscated files");
|
||||
|
||||
using (var reader = new CabReader(fileDes, index, commonName))
|
||||
reader.CopyTo(output);
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace OpenRA.FileSystem
|
||||
this.priority = priority;
|
||||
try
|
||||
{
|
||||
// pull the file into memory, dont keep it open.
|
||||
// Pull the file into memory, don't keep it open.
|
||||
pkg = new SZipFile(new MemoryStream(File.ReadAllBytes(filename)));
|
||||
}
|
||||
catch (ZipException e)
|
||||
@@ -43,7 +43,7 @@ namespace OpenRA.FileSystem
|
||||
}
|
||||
}
|
||||
|
||||
// Create a new zip with the specified contents
|
||||
// Create a new zip with the specified contents.
|
||||
public ZipFile(string filename, int priority, Dictionary<string, byte[]> contents)
|
||||
{
|
||||
this.priority = priority;
|
||||
|
||||
@@ -412,7 +412,7 @@ namespace OpenRA
|
||||
public static event Action OnQuit = () => { };
|
||||
|
||||
// Note: These delayed actions should only be used by widgets or disposing objects
|
||||
// - things that depend on a particular world should be queuing them on the worldactor.
|
||||
// - things that depend on a particular world should be queuing them on the world actor.
|
||||
static volatile ActionQueue delayedActions = new ActionQueue();
|
||||
public static void RunAfterTick(Action a) { delayedActions.Add(a, Game.RunTime); }
|
||||
public static void RunAfterDelay(int delayMilliseconds, Action a) { delayedActions.Add(a, Game.RunTime + delayMilliseconds); }
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace OpenRA
|
||||
/// The actor name can be anything, but the sprites used in the Render*: traits default to this one.
|
||||
/// If you add an ^ in front of the name, the engine will recognize this as a collection of traits
|
||||
/// that can be inherited by others (using Inherits:) and not a real unit.
|
||||
/// You can remove inherited traits by adding a - infront of them as in -TraitName: to inherit everything, but this trait.
|
||||
/// You can remove inherited traits by adding a - in front of them as in -TraitName: to inherit everything, but this trait.
|
||||
/// </summary>
|
||||
public readonly string Name;
|
||||
readonly TypeDictionary traits = new TypeDictionary();
|
||||
|
||||
@@ -154,7 +154,7 @@ namespace OpenRA.Graphics
|
||||
screenCorners[j] = new float2(corners[j][0], corners[j][1]);
|
||||
}
|
||||
|
||||
// Shadows are rendered at twice the resolution to reduce artefacts
|
||||
// Shadows are rendered at twice the resolution to reduce artifacts
|
||||
Size spriteSize, shadowSpriteSize;
|
||||
int2 spriteOffset, shadowSpriteOffset;
|
||||
CalculateSpriteGeometry(tl, br, 1, out spriteSize, out spriteOffset);
|
||||
|
||||
@@ -199,7 +199,7 @@ namespace OpenRA
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Write("debug", "An exception occured while trying to load mod {0}:", mod);
|
||||
Log.Write("debug", "An exception occurred while trying to load mod {0}:", mod);
|
||||
Log.Write("debug", ex.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1222,7 +1222,7 @@ namespace OpenRA
|
||||
return result;
|
||||
|
||||
// If the lengths are equal, use other means to sort them.
|
||||
// Try the hashcode first because it gives more
|
||||
// Try the hash code first because it gives more
|
||||
// random-appearing results than X or Y that would always
|
||||
// prefer the leftmost/topmost position.
|
||||
result = a.GetHashCode().CompareTo(b.GetHashCode());
|
||||
|
||||
@@ -159,7 +159,7 @@ namespace OpenRA
|
||||
|
||||
LoadTranslations(map);
|
||||
|
||||
// Reinit all our assets
|
||||
// Reinitialize all our assets
|
||||
InitializeLoaders();
|
||||
GlobalFileSystem.LoadFromManifest(Manifest);
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace OpenRA
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("An exception occured when trying to load ModMetadata for `{0}`:".F(m));
|
||||
Console.WriteLine("An exception occurred when trying to load ModMetadata for `{0}`:".F(m));
|
||||
Console.WriteLine(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace OpenRA.Server
|
||||
{
|
||||
try
|
||||
{
|
||||
// NOTE(jsd): Poll the socket first to see if there's anything there.
|
||||
// Poll the socket first to see if there's anything there.
|
||||
// This avoids the exception with SocketErrorCode == `SocketError.WouldBlock` thrown
|
||||
// from `socket.Receive(rx)`.
|
||||
if (!Socket.Poll(0, SelectMode.SelectRead)) break;
|
||||
@@ -64,7 +64,7 @@ namespace OpenRA.Server
|
||||
}
|
||||
catch (SocketException e)
|
||||
{
|
||||
// NOTE(jsd): This should no longer be needed with the socket.Poll call above.
|
||||
// This should no longer be needed with the socket.Poll call above.
|
||||
if (e.SocketErrorCode == SocketError.WouldBlock) break;
|
||||
|
||||
server.DropClient(this);
|
||||
|
||||
@@ -242,7 +242,7 @@ namespace OpenRA.Server
|
||||
catch (Exception e)
|
||||
{
|
||||
/* TODO: Could have an exception here when listener 'goes away' when calling AcceptConnection! */
|
||||
/* Alternative would be to use locking but the listener doesnt go away without a reason. */
|
||||
/* Alternative would be to use locking but the listener doesn't go away without a reason. */
|
||||
Log.Write("server", "Accepting the connection failed.", e);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace OpenRA
|
||||
|
||||
public bool NatDeviceAvailable = false; // internal check if discovery succeeded
|
||||
|
||||
[Desc("Time in miliseconds to search for UPnP enabled NAT devices.")]
|
||||
[Desc("Time in milliseconds to search for UPnP enabled NAT devices.")]
|
||||
public int NatDiscoveryTimeout = 1000;
|
||||
|
||||
[Desc("Print very detailed logs for debugging issues with routers.")]
|
||||
@@ -60,7 +60,7 @@ namespace OpenRA
|
||||
[Desc("Takes a comma separated list of IP addresses that are not allowed to join.")]
|
||||
public string[] Ban = { };
|
||||
|
||||
[Desc("Value in miliseconds when to terminate the game. Needs to be at least 10000 (10 s) to enable the timer.")]
|
||||
[Desc("Value in milliseconds when to terminate the game. Needs to be at least 10000 (10 s) to enable the timer.")]
|
||||
public int TimeOut = 0;
|
||||
|
||||
[Desc("Run in headless mode with an empty renderer and without sound output.")]
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace OpenRA
|
||||
{
|
||||
ChannelInfo info;
|
||||
if (!Channels.TryGetValue(channel, out info))
|
||||
throw new Exception("Tried logging to non-existant channel " + channel);
|
||||
throw new Exception("Tried logging to non-existent channel " + channel);
|
||||
|
||||
if (info.Writer == null)
|
||||
return;
|
||||
@@ -77,7 +77,7 @@ namespace OpenRA
|
||||
{
|
||||
ChannelInfo info;
|
||||
if (!Channels.TryGetValue(channel, out info))
|
||||
throw new Exception("Tried logging to non-existant channel " + channel);
|
||||
throw new Exception("Tried logging to non-existent channel " + channel);
|
||||
|
||||
if (info.Writer == null)
|
||||
return;
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace OpenRA.Traits
|
||||
[Desc("This is the internal name for owner checks.")]
|
||||
public readonly string InternalName = null;
|
||||
|
||||
[Desc("Pick a random faction as the player's facton out of this list.")]
|
||||
[Desc("Pick a random faction as the player's faction out of this list.")]
|
||||
public readonly HashSet<string> RandomFactionMembers = new HashSet<string>();
|
||||
|
||||
[Desc("The side that the faction belongs to. For example, England belongs to the 'Allies' side.")]
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace OpenRA
|
||||
// 1 sample produces a rectangular probability
|
||||
// 2 samples produces a triangular probability
|
||||
// ...
|
||||
// N samples approximates a true gaussian
|
||||
// N samples approximates a true Gaussian
|
||||
public static WDist FromPDF(MersenneTwister r, int samples)
|
||||
{
|
||||
return new WDist(Exts.MakeArray(samples, _ => r.Next(-1024, 1024))
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace OpenRA
|
||||
// Theoretically 1024 * * 2, but may differ slightly due to rounding
|
||||
var lsq = q[0] * q[0] + q[1] * q[1] + q[2] * q[2] + q[3] * q[3];
|
||||
|
||||
// Quarternion components use 10 bits, so there's no risk of overflow
|
||||
// Quaternion components use 10 bits, so there's no risk of overflow
|
||||
var mtx = new int[16];
|
||||
mtx[0] = lsq - 2 * (q[1] * q[1] + q[2] * q[2]);
|
||||
mtx[1] = 2 * (q[0] * q[1] + q[2] * q[3]);
|
||||
|
||||
@@ -78,7 +78,7 @@ namespace OpenRA
|
||||
// 1 sample produces a rectangular probability
|
||||
// 2 samples produces a triangular probability
|
||||
// ...
|
||||
// N samples approximates a true gaussian
|
||||
// N samples approximates a true Gaussian
|
||||
public static WVec FromPDF(MersenneTwister r, int samples)
|
||||
{
|
||||
return new WVec(WDist.FromPDF(r, samples), WDist.FromPDF(r, samples), WDist.Zero);
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
this.targetCenter = targetCenter;
|
||||
}
|
||||
|
||||
// CanEnter(target) should to be true; othwise, Enter may abort.
|
||||
// CanEnter(target) should to be true; otherwise, Enter may abort.
|
||||
// Tries counter starts at 1 (reset every tick)
|
||||
protected virtual bool TryGetAlternateTarget(Actor self, int tries, ref Target target) { return false; }
|
||||
protected virtual bool CanReserve(Actor self) { return true; }
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace OpenRA.Mods.Common.Effects
|
||||
[Desc("Interval in ticks between each spawned Trail animation.")]
|
||||
public readonly int TrailInterval = 2;
|
||||
|
||||
[Desc("Delay in ticks until trail animaion is spawned.")]
|
||||
[Desc("Delay in ticks until trail animation is spawned.")]
|
||||
public readonly int TrailDelay = 1;
|
||||
|
||||
[PaletteReference("TrailUsePlayerPalette")] public readonly string TrailPalette = "effect";
|
||||
|
||||
@@ -514,7 +514,7 @@ namespace OpenRA.Mods.Common.Effects
|
||||
// Also, never change horizontal facing and never travel backwards
|
||||
// Possible techniques to avoid close cliffs are deceleration, turning
|
||||
// as sharply as possible to travel directly upwards and then returning
|
||||
// to zero vertical facing as low as possible while still not hittin the
|
||||
// to zero vertical facing as low as possible while still not hitting the
|
||||
// high terrain. A last technique (and the preferred one, normally used when
|
||||
// the missile hasn't been fired near a cliff) is simply finding the smallest
|
||||
// vertical facing that allows for a smooth climb to the new terrain's height
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace OpenRA.Mods.Common.Server
|
||||
{
|
||||
public class ColorValidator : ServerTrait, IClientJoined
|
||||
{
|
||||
// The bigger the color threshold, the less permitive is the algorithm
|
||||
// The bigger the color threshold, the less permissive is the algorithm
|
||||
const int ColorThreshold = 0x70;
|
||||
const byte ColorLowerBound = 0x80;
|
||||
const byte ColorHigherBound = 0xFF;
|
||||
@@ -59,7 +59,7 @@ namespace OpenRA.Mods.Common.Server
|
||||
// Reduce vector by it's biggest value (more calculations, but more accuracy too)
|
||||
var vectorMax = vector.Max(vv => Math.Abs(vv));
|
||||
if (vectorMax == 0)
|
||||
vectorMax = 1; // Avoid divison by 0
|
||||
vectorMax = 1; // Avoid division by 0
|
||||
|
||||
vector[0] /= vectorMax;
|
||||
vector[1] /= vectorMax;
|
||||
@@ -93,7 +93,7 @@ namespace OpenRA.Mods.Common.Server
|
||||
alternativeColor[1] = forbiddenColor.G + (int)(vector[1] * weightVector[1] * ii);
|
||||
alternativeColor[2] = forbiddenColor.B + (int)(vector[2] * weightVector[2] * ii);
|
||||
|
||||
// Be sure it doesnt go out of bounds (0x33 is the lower limit for HSL picker)
|
||||
// Be sure it doesn't go out of bounds (0x33 is the lower limit for HSL picker)
|
||||
alternativeColor[0] = alternativeColor[0].Clamp(ColorLowerBound, ColorHigherBound);
|
||||
alternativeColor[1] = alternativeColor[1].Clamp(ColorLowerBound, ColorHigherBound);
|
||||
alternativeColor[2] = alternativeColor[2].Clamp(ColorLowerBound, ColorHigherBound);
|
||||
|
||||
@@ -367,7 +367,7 @@ namespace OpenRA.Mods.Common.Server
|
||||
|
||||
foreach (var c in server.LobbyInfo.Clients)
|
||||
{
|
||||
// Validate if color is allowed and get an alternative it it isn't
|
||||
// Validate if color is allowed and get an alternative it isn't
|
||||
c.Color = c.PreferredColor = ColorValidator.ValidatePlayerColorAndGetAlternative(server, c.Color, c.Index, conn);
|
||||
}
|
||||
|
||||
@@ -730,7 +730,7 @@ namespace OpenRA.Mods.Common.Server
|
||||
var kickConn = server.Conns.SingleOrDefault(c => server.GetClient(c) != null && server.GetClient(c).Index == kickClientID);
|
||||
if (kickConn == null)
|
||||
{
|
||||
server.SendOrderTo(conn, "Message", "Noone in that slot.");
|
||||
server.SendOrderTo(conn, "Message", "No-one in that slot.");
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -869,7 +869,7 @@ namespace OpenRA.Mods.Common.Server
|
||||
|
||||
var newHslColor = FieldLoader.GetValue<HSLColor>("(value)", parts[1]);
|
||||
|
||||
// Validate if color is allowed and get an alternative it it isn't
|
||||
// Validate if color is allowed and get an alternative it isn't
|
||||
var altHslColor = ColorValidator.ValidatePlayerColorAndGetAlternative(server, newHslColor, targetClient.Index, conn);
|
||||
|
||||
targetClient.Color = altHslColor;
|
||||
|
||||
@@ -145,7 +145,7 @@ namespace OpenRA.Mods.Common.SpriteLoaders
|
||||
if (h.Format == Format.Format20)
|
||||
h.RefImage = headers[i - 1];
|
||||
else if (h.Format == Format.Format40 && !offsets.TryGetValue(h.RefOffset, out h.RefImage))
|
||||
throw new InvalidDataException("Reference doesnt point to image data {0}->{1}".F(h.FileOffset, h.RefOffset));
|
||||
throw new InvalidDataException("Reference doesn't point to image data {0}->{1}".F(h.FileOffset, h.RefOffset));
|
||||
}
|
||||
|
||||
shpBytesFileOffset = stream.Position;
|
||||
|
||||
@@ -137,7 +137,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
Facing = init.Contains<FacingInit>() ? init.Get<FacingInit, int>() : info.InitialFacing;
|
||||
|
||||
// TODO: HACK: This is a hack until we can properly distinquish between airplane and helicopter!
|
||||
// TODO: HACK: This is a hack until we can properly distinguish between airplane and helicopter!
|
||||
// Or until the activities get unified enough so that it doesn't matter.
|
||||
IsPlane = !info.CanHover;
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
protected override bool CanAttack(Actor self, Target target)
|
||||
{
|
||||
// dont fire while landed or when outside the map
|
||||
// Don't fire while landed or when outside the map.
|
||||
return base.CanAttack(self, target) && self.CenterPosition.Z > 0 && self.World.Map.Contains(self.Location);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
// nowhere to land, pick something friendly and circle over it.
|
||||
|
||||
// i'd prefer something we own
|
||||
// I'd prefer something we own
|
||||
var someBuilding = self.World.ActorsHavingTrait<Building>()
|
||||
.FirstOrDefault(a => a.Owner == self.Owner);
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Offset at which that the exiting actor is spawned relative to the center of the producing actor.")]
|
||||
public readonly WVec SpawnOffset = WVec.Zero;
|
||||
|
||||
[Desc("Cell offset where the exiting actor enters the ActorMap relative to the topleft cell of the producting actor.")]
|
||||
[Desc("Cell offset where the exiting actor enters the ActorMap relative to the topleft cell of the producing actor.")]
|
||||
public readonly CVec ExitCell = CVec.Zero;
|
||||
public readonly int Facing = -1;
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Overrides the IndicatorPalettePrefix.")]
|
||||
[PaletteReference] public readonly string IndicatorPalette = "";
|
||||
|
||||
[Desc("Suffixed by the interal repairing player name.")]
|
||||
[Desc("Suffixed by the internal repairing player name.")]
|
||||
public readonly string IndicatorPalettePrefix = "player";
|
||||
|
||||
public override object Create(ActorInitializer init) { return new RepairableBuilding(init.Self, this); }
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
reservedFor = forActor;
|
||||
reservedForAircraft = forAircraft;
|
||||
|
||||
// NOTE: we really dont care about the GC eating DisposableActions that apply to a world *other* than
|
||||
// NOTE: we really don't care about the GC eating DisposableActions that apply to a world *other* than
|
||||
// the one we're playing in.
|
||||
return new DisposableAction(
|
||||
() => { reservedFor = null; reservedForAircraft = null; },
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("How long (in ticks) the actor should panic for.")]
|
||||
public readonly int PanicLength = 25 * 10;
|
||||
|
||||
[Desc("Panic movement speed as a precentage of the normal speed.")]
|
||||
[Desc("Panic movement speed as a percentage of the normal speed.")]
|
||||
public readonly int PanicSpeedModifier = 200;
|
||||
|
||||
[Desc("Chance (out of 100) the unit has to enter panic mode when attacked.")]
|
||||
|
||||
@@ -12,7 +12,7 @@ using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
[Desc("The inaccuracy of this actor is multipled based on upgrade level if specified.")]
|
||||
[Desc("The inaccuracy of this actor is multiplied based on upgrade level if specified.")]
|
||||
public class InaccuracyMultiplierInfo : UpgradeMultiplierTraitInfo
|
||||
{
|
||||
public override object Create(ActorInitializer init) { return new InaccuracyMultiplier(this, init.Self.Info.Name); }
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public readonly bool SpeedUp = false;
|
||||
|
||||
[Desc("Every time another production building of the same queue is",
|
||||
"contructed, the build times of all actors in the queue",
|
||||
"constructed, the build times of all actors in the queue",
|
||||
"decreased by a percentage of the original time.")]
|
||||
public readonly int[] BuildTimeSpeedReduction = { 100, 85, 75, 65, 60, 55, 50 };
|
||||
|
||||
|
||||
@@ -69,10 +69,10 @@ namespace OpenRA.Mods.Common.Traits
|
||||
readonly Actor self;
|
||||
|
||||
// A list of things we could possibly build
|
||||
readonly Dictionary<ActorInfo, ProductionState> produceable = new Dictionary<ActorInfo, ProductionState>();
|
||||
readonly Dictionary<ActorInfo, ProductionState> producible = new Dictionary<ActorInfo, ProductionState>();
|
||||
readonly List<ProductionItem> queue = new List<ProductionItem>();
|
||||
readonly IEnumerable<ActorInfo> allProduceables;
|
||||
readonly IEnumerable<ActorInfo> buildableProduceables;
|
||||
readonly IEnumerable<ActorInfo> allProducibles;
|
||||
readonly IEnumerable<ActorInfo> buildableProducibles;
|
||||
|
||||
// Will change if the owner changes
|
||||
PowerManager playerPower;
|
||||
@@ -102,9 +102,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
Faction = init.Contains<FactionInit>() ? init.Get<FactionInit, string>() : self.Owner.Faction.InternalName;
|
||||
Enabled = !info.Factions.Any() || info.Factions.Contains(Faction);
|
||||
|
||||
CacheProduceables(playerActor);
|
||||
allProduceables = produceable.Where(a => a.Value.Buildable || a.Value.Visible).Select(a => a.Key);
|
||||
buildableProduceables = produceable.Where(a => a.Value.Buildable).Select(a => a.Key);
|
||||
CacheProducibles(playerActor);
|
||||
allProducibles = producible.Where(a => a.Value.Buildable || a.Value.Visible).Select(a => a.Key);
|
||||
buildableProducibles = producible.Where(a => a.Value.Buildable).Select(a => a.Key);
|
||||
}
|
||||
|
||||
void ClearQueue()
|
||||
@@ -131,9 +131,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
Enabled = !Info.Factions.Any() || Info.Factions.Contains(Faction);
|
||||
}
|
||||
|
||||
// Regenerate the produceables and tech tree state
|
||||
// Regenerate the producibles and tech tree state
|
||||
oldOwner.PlayerActor.Trait<TechTree>().Remove(this);
|
||||
CacheProduceables(newOwner.PlayerActor);
|
||||
CacheProducibles(newOwner.PlayerActor);
|
||||
newOwner.PlayerActor.Trait<TechTree>().Update();
|
||||
}
|
||||
|
||||
@@ -145,9 +145,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public void OnTransform(Actor self) { }
|
||||
public void AfterTransform(Actor self) { }
|
||||
|
||||
void CacheProduceables(Actor playerActor)
|
||||
void CacheProducibles(Actor playerActor)
|
||||
{
|
||||
produceable.Clear();
|
||||
producible.Clear();
|
||||
if (!Enabled)
|
||||
return;
|
||||
|
||||
@@ -157,7 +157,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
var bi = a.TraitInfo<BuildableInfo>();
|
||||
|
||||
produceable.Add(a, new ProductionState());
|
||||
producible.Add(a, new ProductionState());
|
||||
ttc.Add(a.Name, bi.Prerequisites, bi.BuildLimit, this);
|
||||
}
|
||||
}
|
||||
@@ -173,22 +173,22 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
public void PrerequisitesAvailable(string key)
|
||||
{
|
||||
produceable[self.World.Map.Rules.Actors[key]].Buildable = true;
|
||||
producible[self.World.Map.Rules.Actors[key]].Buildable = true;
|
||||
}
|
||||
|
||||
public void PrerequisitesUnavailable(string key)
|
||||
{
|
||||
produceable[self.World.Map.Rules.Actors[key]].Buildable = false;
|
||||
producible[self.World.Map.Rules.Actors[key]].Buildable = false;
|
||||
}
|
||||
|
||||
public void PrerequisitesItemHidden(string key)
|
||||
{
|
||||
produceable[self.World.Map.Rules.Actors[key]].Visible = false;
|
||||
producible[self.World.Map.Rules.Actors[key]].Visible = false;
|
||||
}
|
||||
|
||||
public void PrerequisitesItemVisible(string key)
|
||||
{
|
||||
produceable[self.World.Map.Rules.Actors[key]].Visible = true;
|
||||
producible[self.World.Map.Rules.Actors[key]].Visible = true;
|
||||
}
|
||||
|
||||
public ProductionItem CurrentItem()
|
||||
@@ -204,9 +204,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public virtual IEnumerable<ActorInfo> AllItems()
|
||||
{
|
||||
if (self.World.AllowDevCommands && developerMode.AllTech)
|
||||
return produceable.Keys;
|
||||
return producible.Keys;
|
||||
|
||||
return allProduceables;
|
||||
return allProducibles;
|
||||
}
|
||||
|
||||
public virtual IEnumerable<ActorInfo> BuildableItems()
|
||||
@@ -214,15 +214,15 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (!Enabled)
|
||||
return Enumerable.Empty<ActorInfo>();
|
||||
if (self.World.AllowDevCommands && developerMode.AllTech)
|
||||
return produceable.Keys;
|
||||
return producible.Keys;
|
||||
|
||||
return buildableProduceables;
|
||||
return buildableProducibles;
|
||||
}
|
||||
|
||||
public bool CanBuild(ActorInfo actor)
|
||||
{
|
||||
ProductionState ps;
|
||||
if (!produceable.TryGetValue(actor, out ps))
|
||||
if (!producible.TryGetValue(actor, out ps))
|
||||
return false;
|
||||
|
||||
return ps.Buildable || (self.World.AllowDevCommands && developerMode.AllTech);
|
||||
@@ -368,7 +368,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
// Returns false if the unit can't be built
|
||||
protected virtual bool BuildUnit(string name)
|
||||
{
|
||||
// Cannot produce if i'm dead
|
||||
// Cannot produce if I'm dead
|
||||
if (!self.IsInWorld || self.IsDead)
|
||||
{
|
||||
CancelProduction(name, 1);
|
||||
|
||||
@@ -90,7 +90,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
if (Holding)
|
||||
{
|
||||
// Hah! We met ths critical owned condition
|
||||
// Hah! We met this critical owned condition
|
||||
if (--TicksLeft == 0)
|
||||
mo.MarkCompleted(player, objectiveID);
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
WorldUtils.AreMutualAllies(a.Owner, currentOwner) || !CanBeCapturedBy(a));
|
||||
}
|
||||
|
||||
// TODO exclude other NeutralActor that arent permanent
|
||||
// TODO exclude other NeutralActor that aren't permanent
|
||||
bool IsStillInRange(Actor self)
|
||||
{
|
||||
return UnitsInRange().Any(a => a.Owner == self.Owner && CanBeCapturedBy(a));
|
||||
@@ -134,7 +134,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
.Where(a => a.Owner != OriginalOwner && CanBeCapturedBy(a));
|
||||
}
|
||||
|
||||
// TODO exclude other NeutralActor that arent permanent
|
||||
// TODO exclude other NeutralActor that aren't permanent
|
||||
Actor GetInRange(Actor self)
|
||||
{
|
||||
return CaptorsInRange(self).ClosestTo(self);
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Renders crates with both water and land variants.")]
|
||||
class WithCrateBodyInfo : ITraitInfo, Requires<RenderSpritesInfo>, IRenderActorPreviewSpritesInfo
|
||||
{
|
||||
[Desc("Easteregg sequences to use in december.")]
|
||||
[Desc("Easteregg sequences to use in December.")]
|
||||
public readonly string[] XmasImages = { };
|
||||
|
||||
[SequenceReference] public readonly string IdleSequence = "idle";
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (discoverer != null && !string.IsNullOrEmpty(Info.Notification))
|
||||
Game.Sound.PlayNotification(self.World.Map.Rules, discoverer, "Speech", Info.Notification, discoverer.Faction.InternalName);
|
||||
|
||||
// Radar notificaion
|
||||
// Radar notification
|
||||
if (Info.PingRadar && radarPings.Value != null)
|
||||
radarPings.Value.Add(() => true, self.CenterPosition, Color.Red, 50);
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
// Different upgradeable traits may define (a) different level ranges for the same upgrade type,
|
||||
// and (b) multiple upgrade types for the same trait. The unrestricted level for each trait is
|
||||
// tracked independently so that we can can correctly revoke levels without adding the burden of
|
||||
// tracked independently so that we can correctly revoke levels without adding the burden of
|
||||
// tracking both the overall (unclamped) and effective (clamped) levels on each individual trait.
|
||||
void NotifyUpgradeLevelChanged(IEnumerable<IUpgradable> traits, Actor self, string upgrade, int levelAdjust)
|
||||
{
|
||||
|
||||
@@ -21,10 +21,10 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Number of ticks to wait before decreasing the effective move radius.")]
|
||||
public readonly int TicksToWaitBeforeReducingMoveRadius = 5;
|
||||
|
||||
[Desc("Mimimum ammount of ticks the actor will sit idly before starting to wander.")]
|
||||
[Desc("Minimum amount of ticks the actor will sit idly before starting to wander.")]
|
||||
public readonly int MinMoveDelayInTicks = 0;
|
||||
|
||||
[Desc("Maximum ammount of ticks the actor will sit idly before starting to wander.")]
|
||||
[Desc("Maximum amount of ticks the actor will sit idly before starting to wander.")]
|
||||
public readonly int MaxMoveDelayInTicks = 0;
|
||||
|
||||
public abstract object Create(ActorInitializer init);
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
foreach (var cell in dirtyCells)
|
||||
{
|
||||
// Select all neighbors inside the map boundries
|
||||
// Select all neighbors inside the map boundaries
|
||||
var thisCell = cell; // benign closure hazard
|
||||
var neighbors = CVec.Directions.Select(d => d + thisCell)
|
||||
.Where(c => map.Contains(c));
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public readonly string Name = null;
|
||||
[Desc("Map listed indices to shadow.")]
|
||||
public readonly int[] ShadowIndex = { };
|
||||
[Desc("Apply palette rotatotors or not.")]
|
||||
[Desc("Apply palette rotators or not.")]
|
||||
public readonly bool AllowModifiers = true;
|
||||
|
||||
public object Create(ActorInitializer init) { return new PlayerPaletteFromCurrentTileset(init.World, this); }
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
public void WorldLoaded(World w, WorldRenderer wr)
|
||||
{
|
||||
// NOTE(jsd): 32 seems a sane default initial capacity for the total # of harvesters in a game. Purely a guesstimate.
|
||||
// 32 seems a sane default initial capacity for the total # of harvesters in a game. Purely a guesstimate.
|
||||
claimByCell = new Dictionary<CPos, ResourceClaim>(32);
|
||||
claimByActor = new Dictionary<Actor, ResourceClaim>(32);
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
var actorReference = new ActorReference(kv.Value.Value, kv.Value.ToDictionary());
|
||||
|
||||
// if there is no real player associated, dont spawn it.
|
||||
// If there is no real player associated, don't spawn it.
|
||||
var ownerName = actorReference.InitDict.Get<OwnerInit>().PlayerName;
|
||||
if (!world.Players.Any(p => p.InternalName == ownerName))
|
||||
continue;
|
||||
|
||||
@@ -270,7 +270,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
}
|
||||
}
|
||||
|
||||
// AttackMove was generalized to support all moveable actor types
|
||||
// AttackMove was generalized to support all movable actor types
|
||||
if (engineVersion < 20140116)
|
||||
{
|
||||
if (depth == 1 && node.Key == "AttackMove")
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
public Func<int> GetPercentage;
|
||||
public Func<bool> IsIndeterminate;
|
||||
|
||||
// Indeterminant bar properties
|
||||
// Indeterminate bar properties
|
||||
float offset = 0f;
|
||||
float tickStep = 0.04f;
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
RenderBounds.X + (RenderBounds.Width - scale * video.Width) / 2,
|
||||
RenderBounds.Y + (RenderBounds.Height - scale * video.Height * AspectRatio) / 2);
|
||||
|
||||
// Round size to integer pixels. Round up to be consistent with the scale calcuation.
|
||||
// Round size to integer pixels. Round up to be consistent with the scale calculation.
|
||||
videoSize = new float2((int)Math.Ceiling(video.Width * scale), (int)Math.Ceiling(video.Height * AspectRatio * scale));
|
||||
|
||||
if (!DrawOverlay)
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace OpenRA.Mods.D2k.Traits
|
||||
if (!spawnPointActors.Value.Any())
|
||||
return;
|
||||
|
||||
// Apparantly someone doesn't want worms or the maximum number of worms has been reached
|
||||
// Apparently someone doesn't want worms or the maximum number of worms has been reached
|
||||
if (info.Maximum < 1 || wormsPresent >= info.Maximum)
|
||||
return;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
public readonly bool ExplodeInstead = false;
|
||||
public readonly string ChronoshiftSound = "chrono2.aud";
|
||||
|
||||
[Desc("Should the actor return to its previous location after the chronoshift weared out?")]
|
||||
[Desc("Should the actor return to its previous location after the chronoshift wore out?")]
|
||||
public readonly bool ReturnToOrigin = true;
|
||||
|
||||
[Desc("The color the bar of the 'return-to-origin' logic has.")]
|
||||
|
||||
@@ -73,7 +73,7 @@ Root2:
|
||||
|
||||
// Merge order should not matter
|
||||
// Note: All the Merge* variants are different plumbing over the same
|
||||
// internal logic. Testing only MergeStrict is sufficent.
|
||||
// internal logic. Testing only MergeStrict is sufficient.
|
||||
TestMixedMerge(MiniYaml.MergeStrict(a, b).First().Value);
|
||||
TestMixedMerge(MiniYaml.MergeStrict(b, a).First().Value);
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ Tick = function()
|
||||
end
|
||||
|
||||
if harkonnen.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillHarkonnen) then
|
||||
Media.DisplayMessage("The Harkonnen have been anihilated!", "Mentat")
|
||||
Media.DisplayMessage("The Harkonnen have been annihilated!", "Mentat")
|
||||
player.MarkCompletedObjective(KillHarkonnen)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -80,7 +80,7 @@ Tick = function()
|
||||
end
|
||||
|
||||
if harkonnen.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillHarkonnen) then
|
||||
Media.DisplayMessage("The Harkonnen have been anihilated!", "Mentat")
|
||||
Media.DisplayMessage("The Harkonnen have been annihilated!", "Mentat")
|
||||
player.MarkCompletedObjective(KillHarkonnen)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -57,7 +57,7 @@ WorldLoaded = function()
|
||||
end)
|
||||
|
||||
-- Discover the area around the bridge exposing the two german soldiers
|
||||
-- When the two infantry near the bridge are discovered move them accross the bridge to waypoint4
|
||||
-- When the two infantry near the bridge are discovered move them across the bridge to waypoint4
|
||||
-- in the meanwhile one USSR soldier hunts them down
|
||||
Trigger.AfterDelay(DateTime.Seconds(1), function()
|
||||
Actor.Create("camera", true, { Owner = player, Location = waypoint23.Location })
|
||||
@@ -89,7 +89,7 @@ WorldLoaded = function()
|
||||
return
|
||||
end
|
||||
|
||||
-- Don't "shoot" at the barrels if there is noone to shoot
|
||||
-- Don't "shoot" at the barrels if there is no-one to shoot
|
||||
if not FleeingUnits[1].IsDead then
|
||||
FleeingUnits[1].Attack(Barrel, true, true)
|
||||
elseif not FleeingUnits[2].IsDead then
|
||||
|
||||
Reference in New Issue
Block a user