Replace ITraitInfo interface with TraitInfo class.
This commit is contained in:
@@ -23,7 +23,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
[Desc("Implements the special case handling for the Chronoshiftable return on a construction yard.",
|
||||
"If ReturnOriginalActorOnCondition evaluates true and the actor is not being sold then OriginalActor will be returned to the origin.",
|
||||
"Otherwise, a vortex animation is played and damage is dealt each tick, ignoring modifiers.")]
|
||||
public class ConyardChronoReturnInfo : IObservesVariablesInfo, Requires<HealthInfo>, Requires<WithSpriteBodyInfo>
|
||||
public class ConyardChronoReturnInfo : TraitInfo, Requires<HealthInfo>, Requires<WithSpriteBodyInfo>, IObservesVariablesInfo
|
||||
{
|
||||
[SequenceReference]
|
||||
[Desc("Sequence name with the baked-in vortex animation")]
|
||||
@@ -58,7 +58,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
[Desc("The color the bar of the 'return-to-origin' logic has.")]
|
||||
public readonly Color TimeBarColor = Color.White;
|
||||
|
||||
public object Create(ActorInitializer init) { return new ConyardChronoReturn(init, this); }
|
||||
public override object Create(ActorInitializer init) { return new ConyardChronoReturn(init, this); }
|
||||
}
|
||||
|
||||
public class ConyardChronoReturn : ITick, ISync, IObservesVariables, ISelectionBar, INotifySold,
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
}
|
||||
|
||||
[Desc("Provides access to the disguise command, which makes the actor appear to be another player's actor.")]
|
||||
class DisguiseInfo : ITraitInfo
|
||||
class DisguiseInfo : TraitInfo
|
||||
{
|
||||
[VoiceReference]
|
||||
public readonly string Voice = "Action";
|
||||
@@ -96,7 +96,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
[GrantedConditionReference]
|
||||
public IEnumerable<string> LinterConditions { get { return DisguisedAsConditions.Values; } }
|
||||
|
||||
public object Create(ActorInitializer init) { return new Disguise(init.Self, this); }
|
||||
public override object Create(ActorInitializer init) { return new Disguise(init.Self, this); }
|
||||
}
|
||||
|
||||
class Disguise : IEffectiveOwner, IIssueOrder, IResolveOrder, IOrderVoice, IRadarColorModifier, INotifyAttack,
|
||||
|
||||
@@ -19,9 +19,9 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
using FrozenActorAction = Action<FrozenUnderFogUpdatedByGps, FrozenActorLayer, GpsWatcher, FrozenActor>;
|
||||
|
||||
[Desc("Updates frozen actors of actors that change owners, are sold or die whilst having an active GPS power.")]
|
||||
public class FrozenUnderFogUpdatedByGpsInfo : ITraitInfo, Requires<FrozenUnderFogInfo>
|
||||
public class FrozenUnderFogUpdatedByGpsInfo : TraitInfo, Requires<FrozenUnderFogInfo>
|
||||
{
|
||||
public object Create(ActorInitializer init) { return new FrozenUnderFogUpdatedByGps(init); }
|
||||
public override object Create(ActorInitializer init) { return new FrozenUnderFogUpdatedByGps(init); }
|
||||
}
|
||||
|
||||
public class FrozenUnderFogUpdatedByGps : INotifyOwnerChanged, INotifyActorDisposing, IOnGpsRefreshed
|
||||
|
||||
@@ -15,7 +15,7 @@ using OpenRA.Traits;
|
||||
namespace OpenRA.Mods.Cnc.Traits
|
||||
{
|
||||
[Desc("Show an indicator revealing the actor underneath the fog when a GPSWatcher is activated.")]
|
||||
class GpsDotInfo : ITraitInfo
|
||||
class GpsDotInfo : TraitInfo
|
||||
{
|
||||
[Desc("Sprite collection for symbols.")]
|
||||
public readonly string Image = "gpsdot";
|
||||
@@ -27,7 +27,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
[PaletteReference(true)]
|
||||
public readonly string IndicatorPalettePrefix = "player";
|
||||
|
||||
public object Create(ActorInitializer init) { return new GpsDot(this); }
|
||||
public override object Create(ActorInitializer init) { return new GpsDot(this); }
|
||||
}
|
||||
|
||||
class GpsDot : INotifyCreated, INotifyAddedToWorld, INotifyRemovedFromWorld
|
||||
|
||||
@@ -17,9 +17,9 @@ using OpenRA.Traits;
|
||||
namespace OpenRA.Mods.Cnc.Traits
|
||||
{
|
||||
[Desc("Required for `GpsPower`. Attach this to the player actor.")]
|
||||
class GpsWatcherInfo : ITraitInfo
|
||||
class GpsWatcherInfo : TraitInfo
|
||||
{
|
||||
public object Create(ActorInitializer init) { return new GpsWatcher(init.Self.Owner); }
|
||||
public override object Create(ActorInitializer init) { return new GpsWatcher(init.Self.Owner); }
|
||||
}
|
||||
|
||||
interface IOnGpsRefreshed { void OnGpsRefresh(Actor self, Player player); }
|
||||
|
||||
@@ -14,13 +14,13 @@ using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Cnc.Traits
|
||||
{
|
||||
public class HarvesterHuskModifierInfo : ITraitInfo, Requires<HarvesterInfo>
|
||||
public class HarvesterHuskModifierInfo : TraitInfo, Requires<HarvesterInfo>
|
||||
{
|
||||
[ActorReference]
|
||||
public readonly string FullHuskActor = null;
|
||||
public readonly int FullnessThreshold = 50;
|
||||
|
||||
public object Create(ActorInitializer init) { return new HarvesterHuskModifier(this); }
|
||||
public override object Create(ActorInitializer init) { return new HarvesterHuskModifier(this); }
|
||||
}
|
||||
|
||||
public class HarvesterHuskModifier : IHuskModifier
|
||||
|
||||
@@ -18,7 +18,7 @@ using OpenRA.Traits;
|
||||
namespace OpenRA.Mods.Cnc.Traits
|
||||
{
|
||||
[Desc("Funds are transferred from the owner to the infiltrator.")]
|
||||
class InfiltrateForCashInfo : ITraitInfo
|
||||
class InfiltrateForCashInfo : TraitInfo
|
||||
{
|
||||
[Desc("The `TargetTypes` from `Targetable` that are allowed to enter.")]
|
||||
public readonly BitSet<TargetableType> Types = default(BitSet<TargetableType>);
|
||||
@@ -44,7 +44,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
[Desc("Whether to show the cash tick indicators rising from the actor.")]
|
||||
public readonly bool ShowTicks = true;
|
||||
|
||||
public object Create(ActorInitializer init) { return new InfiltrateForCash(this); }
|
||||
public override object Create(ActorInitializer init) { return new InfiltrateForCash(this); }
|
||||
}
|
||||
|
||||
class InfiltrateForCash : INotifyInfiltrated
|
||||
|
||||
@@ -17,7 +17,7 @@ using OpenRA.Traits;
|
||||
namespace OpenRA.Mods.Cnc.Traits
|
||||
{
|
||||
[Desc("Steal and reset the owner's exploration.")]
|
||||
class InfiltrateForExplorationInfo : ITraitInfo
|
||||
class InfiltrateForExplorationInfo : TraitInfo
|
||||
{
|
||||
[Desc("The `TargetTypes` from `Targetable` that are allowed to enter.")]
|
||||
public readonly BitSet<TargetableType> Types = default(BitSet<TargetableType>);
|
||||
@@ -30,7 +30,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
[Desc("Sound the perpetrator will hear after successful infiltration.")]
|
||||
public readonly string InfiltrationNotification = null;
|
||||
|
||||
public object Create(ActorInitializer init) { return new InfiltrateForExploration(init.Self, this); }
|
||||
public override object Create(ActorInitializer init) { return new InfiltrateForExploration(init.Self, this); }
|
||||
}
|
||||
|
||||
class InfiltrateForExploration : INotifyInfiltrated
|
||||
|
||||
@@ -15,7 +15,7 @@ using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Cnc.Traits
|
||||
{
|
||||
class InfiltrateForPowerOutageInfo : ITraitInfo
|
||||
class InfiltrateForPowerOutageInfo : TraitInfo
|
||||
{
|
||||
[Desc("The `TargetTypes` from `Targetable` that are allowed to enter.")]
|
||||
public readonly BitSet<TargetableType> Types = default(BitSet<TargetableType>);
|
||||
@@ -31,7 +31,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
[Desc("Sound the perpetrator will hear after successful infiltration.")]
|
||||
public readonly string InfiltrationNotification = null;
|
||||
|
||||
public object Create(ActorInitializer init) { return new InfiltrateForPowerOutage(init.Self, this); }
|
||||
public override object Create(ActorInitializer init) { return new InfiltrateForPowerOutage(init.Self, this); }
|
||||
}
|
||||
|
||||
class InfiltrateForPowerOutage : INotifyOwnerChanged, INotifyInfiltrated
|
||||
|
||||
@@ -15,7 +15,7 @@ using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Cnc.Traits
|
||||
{
|
||||
class InfiltrateForSupportPowerInfo : ITraitInfo
|
||||
class InfiltrateForSupportPowerInfo : TraitInfo
|
||||
{
|
||||
[ActorReference]
|
||||
[FieldLoader.Require]
|
||||
@@ -32,7 +32,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
[Desc("Sound the perpetrator will hear after successful infiltration.")]
|
||||
public readonly string InfiltrationNotification = null;
|
||||
|
||||
public object Create(ActorInitializer init) { return new InfiltrateForSupportPower(this); }
|
||||
public override object Create(ActorInitializer init) { return new InfiltrateForSupportPower(this); }
|
||||
}
|
||||
|
||||
class InfiltrateForSupportPower : INotifyInfiltrated
|
||||
|
||||
@@ -16,7 +16,7 @@ using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Cnc.Traits
|
||||
{
|
||||
class InfiltrateForSupportPowerResetInfo : ITraitInfo
|
||||
class InfiltrateForSupportPowerResetInfo : TraitInfo
|
||||
{
|
||||
[Desc("The `TargetTypes` from `Targetable` that are allowed to enter.")]
|
||||
public readonly BitSet<TargetableType> Types = default(BitSet<TargetableType>);
|
||||
@@ -29,7 +29,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
[Desc("Sound the perpetrator will hear after successful infiltration.")]
|
||||
public readonly string InfiltrationNotification = null;
|
||||
|
||||
public object Create(ActorInitializer init) { return new InfiltrateForSupportPowerReset(this); }
|
||||
public override object Create(ActorInitializer init) { return new InfiltrateForSupportPowerReset(this); }
|
||||
}
|
||||
|
||||
class InfiltrateForSupportPowerReset : INotifyInfiltrated
|
||||
|
||||
@@ -19,7 +19,7 @@ using OpenRA.Traits;
|
||||
namespace OpenRA.Mods.Cnc.Traits
|
||||
{
|
||||
[Desc("Transform into a different actor type.")]
|
||||
class InfiltrateForTransformInfo : ITraitInfo
|
||||
class InfiltrateForTransformInfo : TraitInfo
|
||||
{
|
||||
[ActorReference]
|
||||
[FieldLoader.Require]
|
||||
@@ -32,7 +32,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
[Desc("The `TargetTypes` from `Targetable` that are allowed to enter.")]
|
||||
public readonly BitSet<TargetableType> Types = default(BitSet<TargetableType>);
|
||||
|
||||
public object Create(ActorInitializer init) { return new InfiltrateForTransform(init, this); }
|
||||
public override object Create(ActorInitializer init) { return new InfiltrateForTransform(init, this); }
|
||||
}
|
||||
|
||||
class InfiltrateForTransform : INotifyInfiltrated
|
||||
|
||||
@@ -23,7 +23,7 @@ using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Cnc.Traits
|
||||
{
|
||||
class MadTankInfo : ITraitInfo, IRulesetLoaded, Requires<ExplodesInfo>, Requires<WithFacingSpriteBodyInfo>
|
||||
class MadTankInfo : TraitInfo, IRulesetLoaded, Requires<ExplodesInfo>, Requires<WithFacingSpriteBodyInfo>
|
||||
{
|
||||
[SequenceReference]
|
||||
public readonly string ThumpSequence = "piston";
|
||||
@@ -63,7 +63,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
[Desc("Types of damage that this trait causes to self while self-destructing. Leave empty for no damage types.")]
|
||||
public readonly BitSet<DamageType> DamageTypes = default(BitSet<DamageType>);
|
||||
|
||||
public object Create(ActorInitializer init) { return new MadTank(init.Self, this); }
|
||||
public override object Create(ActorInitializer init) { return new MadTank(init.Self, this); }
|
||||
|
||||
public void RulesetLoaded(Ruleset rules, ActorInfo ai)
|
||||
{
|
||||
|
||||
@@ -15,14 +15,14 @@ using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Cnc.Traits
|
||||
{
|
||||
class MineInfo : ITraitInfo
|
||||
class MineInfo : TraitInfo
|
||||
{
|
||||
public readonly BitSet<CrushClass> CrushClasses = default(BitSet<CrushClass>);
|
||||
public readonly bool AvoidFriendly = true;
|
||||
public readonly bool BlockFriendly = true;
|
||||
public readonly BitSet<CrushClass> DetonateClasses = default(BitSet<CrushClass>);
|
||||
|
||||
public object Create(ActorInitializer init) { return new Mine(this); }
|
||||
public override object Create(ActorInitializer init) { return new Mine(this); }
|
||||
}
|
||||
|
||||
class Mine : ICrushable, INotifyCrushed
|
||||
|
||||
@@ -21,7 +21,7 @@ using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Cnc.Traits
|
||||
{
|
||||
public class MinelayerInfo : ITraitInfo, Requires<RearmableInfo>
|
||||
public class MinelayerInfo : TraitInfo, Requires<RearmableInfo>
|
||||
{
|
||||
[ActorReference]
|
||||
public readonly string Mine = "minv";
|
||||
@@ -43,7 +43,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
[Desc("Sprite overlay to use for minefield cells hidden behind fog or shroud.")]
|
||||
public readonly string TileUnknownName = "build-unknown";
|
||||
|
||||
public object Create(ActorInitializer init) { return new Minelayer(init.Self, this); }
|
||||
public override object Create(ActorInitializer init) { return new Minelayer(init.Self, this); }
|
||||
}
|
||||
|
||||
public class Minelayer : IIssueOrder, IResolveOrder, ISync, IIssueDeployOrder, IOrderVoice, ITick
|
||||
|
||||
@@ -16,12 +16,12 @@ using OpenRA.Traits;
|
||||
namespace OpenRA.Mods.Cnc.Traits
|
||||
{
|
||||
[Desc("Apply palette full screen rotations during chronoshifts. Add this to the world actor.")]
|
||||
public class ChronoshiftPaletteEffectInfo : ITraitInfo
|
||||
public class ChronoshiftPaletteEffectInfo : TraitInfo
|
||||
{
|
||||
[Desc("Measured in ticks.")]
|
||||
public readonly int ChronoEffectLength = 60;
|
||||
|
||||
public object Create(ActorInitializer init) { return new ChronoshiftPaletteEffect(this); }
|
||||
public override object Create(ActorInitializer init) { return new ChronoshiftPaletteEffect(this); }
|
||||
}
|
||||
|
||||
public class ChronoshiftPaletteEffect : IPaletteModifier, ITick
|
||||
|
||||
@@ -16,7 +16,7 @@ using OpenRA.Traits;
|
||||
namespace OpenRA.Mods.Cnc.Traits
|
||||
{
|
||||
[Desc("Palette effect used for blinking \"animations\" on actors.")]
|
||||
class LightPaletteRotatorInfo : ITraitInfo
|
||||
class LightPaletteRotatorInfo : TraitInfo
|
||||
{
|
||||
[Desc("Palettes this effect should not apply to.")]
|
||||
public readonly HashSet<string> ExcludePalettes = new HashSet<string>();
|
||||
@@ -30,7 +30,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
[Desc("Palette indices to rotate through.")]
|
||||
public readonly int[] RotationIndices = { 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 238, 237, 236, 235, 234, 233, 232, 231 };
|
||||
|
||||
public object Create(ActorInitializer init) { return new LightPaletteRotator(this); }
|
||||
public override object Create(ActorInitializer init) { return new LightPaletteRotator(this); }
|
||||
}
|
||||
|
||||
class LightPaletteRotator : ITick, IPaletteModifier
|
||||
|
||||
@@ -20,7 +20,7 @@ using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Cnc.Traits
|
||||
{
|
||||
class PortableChronoInfo : ITraitInfo, Requires<IMoveInfo>
|
||||
class PortableChronoInfo : TraitInfo, Requires<IMoveInfo>
|
||||
{
|
||||
[Desc("Cooldown in ticks until the unit can teleport.")]
|
||||
public readonly int ChargeDelay = 500;
|
||||
@@ -55,7 +55,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
[VoiceReference]
|
||||
public readonly string Voice = "Action";
|
||||
|
||||
public object Create(ActorInitializer init) { return new PortableChrono(init.Self, this); }
|
||||
public override object Create(ActorInitializer init) { return new PortableChrono(init.Self, this); }
|
||||
}
|
||||
|
||||
class PortableChrono : IIssueOrder, IResolveOrder, ITick, ISelectionBar, IOrderVoice, ISync
|
||||
|
||||
@@ -18,7 +18,7 @@ using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Cnc.Traits
|
||||
{
|
||||
public class WithBuildingBibInfo : ITraitInfo, Requires<BuildingInfo>, IRenderActorPreviewSpritesInfo, IActorPreviewInitInfo, Requires<RenderSpritesInfo>
|
||||
public class WithBuildingBibInfo : TraitInfo, Requires<BuildingInfo>, IRenderActorPreviewSpritesInfo, IActorPreviewInitInfo, Requires<RenderSpritesInfo>
|
||||
{
|
||||
[SequenceReference]
|
||||
public readonly string Sequence = "bib";
|
||||
@@ -28,7 +28,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
|
||||
public readonly bool HasMinibib = false;
|
||||
|
||||
public object Create(ActorInitializer init) { return new WithBuildingBib(init.Self, this); }
|
||||
public override object Create(ActorInitializer init) { return new WithBuildingBib(init.Self, this); }
|
||||
|
||||
public IEnumerable<IActorPreview> RenderPreviewSprites(ActorPreviewInitializer init, RenderSpritesInfo rs, string image, int facings, PaletteReference p)
|
||||
{
|
||||
|
||||
@@ -21,7 +21,7 @@ using OpenRA.Traits;
|
||||
namespace OpenRA.Mods.Cnc.Traits.Render
|
||||
{
|
||||
[Desc("Renders the cargo loaded into the unit.")]
|
||||
public class WithCargoInfo : ITraitInfo, Requires<CargoInfo>, Requires<BodyOrientationInfo>
|
||||
public class WithCargoInfo : TraitInfo, Requires<CargoInfo>, Requires<BodyOrientationInfo>
|
||||
{
|
||||
[Desc("Cargo position relative to turret or body in (forward, right, up) triples. The default offset should be in the middle of the list.")]
|
||||
public readonly WVec[] LocalOffset = { WVec.Zero };
|
||||
@@ -29,7 +29,7 @@ namespace OpenRA.Mods.Cnc.Traits.Render
|
||||
[Desc("Passenger CargoType to display.")]
|
||||
public readonly HashSet<string> DisplayTypes = new HashSet<string>();
|
||||
|
||||
public object Create(ActorInitializer init) { return new WithCargo(init.Self, this); }
|
||||
public override object Create(ActorInitializer init) { return new WithCargo(init.Self, this); }
|
||||
}
|
||||
|
||||
public class WithCargo : ITick, IRender, INotifyPassengerEntered, INotifyPassengerExited
|
||||
|
||||
@@ -17,7 +17,7 @@ using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Cnc.Traits.Render
|
||||
{
|
||||
public class WithLandingCraftAnimationInfo : ITraitInfo, Requires<IMoveInfo>, Requires<WithSpriteBodyInfo>, Requires<CargoInfo>
|
||||
public class WithLandingCraftAnimationInfo : TraitInfo, Requires<IMoveInfo>, Requires<WithSpriteBodyInfo>, Requires<CargoInfo>
|
||||
{
|
||||
public readonly HashSet<string> OpenTerrainTypes = new HashSet<string> { "Clear" };
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace OpenRA.Mods.Cnc.Traits.Render
|
||||
[Desc("Which sprite body to play the animation on.")]
|
||||
public readonly string Body = "body";
|
||||
|
||||
public object Create(ActorInitializer init) { return new WithLandingCraftAnimation(init, this); }
|
||||
public override object Create(ActorInitializer init) { return new WithLandingCraftAnimation(init, this); }
|
||||
}
|
||||
|
||||
public class WithLandingCraftAnimation : ITick
|
||||
|
||||
@@ -16,12 +16,12 @@ using OpenRA.Traits;
|
||||
namespace OpenRA.Mods.Cnc.Traits.Render
|
||||
{
|
||||
[Desc("Provides an overlay for the Tiberian Dawn hover craft.")]
|
||||
public class WithRoofInfo : ITraitInfo, Requires<RenderSpritesInfo>
|
||||
public class WithRoofInfo : TraitInfo, Requires<RenderSpritesInfo>
|
||||
{
|
||||
[SequenceReference]
|
||||
public readonly string Sequence = "roof";
|
||||
|
||||
public object Create(ActorInitializer init) { return new WithRoof(init.Self, this); }
|
||||
public override object Create(ActorInitializer init) { return new WithRoof(init.Self, this); }
|
||||
}
|
||||
|
||||
public class WithRoof
|
||||
|
||||
@@ -16,7 +16,7 @@ using OpenRA.Traits;
|
||||
namespace OpenRA.Mods.Cnc.Traits.Render
|
||||
{
|
||||
[Desc("This actor displays a charge-up animation before firing.")]
|
||||
public class WithTeslaChargeAnimationInfo : ITraitInfo, Requires<WithSpriteBodyInfo>, Requires<RenderSpritesInfo>
|
||||
public class WithTeslaChargeAnimationInfo : TraitInfo, Requires<WithSpriteBodyInfo>, Requires<RenderSpritesInfo>
|
||||
{
|
||||
[SequenceReference]
|
||||
[Desc("Sequence to use for charge animation.")]
|
||||
@@ -25,7 +25,7 @@ namespace OpenRA.Mods.Cnc.Traits.Render
|
||||
[Desc("Which sprite body to play the animation on.")]
|
||||
public readonly string Body = "body";
|
||||
|
||||
public object Create(ActorInitializer init) { return new WithTeslaChargeAnimation(init, this); }
|
||||
public override object Create(ActorInitializer init) { return new WithTeslaChargeAnimation(init, this); }
|
||||
}
|
||||
|
||||
public class WithTeslaChargeAnimation : INotifyTeslaCharging
|
||||
|
||||
@@ -17,7 +17,7 @@ using OpenRA.Traits;
|
||||
namespace OpenRA.Mods.Cnc.Traits.Render
|
||||
{
|
||||
[Desc("Rendered together with AttackCharge.")]
|
||||
public class WithTeslaChargeOverlayInfo : ITraitInfo, Requires<RenderSpritesInfo>
|
||||
public class WithTeslaChargeOverlayInfo : TraitInfo, Requires<RenderSpritesInfo>
|
||||
{
|
||||
[SequenceReference]
|
||||
[Desc("Sequence name to use")]
|
||||
@@ -30,7 +30,7 @@ namespace OpenRA.Mods.Cnc.Traits.Render
|
||||
[Desc("Custom palette is a player palette BaseName")]
|
||||
public readonly bool IsPlayerPalette = false;
|
||||
|
||||
public object Create(ActorInitializer init) { return new WithTeslaChargeOverlay(init, this); }
|
||||
public override object Create(ActorInitializer init) { return new WithTeslaChargeOverlay(init, this); }
|
||||
}
|
||||
|
||||
public class WithTeslaChargeOverlay : INotifyTeslaCharging, INotifyDamageStateChanged, INotifySold
|
||||
|
||||
@@ -21,7 +21,7 @@ using OpenRA.Traits;
|
||||
namespace OpenRA.Mods.Cnc.Traits.Render
|
||||
{
|
||||
// TODO: This trait is hacky and should go away as soon as we support granting a condition on docking, in favor of toggling two regular WithVoxelBodies
|
||||
public class WithVoxelUnloadBodyInfo : ITraitInfo, IRenderActorPreviewVoxelsInfo, Requires<RenderVoxelsInfo>
|
||||
public class WithVoxelUnloadBodyInfo : TraitInfo, IRenderActorPreviewVoxelsInfo, Requires<RenderVoxelsInfo>
|
||||
{
|
||||
[Desc("Voxel sequence name to use when docked to a refinery.")]
|
||||
public readonly string UnloadSequence = "unload";
|
||||
@@ -32,7 +32,7 @@ namespace OpenRA.Mods.Cnc.Traits.Render
|
||||
[Desc("Defines if the Voxel should have a shadow.")]
|
||||
public readonly bool ShowShadow = true;
|
||||
|
||||
public object Create(ActorInitializer init) { return new WithVoxelUnloadBody(init.Self, this); }
|
||||
public override object Create(ActorInitializer init) { return new WithVoxelUnloadBody(init.Self, this); }
|
||||
|
||||
public IEnumerable<ModelAnimation> RenderPreviewVoxels(
|
||||
ActorPreviewInitializer init, RenderVoxelsInfo rv, string image, Func<WRot> orientation, int facings, PaletteReference p)
|
||||
|
||||
@@ -20,7 +20,7 @@ using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Cnc.Traits.Render
|
||||
{
|
||||
public class WithVoxelWalkerBodyInfo : ITraitInfo, IRenderActorPreviewVoxelsInfo, Requires<RenderVoxelsInfo>, Requires<IMoveInfo>, Requires<IFacingInfo>
|
||||
public class WithVoxelWalkerBodyInfo : TraitInfo, IRenderActorPreviewVoxelsInfo, Requires<RenderVoxelsInfo>, Requires<IMoveInfo>, Requires<IFacingInfo>
|
||||
{
|
||||
public readonly string Sequence = "idle";
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace OpenRA.Mods.Cnc.Traits.Render
|
||||
|
||||
[Desc("Defines if the Voxel should have a shadow.")]
|
||||
public readonly bool ShowShadow = true;
|
||||
public object Create(ActorInitializer init) { return new WithVoxelWalkerBody(init.Self, this); }
|
||||
public override object Create(ActorInitializer init) { return new WithVoxelWalkerBody(init.Self, this); }
|
||||
|
||||
public IEnumerable<ModelAnimation> RenderPreviewVoxels(
|
||||
ActorPreviewInitializer init, RenderVoxelsInfo rv, string image, Func<WRot> orientation, int facings, PaletteReference p)
|
||||
|
||||
@@ -19,7 +19,7 @@ using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Cnc.Traits
|
||||
{
|
||||
public class TDGunboatInfo : ITraitInfo, IPositionableInfo, IFacingInfo, IMoveInfo, IActorPreviewInitInfo
|
||||
public class TDGunboatInfo : TraitInfo, IPositionableInfo, IFacingInfo, IMoveInfo, IActorPreviewInitInfo
|
||||
{
|
||||
public readonly int Speed = 28;
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
[Desc("Facing to use for actor previews (map editor, color picker, etc). Only 64 and 192 supported.")]
|
||||
public readonly int PreviewFacing = 64;
|
||||
|
||||
public virtual object Create(ActorInitializer init) { return new TDGunboat(init, this); }
|
||||
public override object Create(ActorInitializer init) { return new TDGunboat(init, this); }
|
||||
|
||||
public int GetInitialFacing() { return InitialFacing; }
|
||||
|
||||
|
||||
@@ -18,13 +18,13 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
[Desc("A special case trait that re-grants a timed external condition when this actor transforms.",
|
||||
"This trait does not work with permanently granted external conditions.",
|
||||
"This trait changes the external condition source, so cannot be used for conditions that may later be revoked")]
|
||||
public class TransferTimedExternalConditionOnTransformInfo : ITraitInfo, Requires<TransformsInfo>
|
||||
public class TransferTimedExternalConditionOnTransformInfo : TraitInfo, Requires<TransformsInfo>
|
||||
{
|
||||
[FieldLoader.Require]
|
||||
[Desc("External condition to transfer")]
|
||||
public readonly string Condition = null;
|
||||
|
||||
public object Create(ActorInitializer init) { return new TransferTimedExternalConditionOnTransform(this); }
|
||||
public override object Create(ActorInitializer init) { return new TransferTimedExternalConditionOnTransform(this); }
|
||||
}
|
||||
|
||||
public class TransferTimedExternalConditionOnTransform : IConditionTimerWatcher, INotifyTransform
|
||||
|
||||
@@ -19,7 +19,7 @@ using OpenRA.Traits;
|
||||
namespace OpenRA.Mods.Cnc.Traits
|
||||
{
|
||||
[Desc("Adds the hard-coded shroud palette to the game")]
|
||||
class ShroudPaletteInfo : ITraitInfo
|
||||
class ShroudPaletteInfo : TraitInfo
|
||||
{
|
||||
[PaletteDefinition]
|
||||
[FieldLoader.Require]
|
||||
@@ -29,7 +29,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
[Desc("Palette type")]
|
||||
public readonly bool Fog = false;
|
||||
|
||||
public object Create(ActorInitializer init) { return new ShroudPalette(this); }
|
||||
public override object Create(ActorInitializer init) { return new ShroudPalette(this); }
|
||||
}
|
||||
|
||||
class ShroudPalette : ILoadsPalettes, IProvidesAssetBrowserPalettes
|
||||
|
||||
@@ -19,14 +19,14 @@ using OpenRA.Traits;
|
||||
namespace OpenRA.Mods.Cnc.Traits
|
||||
{
|
||||
[Desc("Adds the hard-coded shroud palette to the game")]
|
||||
class TSShroudPaletteInfo : ITraitInfo
|
||||
class TSShroudPaletteInfo : TraitInfo
|
||||
{
|
||||
[PaletteDefinition]
|
||||
[FieldLoader.Require]
|
||||
[Desc("Internal palette name")]
|
||||
public readonly string Name = "shroud";
|
||||
|
||||
public object Create(ActorInitializer init) { return new TSShroudPalette(this); }
|
||||
public override object Create(ActorInitializer init) { return new TSShroudPalette(this); }
|
||||
}
|
||||
|
||||
class TSShroudPalette : ILoadsPalettes, IProvidesAssetBrowserPalettes
|
||||
|
||||
@@ -15,7 +15,7 @@ using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Cnc.Traits
|
||||
{
|
||||
public class VoxelNormalsPaletteInfo : ITraitInfo
|
||||
public class VoxelNormalsPaletteInfo : TraitInfo
|
||||
{
|
||||
[PaletteDefinition]
|
||||
public readonly string Name = "normals";
|
||||
@@ -23,7 +23,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
[Desc("Can be TiberianSun or RedAlert2")]
|
||||
public readonly NormalType Type = NormalType.TiberianSun;
|
||||
|
||||
public object Create(ActorInitializer init) { return new VoxelNormalsPalette(this); }
|
||||
public override object Create(ActorInitializer init) { return new VoxelNormalsPalette(this); }
|
||||
}
|
||||
|
||||
public class VoxelNormalsPalette : ILoadsPalettes
|
||||
|
||||
Reference in New Issue
Block a user