Make smoke trail palette customisable, add player color trail support to bullets & missiles
This commit is contained in:
@@ -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";
|
||||
public readonly string Palette = "effect";
|
||||
public readonly DamageState MinDamage = DamageState.Heavy;
|
||||
|
||||
public object Create(ActorInitializer init) { return new SmokeTrailWhenDamaged(init.Self, this); }
|
||||
@@ -45,7 +46,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)));
|
||||
self.World.AddFrameEndTask(w => w.Add(new Smoke(w, pos, info.Sprite, info.Palette)));
|
||||
}
|
||||
|
||||
ticks = info.Interval;
|
||||
|
||||
@@ -29,6 +29,8 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Sprite sequence name")]
|
||||
public readonly string SmokeType = "smoke_m";
|
||||
|
||||
public readonly string SmokePalette = "effect";
|
||||
|
||||
public readonly string Palette = "terrain";
|
||||
|
||||
public object Create(ActorInitializer init) { return new SmudgeLayer(this); }
|
||||
@@ -86,7 +88,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)));
|
||||
world.AddFrameEndTask(w => w.Add(new Smoke(w, world.Map.CenterOfCell(loc), Info.SmokeType, Info.SmokePalette)));
|
||||
|
||||
if (!dirty.ContainsKey(loc) && !tiles.ContainsKey(loc))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user