check for missing sequence entries using lint
This commit is contained in:
@@ -24,6 +24,8 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Chance (out of 100) the unit has to enter panic mode when attacked.")]
|
||||
public readonly int AttackPanicChance = 20;
|
||||
|
||||
[SequenceReference(null, true)] public readonly string PanicSequencePrefix = "panic-";
|
||||
|
||||
public object Create(ActorInitializer init) { return new ScaredyCat(init.Self, this); }
|
||||
}
|
||||
|
||||
@@ -36,7 +38,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
bool Panicking { get { return panicStartedTick > 0; } }
|
||||
|
||||
public bool IsModifyingSequence { get { return Panicking; } }
|
||||
public string SequencePrefix { get { return "panic-"; } }
|
||||
public string SequencePrefix { get { return info.PanicSequencePrefix; } }
|
||||
|
||||
public ScaredyCat(Actor self, ScaredyCatInfo info)
|
||||
{
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
public readonly WVec ProneOffset = new WVec(85, 0, -171);
|
||||
|
||||
public readonly string ProneSequencePrefix = "prone-";
|
||||
[SequenceReference(null, true)] public readonly string ProneSequencePrefix = "prone-";
|
||||
|
||||
public override object Create(ActorInitializer init) { return new TakeCover(init, this); }
|
||||
|
||||
|
||||
@@ -19,16 +19,20 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("If we land on invalid terrain for my actor type should we be killed?")]
|
||||
public readonly bool KilledOnImpassableTerrain = true;
|
||||
|
||||
[Desc("Group where Ground/WaterCorpseSequence is looked up.")]
|
||||
public readonly string CorpseSequenceCollection = "explosion";
|
||||
|
||||
public readonly string GroundImpactSound = null;
|
||||
public readonly string GroundCorpseSequence = "corpse";
|
||||
[SequenceReference("CorpseSequenceCollection")] public readonly string GroundCorpseSequence = "corpse";
|
||||
public readonly string GroundCorpsePalette = "effect";
|
||||
|
||||
public readonly string WaterImpactSound = null;
|
||||
public readonly string WaterCorpseSequence = "small_splash";
|
||||
[SequenceReference("CorpseSequenceCollection")] public readonly string WaterCorpseSequence = null;
|
||||
public readonly string WaterCorpsePalette = "effect";
|
||||
|
||||
[Desc("Requires the sub-sequences \"open\" and \"idle\".")]
|
||||
public readonly string ParachuteSequence = null;
|
||||
[SequenceReference("ParachuteSequence")] public readonly string ParachuteOpenSequence = null;
|
||||
[SequenceReference("ParachuteSequence")] public readonly string ParachuteIdleSequence = null;
|
||||
|
||||
[Desc("Optional, otherwise defaults to the palette the actor is using.")]
|
||||
public readonly string ParachutePalette = null;
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public class RenderBuildingChargeInfo : RenderBuildingInfo
|
||||
{
|
||||
[Desc("Sequence to use for building charge animation.")]
|
||||
public readonly string ChargeSequence = "active";
|
||||
[SequenceReference] public readonly string ChargeSequence = "active";
|
||||
|
||||
public override object Create(ActorInitializer init) { return new RenderBuildingCharge(init, this); }
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
public readonly string[] ImagesByFullness = { "harv" };
|
||||
|
||||
public readonly string HarvestSequence = "harvest";
|
||||
[SequenceReference("ImagesByFullness")] public readonly string HarvestSequence = "harvest";
|
||||
|
||||
public override object Create(ActorInitializer init) { return new RenderHarvester(init, this); }
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Basic render trait for immobile actors. Deprecated, use RenderSprites + WithSpriteBody instead.")]
|
||||
public class RenderSimpleInfo : RenderSpritesInfo, IRenderActorPreviewSpritesInfo, IQuantizeBodyOrientationInfo, Requires<IBodyOrientationInfo>
|
||||
{
|
||||
public readonly string Sequence = "idle";
|
||||
[SequenceReference] public readonly string Sequence = "idle";
|
||||
|
||||
public override object Create(ActorInitializer init) { return new RenderSimple(init, this); }
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
public string GetImage(ActorInfo actor, SequenceProvider sequenceProvider, string race)
|
||||
{
|
||||
if (RaceImages != null)
|
||||
if (RaceImages != null && !string.IsNullOrEmpty(race))
|
||||
{
|
||||
string raceImage = null;
|
||||
if (RaceImages.TryGetValue(race, out raceImage) && sequenceProvider.HasSequence(raceImage))
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public class WithActiveAnimationInfo : ITraitInfo, Requires<RenderBuildingInfo>
|
||||
{
|
||||
[Desc("Sequence name to use")]
|
||||
public readonly string Sequence = "active";
|
||||
[SequenceReference] public readonly string Sequence = "active";
|
||||
|
||||
public readonly int Interval = 750;
|
||||
|
||||
|
||||
@@ -20,13 +20,13 @@ namespace OpenRA.Mods.RA.Traits
|
||||
public readonly string Armament = "primary";
|
||||
|
||||
[Desc("Displayed while attacking.")]
|
||||
public readonly string AttackSequence = null;
|
||||
[SequenceReference] public readonly string AttackSequence = null;
|
||||
|
||||
[Desc("Displayed while targeting.")]
|
||||
public readonly string AimSequence = null;
|
||||
[SequenceReference] public readonly string AimSequence = null;
|
||||
|
||||
[Desc("Shown while reloading.")]
|
||||
public readonly string ReloadPrefix = null;
|
||||
[SequenceReference(null, true)] public readonly string ReloadPrefix = null;
|
||||
|
||||
public object Create(ActorInitializer init) { return new WithAttackAnimation(init, this); }
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
class WithBarrelInfo : ITraitInfo, IRenderActorPreviewSpritesInfo, Requires<RenderSpritesInfo>, Requires<IBodyOrientationInfo>
|
||||
{
|
||||
[Desc("Sequence name to use")]
|
||||
public readonly string Sequence = "barrel";
|
||||
[SequenceReference] public readonly string Sequence = "barrel";
|
||||
|
||||
[Desc("Armament to use for recoil")]
|
||||
public readonly string Armament = "primary";
|
||||
|
||||
@@ -18,8 +18,11 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Display explosions over the building footprint when it is destroyed.")]
|
||||
class WithBuildingExplosionInfo : ITraitInfo, Requires<BuildingInfo>
|
||||
{
|
||||
[Desc("Group where Sequence is looked up.")]
|
||||
public readonly string SequenceCollection = "explosion";
|
||||
|
||||
[Desc("Explosion sequence name to use")]
|
||||
public readonly string Sequence = "building";
|
||||
[SequenceReference("SequenceCollection")] public readonly string Sequence = "building";
|
||||
|
||||
[Desc("Delay the explosions by this many ticks.")]
|
||||
public readonly int Delay = 0;
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public class WithBuildingPlacedAnimationInfo : ITraitInfo, Requires<RenderSimpleInfo>
|
||||
{
|
||||
[Desc("Sequence name to use")]
|
||||
public readonly string Sequence = "build";
|
||||
[SequenceReference] public readonly string Sequence = "build";
|
||||
|
||||
public object Create(ActorInitializer init) { return new WithBuildingPlacedAnimation(init.Self, this); }
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public class WithBuildingPlacedOverlayInfo : ITraitInfo, Requires<RenderSpritesInfo>, Requires<IBodyOrientationInfo>
|
||||
{
|
||||
[Desc("Sequence name to use")]
|
||||
public readonly string Sequence = "crane-overlay";
|
||||
[SequenceReference] public readonly string Sequence = "crane-overlay";
|
||||
|
||||
[Desc("Position relative to body")]
|
||||
public readonly WVec Offset = WVec.Zero;
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public class WithChargeOverlayInfo : ITraitInfo, Requires<RenderSpritesInfo>
|
||||
{
|
||||
[Desc("Sequence name to use")]
|
||||
public readonly string Sequence = "active";
|
||||
[SequenceReference] public readonly string Sequence = "active";
|
||||
|
||||
[Desc("Custom palette name")]
|
||||
public readonly string Palette = null;
|
||||
|
||||
@@ -23,12 +23,16 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Easteregg sequences to use in december.")]
|
||||
public readonly string[] XmasImages = { };
|
||||
|
||||
[SequenceReference] public readonly string IdleSequence = "idle";
|
||||
public readonly string WaterSequence = null;
|
||||
public readonly string LandSequence = null;
|
||||
|
||||
public object Create(ActorInitializer init) { return new WithCrateBody(init.Self, this); }
|
||||
|
||||
public IEnumerable<IActorPreview> RenderPreviewSprites(ActorPreviewInitializer init, RenderSpritesInfo rs, string image, int facings, PaletteReference p)
|
||||
{
|
||||
var anim = new Animation(init.World, rs.Image, () => 0);
|
||||
anim.PlayRepeating(RenderSprites.NormalizeSequence(anim, init.GetDamageState(), "idle"));
|
||||
anim.PlayRepeating(RenderSprites.NormalizeSequence(anim, init.GetDamageState(), IdleSequence));
|
||||
yield return new SpriteActorPreview(anim, WVec.Zero, 0, p, rs.Scale);
|
||||
}
|
||||
|
||||
@@ -39,22 +43,27 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
readonly Actor self;
|
||||
readonly Animation anim;
|
||||
readonly WithCrateBodyInfo info;
|
||||
|
||||
public WithCrateBody(Actor self, WithCrateBodyInfo info)
|
||||
{
|
||||
this.self = self;
|
||||
this.info = info;
|
||||
|
||||
var rs = self.Trait<RenderSprites>();
|
||||
var image = rs.GetImage(self);
|
||||
var images = info.XmasImages.Any() && DateTime.Today.Month == 12 ? info.XmasImages : new[] { image };
|
||||
|
||||
anim = new Animation(self.World, images.Random(Game.CosmeticRandom));
|
||||
anim.Play("idle");
|
||||
anim.Play(info.IdleSequence);
|
||||
rs.Add(anim);
|
||||
}
|
||||
|
||||
public void OnLanded()
|
||||
{
|
||||
var seq = self.World.Map.GetTerrainInfo(self.Location).IsWater ? "water" : "land";
|
||||
anim.PlayRepeating(seq);
|
||||
var sequence = self.World.Map.GetTerrainInfo(self.Location).IsWater ? info.WaterSequence : info.LandSequence;
|
||||
if (!string.IsNullOrEmpty(sequence))
|
||||
anim.PlayRepeating(sequence);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("This actor has a death animation.")]
|
||||
public class WithDeathAnimationInfo : ITraitInfo, Requires<RenderSpritesInfo>
|
||||
{
|
||||
[Desc("Sequence to play when this actor is killed by a warhead.")]
|
||||
public readonly string DeathSequence = "die";
|
||||
[Desc("Sequence prefix to play when this actor is killed by a warhead.")]
|
||||
[SequenceReference(null, true)] public readonly string DeathSequence = "die";
|
||||
|
||||
[Desc("The palette used for `DeathSequence`.")]
|
||||
public readonly string DeathSequencePalette = "player";
|
||||
@@ -29,10 +29,10 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public readonly bool DeathPaletteIsPlayerPalette = true;
|
||||
|
||||
[Desc("Should DeathType-specific sequences be used (sequence name = DeathSequence + DeathType).")]
|
||||
public readonly bool UseDeathTypeSuffix = true;
|
||||
public readonly bool UseDeathTypeSuffix = true; // TODO: check the complete sequence with lint rules
|
||||
|
||||
[Desc("Sequence to play when this actor is crushed.")]
|
||||
public readonly string CrushedSequence = "die-crushed";
|
||||
[SequenceReference] public readonly string CrushedSequence = null;
|
||||
|
||||
[Desc("The palette used for `CrushedSequence`.")]
|
||||
public readonly string CrushedSequencePalette = "effect";
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public class WithDockingOverlayInfo : ITraitInfo, Requires<RenderSpritesInfo>, Requires<IBodyOrientationInfo>
|
||||
{
|
||||
[Desc("Sequence name to use")]
|
||||
public readonly string Sequence = "docking-overlay";
|
||||
[SequenceReference] public readonly string Sequence = "docking-overlay";
|
||||
|
||||
[Desc("Position relative to body")]
|
||||
public readonly WVec Offset = WVec.Zero;
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
class WithHarvestAnimationInfo : ITraitInfo, Requires<RenderSpritesInfo>, Requires<IBodyOrientationInfo>
|
||||
{
|
||||
[Desc("Sequence name to use")]
|
||||
public readonly string Sequence = "harvest";
|
||||
[SequenceReference] public readonly string Sequence = "harvest";
|
||||
|
||||
[Desc("Position relative to body")]
|
||||
public readonly WVec Offset = WVec.Zero;
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public class WithIdleOverlayInfo : UpgradableTraitInfo, ITraitInfo, IRenderActorPreviewSpritesInfo, Requires<RenderSpritesInfo>, Requires<IBodyOrientationInfo>
|
||||
{
|
||||
[Desc("Sequence name to use")]
|
||||
public readonly string Sequence = "idle-overlay";
|
||||
[SequenceReference] public readonly string Sequence = "idle-overlay";
|
||||
|
||||
[Desc("Position relative to body")]
|
||||
public readonly WVec Offset = WVec.Zero;
|
||||
|
||||
@@ -21,10 +21,11 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
public readonly int MinIdleWaitTicks = 30;
|
||||
public readonly int MaxIdleWaitTicks = 110;
|
||||
public readonly string MoveSequence = "run";
|
||||
public readonly string AttackSequence = "shoot";
|
||||
public readonly string[] IdleSequences = { };
|
||||
public readonly string[] StandSequences = { "stand" };
|
||||
|
||||
[SequenceReference] public readonly string MoveSequence = "run";
|
||||
[SequenceReference] public readonly string AttackSequence = null;
|
||||
[SequenceReference] public readonly string[] IdleSequences = { };
|
||||
[SequenceReference] public readonly string[] StandSequences = { "stand" };
|
||||
|
||||
public virtual object Create(ActorInitializer init) { return new WithInfantryBody(init, this); }
|
||||
|
||||
@@ -93,9 +94,11 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
public void Attacking(Actor self, Target target)
|
||||
{
|
||||
state = AnimationState.Attacking;
|
||||
if (DefaultAnimation.HasSequence(NormalizeInfantrySequence(self, Info.AttackSequence)))
|
||||
if (!string.IsNullOrEmpty(Info.AttackSequence) && DefaultAnimation.HasSequence(NormalizeInfantrySequence(self, Info.AttackSequence)))
|
||||
{
|
||||
state = AnimationState.Attacking;
|
||||
DefaultAnimation.PlayThen(NormalizeInfantrySequence(self, Info.AttackSequence), () => state = AnimationState.Idle);
|
||||
}
|
||||
}
|
||||
|
||||
public void Attacking(Actor self, Target target, Armament a, Barrel barrel)
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public class WithMakeAnimationInfo : ITraitInfo, Requires<BuildingInfo>, Requires<RenderBuildingInfo>
|
||||
{
|
||||
[Desc("Sequence name to use")]
|
||||
public readonly string Sequence = "make";
|
||||
[SequenceReference] public readonly string Sequence = "make";
|
||||
|
||||
public object Create(ActorInitializer init) { return new WithMakeAnimation(init, this); }
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public class WithMoveAnimationInfo : ITraitInfo, Requires<WithFacingSpriteBodyInfo>, Requires<IMoveInfo>
|
||||
{
|
||||
[Desc("Displayed while moving.")]
|
||||
public readonly string MoveSequence = "move";
|
||||
[SequenceReference] public readonly string MoveSequence = "move";
|
||||
|
||||
public object Create(ActorInitializer init) { return new WithMoveAnimation(init, this); }
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public class WithProductionOverlayInfo : ITraitInfo, Requires<RenderSpritesInfo>, Requires<IBodyOrientationInfo>
|
||||
{
|
||||
[Desc("Sequence name to use")]
|
||||
public readonly string Sequence = "production-overlay";
|
||||
[SequenceReference] public readonly string Sequence = "production-overlay";
|
||||
|
||||
[Desc("Position relative to body")]
|
||||
public readonly WVec Offset = WVec.Zero;
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public class WithRepairAnimationInfo : ITraitInfo, Requires<RenderBuildingInfo>
|
||||
{
|
||||
[Desc("Sequence name to use")]
|
||||
public readonly string Sequence = "active";
|
||||
[SequenceReference] public readonly string Sequence = "active";
|
||||
|
||||
public readonly bool PauseOnLowPower = false;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public class WithRepairOverlayInfo : ITraitInfo, Requires<RenderSpritesInfo>, Requires<IBodyOrientationInfo>
|
||||
{
|
||||
[Desc("Sequence name to use")]
|
||||
public readonly string Sequence = "active";
|
||||
[SequenceReference] public readonly string Sequence = "active";
|
||||
|
||||
[Desc("Position relative to body")]
|
||||
public readonly WVec Offset = WVec.Zero;
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
class WithResourcesInfo : ITraitInfo, Requires<RenderSimpleInfo>
|
||||
{
|
||||
[Desc("Sequence name to use")]
|
||||
public readonly string Sequence = "resources";
|
||||
[SequenceReference] public readonly string Sequence = "resources";
|
||||
|
||||
public object Create(ActorInitializer init) { return new WithResources(init.Self, this); }
|
||||
}
|
||||
|
||||
@@ -20,10 +20,10 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public class WithRotorInfo : ITraitInfo, IRenderActorPreviewSpritesInfo, Requires<RenderSpritesInfo>, Requires<IBodyOrientationInfo>
|
||||
{
|
||||
[Desc("Sequence name to use when flying")]
|
||||
public readonly string Sequence = "rotor";
|
||||
[SequenceReference] public readonly string Sequence = "rotor";
|
||||
|
||||
[Desc("Sequence name to use when landed")]
|
||||
public readonly string GroundSequence = "slow-rotor";
|
||||
[SequenceReference] public readonly string GroundSequence = "slow-rotor";
|
||||
|
||||
[Desc("Position relative to body")]
|
||||
public readonly WVec Offset = WVec.Zero;
|
||||
|
||||
@@ -16,19 +16,26 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Renders an overlay when the actor is taking heavy damage.")]
|
||||
public class WithSmokeInfo : ITraitInfo, Requires<RenderSpritesInfo>
|
||||
{
|
||||
[Desc("Needs to define \"idle\", \"loop\" and \"end\" sub-sequences.")]
|
||||
public readonly string Sequence = "smoke_m";
|
||||
|
||||
[SequenceReference("Sequence")] public readonly string IdleSequence = "idle";
|
||||
[SequenceReference("Sequence")] public readonly string LoopSequence = "loop";
|
||||
[SequenceReference("Sequence")] public readonly string EndSequence = "end";
|
||||
|
||||
public object Create(ActorInitializer init) { return new WithSmoke(init.Self, this); }
|
||||
}
|
||||
|
||||
public class WithSmoke : INotifyDamage
|
||||
{
|
||||
readonly WithSmokeInfo info;
|
||||
readonly Animation anim;
|
||||
|
||||
bool isSmoking;
|
||||
Animation anim;
|
||||
|
||||
public WithSmoke(Actor self, WithSmokeInfo info)
|
||||
{
|
||||
this.info = info;
|
||||
|
||||
var rs = self.Trait<RenderSprites>();
|
||||
|
||||
anim = new Animation(self.World, info.Sequence);
|
||||
@@ -42,9 +49,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (e.DamageState < DamageState.Heavy) return;
|
||||
|
||||
isSmoking = true;
|
||||
anim.PlayThen("idle",
|
||||
() => anim.PlayThen("loop",
|
||||
() => anim.PlayBackwardsThen("end",
|
||||
anim.PlayThen(info.IdleSequence,
|
||||
() => anim.PlayThen(info.LoopSequence,
|
||||
() => anim.PlayBackwardsThen(info.EndSequence,
|
||||
() => isSmoking = false)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,10 +21,10 @@ namespace OpenRA.Mods.Common.Traits
|
||||
Requires<RenderSpritesInfo>
|
||||
{
|
||||
[Desc("Animation to play when the actor is created.")]
|
||||
public readonly string StartSequence = null;
|
||||
[SequenceReference] public readonly string StartSequence = null;
|
||||
|
||||
[Desc("Animation to play when the actor is idle.")]
|
||||
public readonly string Sequence = "idle";
|
||||
[SequenceReference] public readonly string Sequence = "idle";
|
||||
|
||||
public virtual object Create(ActorInitializer init) { return new WithSpriteBody(init, this); }
|
||||
|
||||
|
||||
@@ -21,10 +21,10 @@ namespace OpenRA.Mods.Common.Traits
|
||||
Requires<RenderSpritesInfo>, Requires<TurretedInfo>, Requires<IBodyOrientationInfo>
|
||||
{
|
||||
[Desc("Sequence name to use")]
|
||||
public readonly string Sequence = "turret";
|
||||
[SequenceReference] public readonly string Sequence = "turret";
|
||||
|
||||
[Desc("Sequence name to use when prepared to fire")]
|
||||
public readonly string AimSequence = null;
|
||||
[SequenceReference] public readonly string AimSequence = null;
|
||||
|
||||
[Desc("Turreted 'Turret' key to display")]
|
||||
public readonly string Turret = "primary";
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public readonly WVec Offset = WVec.Zero;
|
||||
public readonly int Interval = 3;
|
||||
public readonly string Sprite = "smokey";
|
||||
[SequenceReference("Sprite")] public readonly string Sequence = "idle";
|
||||
public readonly string Palette = "effect";
|
||||
public readonly DamageState MinDamage = DamageState.Heavy;
|
||||
|
||||
@@ -46,7 +47,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
var offset = info.Offset.Rotate(body.QuantizeOrientation(self, self.Orientation));
|
||||
var pos = position + body.LocalToWorld(offset);
|
||||
self.World.AddFrameEndTask(w => w.Add(new Smoke(w, pos, info.Sprite, info.Palette)));
|
||||
self.World.AddFrameEndTask(w => w.Add(new Smoke(w, pos, info.Sprite, info.Palette, info.Sequence)));
|
||||
}
|
||||
|
||||
ticks = info.Interval;
|
||||
|
||||
@@ -28,6 +28,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
[Desc("Sprite sequence name")]
|
||||
public readonly string SmokeType = "smoke_m";
|
||||
[SequenceReference("SmokeType")] public readonly string SmokeSequence = "idle";
|
||||
|
||||
public readonly string SmokePalette = "effect";
|
||||
|
||||
@@ -99,7 +100,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public void AddSmudge(CPos loc)
|
||||
{
|
||||
if (Game.CosmeticRandom.Next(0, 100) <= Info.SmokePercentage)
|
||||
world.AddFrameEndTask(w => w.Add(new Smoke(w, world.Map.CenterOfCell(loc), Info.SmokeType, Info.SmokePalette)));
|
||||
world.AddFrameEndTask(w => w.Add(new Smoke(w, world.Map.CenterOfCell(loc), Info.SmokeType, Info.SmokePalette, Info.SmokeSequence)));
|
||||
|
||||
if (!dirty.ContainsKey(loc) && !tiles.ContainsKey(loc))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user