Simplify return statements.
Remove redundant ‘this’. Remove unused using directives. Simplify LINQ chains. Add some trait property descriptions. Add readonly where viable. Add fullstops to some yaml descriptions.
This commit is contained in:
@@ -15,8 +15,8 @@ namespace OpenRA
|
||||
{
|
||||
public class Group
|
||||
{
|
||||
Actor[] actors;
|
||||
int id;
|
||||
readonly Actor[] actors;
|
||||
readonly int id;
|
||||
|
||||
static int nextGroup;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace OpenRA.Traits
|
||||
|
||||
public class CreatesShroud : ITick, ISync
|
||||
{
|
||||
CreatesShroudInfo info;
|
||||
readonly CreatesShroudInfo info;
|
||||
[Sync] CPos cachedLocation;
|
||||
[Sync] bool cachedDisabled;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace OpenRA.Traits
|
||||
|
||||
public class DebugPauseState : ISync
|
||||
{
|
||||
World world;
|
||||
readonly World world;
|
||||
[Sync] public bool Paused { get { return world.Paused; } }
|
||||
public DebugPauseState(World world) { this.world = world; }
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace OpenRA.Traits
|
||||
|
||||
public void SetTarget(Actor self, Target target, Color c, bool display)
|
||||
{
|
||||
this.targets = new List<Target> { target };
|
||||
targets = new List<Target> { target };
|
||||
this.c = c;
|
||||
|
||||
if (display)
|
||||
|
||||
@@ -110,7 +110,7 @@ namespace OpenRA.Traits
|
||||
if (IsDead)
|
||||
return;
|
||||
|
||||
var oldState = this.DamageState;
|
||||
var oldState = DamageState;
|
||||
|
||||
// Apply any damage modifiers
|
||||
if (!ignoreModifiers && damage > 0)
|
||||
@@ -128,7 +128,7 @@ namespace OpenRA.Traits
|
||||
{
|
||||
Attacker = attacker,
|
||||
Damage = damage,
|
||||
DamageState = this.DamageState,
|
||||
DamageState = DamageState,
|
||||
PreviousDamageState = oldState,
|
||||
Warhead = warhead,
|
||||
};
|
||||
|
||||
@@ -12,7 +12,7 @@ using System;
|
||||
|
||||
namespace OpenRA.Traits
|
||||
{
|
||||
/* attributes used by RALint to understand the rules */
|
||||
/* attributes used by OpenRA.Lint to understand the rules */
|
||||
|
||||
[AttributeUsage(AttributeTargets.Field)]
|
||||
public sealed class ActorReferenceAttribute : Attribute { }
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace OpenRA.Traits
|
||||
|
||||
public class RevealsShroud : ITick, ISync
|
||||
{
|
||||
RevealsShroudInfo info;
|
||||
readonly RevealsShroudInfo info;
|
||||
[Sync] CPos cachedLocation;
|
||||
|
||||
public RevealsShroud(RevealsShroudInfo info)
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace OpenRA.Traits
|
||||
public class Selectable : IPostRenderSelection
|
||||
{
|
||||
public SelectableInfo Info;
|
||||
Actor self;
|
||||
readonly Actor self;
|
||||
|
||||
public Selectable(Actor self, SelectableInfo info)
|
||||
{
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace OpenRA.Traits
|
||||
static readonly string[] TagStrings = { "", "tag-fake", "tag-primary" };
|
||||
|
||||
public SelectionDecorationsInfo Info;
|
||||
Actor self;
|
||||
readonly Actor self;
|
||||
|
||||
public SelectionDecorations(Actor self, SelectionDecorationsInfo info)
|
||||
{
|
||||
|
||||
@@ -13,7 +13,6 @@ using System.Linq;
|
||||
using OpenRA.Effects;
|
||||
using OpenRA.GameRules;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Mods.RA;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Cnc.Effects
|
||||
|
||||
@@ -9,11 +9,8 @@
|
||||
#endregion
|
||||
|
||||
using System.Linq;
|
||||
using OpenRA.Activities;
|
||||
using OpenRA.GameRules;
|
||||
using OpenRA.Mods.Common.Traits;
|
||||
using OpenRA.Mods.RA;
|
||||
using OpenRA.Mods.RA.Traits;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Cnc.Traits
|
||||
@@ -35,7 +32,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
{
|
||||
enum PopupState { Open, Rotating, Transitioning, Closed }
|
||||
|
||||
AttackPopupTurretedInfo info;
|
||||
readonly AttackPopupTurretedInfo info;
|
||||
RenderBuilding rb;
|
||||
|
||||
int idleTicks = 0;
|
||||
@@ -72,10 +69,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!turret.FaceTarget(self, target))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
return turret.FaceTarget(self, target);
|
||||
}
|
||||
|
||||
public void TickIdle(Actor self)
|
||||
|
||||
@@ -12,9 +12,6 @@ using System.Linq;
|
||||
using OpenRA.Activities;
|
||||
using OpenRA.Mods.Common.Activities;
|
||||
using OpenRA.Mods.Common.Traits;
|
||||
using OpenRA.Mods.RA;
|
||||
using OpenRA.Mods.RA.Activities;
|
||||
using OpenRA.Mods.RA.Traits;
|
||||
using OpenRA.Primitives;
|
||||
using OpenRA.Traits;
|
||||
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
using System.Linq;
|
||||
using OpenRA.GameRules;
|
||||
using OpenRA.Mods.Common.Traits;
|
||||
using OpenRA.Mods.RA;
|
||||
using OpenRA.Mods.RA.Traits;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Cnc.Traits
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
using System.Linq;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Mods.Common.Traits;
|
||||
using OpenRA.Mods.RA.Traits;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Cnc.Traits
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#endregion
|
||||
|
||||
using OpenRA.Mods.Common.Traits;
|
||||
using OpenRA.Mods.RA.Traits;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Cnc.Traits
|
||||
@@ -26,8 +25,8 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
|
||||
public class WithDeliveryAnimation : INotifyDelivery
|
||||
{
|
||||
WithDeliveryAnimationInfo info;
|
||||
RenderBuilding building;
|
||||
readonly WithDeliveryAnimationInfo info;
|
||||
readonly RenderBuilding building;
|
||||
|
||||
public WithDeliveryAnimation(Actor self, WithDeliveryAnimationInfo info)
|
||||
{
|
||||
|
||||
@@ -15,6 +15,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("This unit can be guarded (followed and protected) by a Guard unit.")]
|
||||
public class GuardableInfo : TraitInfo<Guardable>
|
||||
{
|
||||
[Desc("Maximum range that guarding actors will maintain. Measured in cells.")]
|
||||
public readonly int Range = 2;
|
||||
}
|
||||
|
||||
|
||||
@@ -74,9 +74,8 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (!checkTransientActors)
|
||||
return SubCell.FullCell;
|
||||
|
||||
return !self.World.ActorMap.GetUnitsAt(cell)
|
||||
.Where(x => x != ignoreActor)
|
||||
.Any() ? SubCell.FullCell : SubCell.Invalid;
|
||||
return self.World.ActorMap.GetUnitsAt(cell)
|
||||
.All(x => x == ignoreActor) ? SubCell.FullCell : SubCell.Invalid;
|
||||
}
|
||||
|
||||
public bool CanEnterCell(CPos a, Actor ignoreActor = null, bool checkTransientActors = true)
|
||||
|
||||
@@ -8,12 +8,6 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using OpenRA.Effects;
|
||||
using OpenRA.Primitives;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
@@ -168,9 +168,8 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
// Sign of dot-product indicates (roughly) if vectors are facing in same or opposite directions:
|
||||
var dp = CVec.Dot(selfMobile.ToCell - self.Location, otherMobile.ToCell - other.Location);
|
||||
if (dp <= 0) return false;
|
||||
|
||||
return true;
|
||||
return dp > 0;
|
||||
}
|
||||
|
||||
public int TileSetMovementHash(TileSet tileSet)
|
||||
@@ -688,7 +687,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public MoveOrderTargeter(Actor self, MobileInfo unitType)
|
||||
{
|
||||
this.unitType = unitType;
|
||||
this.rejectMove = !self.AcceptsOrder("Move");
|
||||
rejectMove = !self.AcceptsOrder("Move");
|
||||
}
|
||||
|
||||
public string OrderID { get { return "Move"; } }
|
||||
|
||||
@@ -12,7 +12,6 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using OpenRA.Graphics;
|
||||
|
||||
namespace OpenRA.Mods.D2k.SpriteLoaders
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
|
||||
using System.Linq;
|
||||
using OpenRA.Mods.Common.Traits;
|
||||
using OpenRA.Mods.RA.Traits;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.D2k.Traits
|
||||
|
||||
@@ -101,7 +101,7 @@ namespace OpenRA.Mods.D2k.Traits
|
||||
.Where(p => p.Actor.Owner == self.Owner && !p.Trait.IsBusy && p.Actor.IsInWorld)
|
||||
.Select(h => h.Actor);
|
||||
|
||||
return WorldUtils.ClosestTo(carriers, self);
|
||||
return carriers.ClosestTo(self);
|
||||
}
|
||||
|
||||
// This gets called by carrier after we touched down
|
||||
|
||||
@@ -10,8 +10,6 @@
|
||||
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Mods.Common.Traits;
|
||||
using OpenRA.Mods.RA;
|
||||
using OpenRA.Mods.RA.Traits;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.D2k.Traits
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Mods.Common.Traits;
|
||||
using OpenRA.Mods.RA;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.D2k.Traits
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
using OpenRA.Effects;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Mods.Common.Traits;
|
||||
using OpenRA.Mods.RA.Traits;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.D2k.Traits
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
using OpenRA.Effects;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Mods.Common.Traits;
|
||||
using OpenRA.Mods.RA.Traits;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.D2k.Traits
|
||||
|
||||
@@ -12,7 +12,6 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.Mods.Common.Traits;
|
||||
using OpenRA.Mods.RA.Traits;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.D2k.Traits
|
||||
|
||||
@@ -61,9 +61,9 @@ namespace OpenRA.Mods.D2k.Traits
|
||||
public Color GetRemappedColor(Color original, int index)
|
||||
{
|
||||
return Color.FromArgb(original.A,
|
||||
(int)Exts.Clamp((int)(scale * original.R + offset), 0, 255),
|
||||
(int)Exts.Clamp((int)(scale * original.G + offset), 0, 255),
|
||||
(int)Exts.Clamp((int)(scale * original.B + offset), 0, 255));
|
||||
(int)(scale * original.R + offset).Clamp(0, 255),
|
||||
(int)(scale * original.G + offset).Clamp(0, 255),
|
||||
(int)(scale * original.B + offset).Clamp(0, 255));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,9 +10,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using OpenRA.Mods.Common.Traits;
|
||||
using OpenRA.Primitives;
|
||||
using OpenRA.Traits;
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace OpenRA.Mods.D2k.UtilityCommands
|
||||
{
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
|
||||
using OpenRA.Mods.Common.Activities;
|
||||
using OpenRA.Mods.Common.Traits;
|
||||
using OpenRA.Mods.RA.Traits;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.RA.Activities
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace OpenRA.Mods.RA.Activities
|
||||
static bool ShouldLayMine(Actor self, CPos p)
|
||||
{
|
||||
// If there is no unit (other than me) here, we want to place a mine here
|
||||
return !self.World.ActorMap.GetUnitsAt(p).Any(a => a != self);
|
||||
return self.World.ActorMap.GetUnitsAt(p).All(a => a == self);
|
||||
}
|
||||
|
||||
void LayMine(Actor self)
|
||||
|
||||
@@ -13,20 +13,19 @@ using System.Linq;
|
||||
using OpenRA.Activities;
|
||||
using OpenRA.GameRules;
|
||||
using OpenRA.Mods.Common.Traits;
|
||||
using OpenRA.Mods.RA.Traits;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.RA.Activities
|
||||
{
|
||||
class Leap : Activity
|
||||
{
|
||||
Mobile mobile;
|
||||
WeaponInfo weapon;
|
||||
readonly Mobile mobile;
|
||||
readonly WeaponInfo weapon;
|
||||
readonly int length;
|
||||
|
||||
WPos from;
|
||||
WPos to;
|
||||
int ticks;
|
||||
int length;
|
||||
WAngle angle;
|
||||
|
||||
public Leap(Actor self, Actor target, WeaponInfo weapon, WRange speed, WAngle angle)
|
||||
|
||||
@@ -23,9 +23,9 @@ namespace OpenRA.Mods.RA.Activities
|
||||
public class Teleport : Activity
|
||||
{
|
||||
const int MaxCellSearchRange = Map.MaxTilesInCircleRange;
|
||||
Actor teleporter;
|
||||
readonly Actor teleporter;
|
||||
readonly int? maximumDistance;
|
||||
CPos destination;
|
||||
int? maximumDistance;
|
||||
bool killCargo;
|
||||
bool screenFlash;
|
||||
string sound;
|
||||
|
||||
@@ -32,9 +32,9 @@ namespace OpenRA.Mods.RA.Effects
|
||||
|
||||
class GpsDot : IEffect
|
||||
{
|
||||
Actor self;
|
||||
GpsDotInfo info;
|
||||
Animation anim;
|
||||
readonly Actor self;
|
||||
readonly GpsDotInfo info;
|
||||
readonly Animation anim;
|
||||
|
||||
Lazy<HiddenUnderFog> huf;
|
||||
Lazy<FrozenUnderFog> fuf;
|
||||
|
||||
@@ -8,10 +8,8 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System.Linq;
|
||||
using OpenRA.Mods.Common.Activities;
|
||||
using OpenRA.Mods.Common.Traits;
|
||||
using OpenRA.Mods.RA.Traits;
|
||||
using OpenRA.Scripting;
|
||||
using OpenRA.Traits;
|
||||
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
#endregion
|
||||
|
||||
using System.Linq;
|
||||
using OpenRA.Mods.Common.Activities;
|
||||
using OpenRA.Mods.Common.Traits;
|
||||
using OpenRA.Mods.RA.Traits;
|
||||
using OpenRA.Scripting;
|
||||
using OpenRA.Traits;
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using OpenRA.Activities;
|
||||
using OpenRA.Mods.Common.Traits;
|
||||
using OpenRA.Mods.RA.Activities;
|
||||
using OpenRA.Traits;
|
||||
@@ -25,9 +24,9 @@ namespace OpenRA.Mods.RA.Traits
|
||||
public override object Create(ActorInitializer init) { return new AttackLeap(init.Self, this); }
|
||||
}
|
||||
|
||||
class AttackLeap : AttackFrontal, ISync
|
||||
class AttackLeap : AttackFrontal
|
||||
{
|
||||
AttackLeapInfo info;
|
||||
readonly AttackLeapInfo info;
|
||||
|
||||
public AttackLeap(Actor self, AttackLeapInfo info)
|
||||
: base(self, info)
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using OpenRA.Mods.Common.Traits;
|
||||
using OpenRA.Traits;
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
return true;
|
||||
}
|
||||
|
||||
/// Set up return-to-sender info
|
||||
// Set up return-to-sender info
|
||||
Origin = self.Location;
|
||||
ReturnTicks = duration;
|
||||
this.duration = duration;
|
||||
|
||||
@@ -25,9 +25,9 @@ namespace OpenRA.Mods.RA.Traits
|
||||
|
||||
class DisguiseToolTip : IToolTip
|
||||
{
|
||||
Actor self;
|
||||
readonly Actor self;
|
||||
readonly Disguise disguise;
|
||||
TooltipInfo info;
|
||||
Disguise disguise;
|
||||
|
||||
public DisguiseToolTip(Actor self, TooltipInfo info)
|
||||
{
|
||||
@@ -49,12 +49,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
get
|
||||
{
|
||||
if (disguise.Disguised)
|
||||
{
|
||||
if (self.Owner == self.World.LocalPlayer)
|
||||
return self.Owner;
|
||||
|
||||
return disguise.AsPlayer;
|
||||
}
|
||||
return self.Owner == self.World.LocalPlayer ? self.Owner : disguise.AsPlayer;
|
||||
|
||||
return self.Owner;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System.Linq;
|
||||
using OpenRA.Mods.Common.Traits;
|
||||
using OpenRA.Traits;
|
||||
|
||||
|
||||
@@ -8,8 +8,6 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using OpenRA.GameRules;
|
||||
using OpenRA.Mods.Common.Traits;
|
||||
using OpenRA.Traits;
|
||||
|
||||
@@ -32,9 +32,11 @@ namespace OpenRA.Mods.RA.Traits
|
||||
public readonly float2 ThumpShakeMultiplier = new float2(1, 0);
|
||||
public readonly int ThumpShakeTime = 10;
|
||||
|
||||
[Desc("Measured in ticks.")]
|
||||
public readonly int ChargeDelay = 96;
|
||||
public readonly string ChargeSound = "madchrg2.aud";
|
||||
|
||||
[Desc("Measured in ticks.")]
|
||||
public readonly int DetonationDelay = 42;
|
||||
public readonly string DetonationSound = "madexplo.aud";
|
||||
[WeaponReference]
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
|
||||
public Mine(ActorInitializer init, MineInfo info)
|
||||
{
|
||||
this.self = init.Self;
|
||||
self = init.Self;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,9 +34,9 @@ namespace OpenRA.Mods.RA.Traits
|
||||
{
|
||||
/* TODO: [Sync] when sync can cope with arrays! */
|
||||
public CPos[] Minefield = null;
|
||||
readonly Actor self;
|
||||
readonly Sprite tile;
|
||||
[Sync] CPos minefieldStart;
|
||||
Actor self;
|
||||
Sprite tile;
|
||||
|
||||
public Minelayer(Actor self)
|
||||
{
|
||||
|
||||
@@ -18,6 +18,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
[Desc("Apply palette full screen rotations during chronoshifts. Add this to the world actor.")]
|
||||
public class ChronoshiftPaletteEffectInfo : ITraitInfo
|
||||
{
|
||||
[Desc("Measured in ticks.")]
|
||||
public readonly int ChronoEffectLength = 60;
|
||||
|
||||
public object Create(ActorInitializer init) { return new ChronoshiftPaletteEffect(this); }
|
||||
@@ -25,8 +26,8 @@ namespace OpenRA.Mods.RA.Traits
|
||||
|
||||
public class ChronoshiftPaletteEffect : IPaletteModifier, ITick
|
||||
{
|
||||
readonly ChronoshiftPaletteEffectInfo info;
|
||||
int remainingFrames;
|
||||
ChronoshiftPaletteEffectInfo info;
|
||||
|
||||
public ChronoshiftPaletteEffect(ChronoshiftPaletteEffectInfo info)
|
||||
{
|
||||
|
||||
@@ -14,7 +14,6 @@ using System.Linq;
|
||||
using OpenRA.Mods.Common.Activities;
|
||||
using OpenRA.Mods.Common.Effects;
|
||||
using OpenRA.Mods.Common.Traits;
|
||||
using OpenRA.Mods.RA.Activities;
|
||||
using OpenRA.Primitives;
|
||||
using OpenRA.Traits;
|
||||
|
||||
|
||||
@@ -9,11 +9,8 @@
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.Graphics;
|
||||
|
||||
namespace OpenRA.Mods.TS.SpriteLoaders
|
||||
|
||||
@@ -41,8 +41,8 @@ namespace OpenRA.Mods.TS.Traits
|
||||
|
||||
public readonly WAngle LightPitch = WAngle.FromDegrees(50);
|
||||
public readonly WAngle LightYaw = WAngle.FromDegrees(240);
|
||||
public readonly float[] LightAmbientColor = new float[] { 0.6f, 0.6f, 0.6f };
|
||||
public readonly float[] LightDiffuseColor = new float[] { 0.4f, 0.4f, 0.4f };
|
||||
public readonly float[] LightAmbientColor = { 0.6f, 0.6f, 0.6f };
|
||||
public readonly float[] LightDiffuseColor = { 0.4f, 0.4f, 0.4f };
|
||||
|
||||
public virtual object Create(ActorInitializer init) { return new RenderVoxels(init.Self, this); }
|
||||
|
||||
@@ -63,17 +63,17 @@ namespace OpenRA.Mods.TS.Traits
|
||||
.SelectMany(rvpi => rvpi.RenderPreviewVoxels(init, this, image, orientation, facings, palette))
|
||||
.ToArray();
|
||||
|
||||
yield return new VoxelPreview(components, WVec.Zero, 0, this.Scale, this.LightPitch,
|
||||
this.LightYaw, this.LightAmbientColor, this.LightDiffuseColor, body.CameraPitch,
|
||||
yield return new VoxelPreview(components, WVec.Zero, 0, Scale, LightPitch,
|
||||
LightYaw, LightAmbientColor, LightDiffuseColor, body.CameraPitch,
|
||||
palette, init.WorldRenderer.Palette(NormalsPalette), init.WorldRenderer.Palette(ShadowPalette));
|
||||
}
|
||||
}
|
||||
|
||||
public class RenderVoxels : IRender, INotifyOwnerChanged
|
||||
{
|
||||
readonly List<VoxelAnimation> components = new List<VoxelAnimation>();
|
||||
Actor self;
|
||||
RenderVoxelsInfo info;
|
||||
List<VoxelAnimation> components = new List<VoxelAnimation>();
|
||||
IBodyOrientation body;
|
||||
WRot camera;
|
||||
WRot lightSource;
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace OpenRA.Mods.TS.Traits
|
||||
|
||||
var rv = self.Trait<RenderVoxels>();
|
||||
rv.Add(new VoxelAnimation(VoxelProvider.GetVoxel(rv.Image, info.Sequence),
|
||||
() => BarrelOffset(), () => BarrelRotation(),
|
||||
BarrelOffset, BarrelRotation,
|
||||
() => false, () => 0));
|
||||
}
|
||||
|
||||
|
||||
@@ -45,9 +45,9 @@ namespace OpenRA.Mods.TS.Traits
|
||||
|
||||
public class WithVoxelTurret
|
||||
{
|
||||
Actor self;
|
||||
Turreted turreted;
|
||||
IBodyOrientation body;
|
||||
readonly Actor self;
|
||||
readonly Turreted turreted;
|
||||
readonly IBodyOrientation body;
|
||||
|
||||
public WithVoxelTurret(Actor self, WithVoxelTurretInfo info)
|
||||
{
|
||||
@@ -58,7 +58,7 @@ namespace OpenRA.Mods.TS.Traits
|
||||
|
||||
var rv = self.Trait<RenderVoxels>();
|
||||
rv.Add(new VoxelAnimation(VoxelProvider.GetVoxel(rv.Image, info.Sequence),
|
||||
() => turreted.Position(self), () => TurretRotation(),
|
||||
() => turreted.Position(self), TurretRotation,
|
||||
() => false, () => 0));
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.FileSystem;
|
||||
|
||||
@@ -117,7 +117,7 @@ GAPOWRUP:
|
||||
Cost: 150
|
||||
Tooltip:
|
||||
Name: Power Turbine
|
||||
Description: Provides extra power generation
|
||||
Description: Provides extra power generation.
|
||||
Buildable:
|
||||
Queue: Defense
|
||||
BuildPaletteOrder: 10
|
||||
@@ -1328,7 +1328,7 @@ GAPLUG:
|
||||
Cost: 1000
|
||||
Tooltip:
|
||||
Name: GDI Upgrade Center
|
||||
Description: Can be upgraded for additional technology
|
||||
Description: Can be upgraded for additional technology.
|
||||
Selectable:
|
||||
Bounds: 115,120,0,-20
|
||||
Buildable:
|
||||
@@ -1399,7 +1399,7 @@ GAPLUG3:
|
||||
Cost: 1500
|
||||
Tooltip:
|
||||
Name: Ion Cannon Uplink
|
||||
Description: Enables use of the Ion Cannon
|
||||
Description: Enables use of the Ion Cannon.
|
||||
Buildable:
|
||||
Queue: Defense
|
||||
BuildPaletteOrder: 1000
|
||||
|
||||
Reference in New Issue
Block a user