support TrailInterval on bullets too
This commit is contained in:
@@ -28,7 +28,8 @@ namespace OpenRA.Mods.RA.Effects
|
||||
public readonly int Arm = 0;
|
||||
public readonly bool Shadow = false;
|
||||
public readonly bool Proximity = false;
|
||||
public readonly float Angle = 0;
|
||||
public readonly float Angle = 0;
|
||||
public readonly int TrailInterval = 2;
|
||||
|
||||
public IEffect Create(ProjectileArgs args) { return new Bullet( this, args ); }
|
||||
}
|
||||
@@ -81,7 +82,9 @@ namespace OpenRA.Mods.RA.Effects
|
||||
return (int)(rawFacing < 128
|
||||
? rawFacing - scale * attitude
|
||||
: rawFacing + scale * attitude);
|
||||
}
|
||||
}
|
||||
|
||||
int ticksToNextSmoke;
|
||||
|
||||
public void Tick( World world )
|
||||
{
|
||||
@@ -99,10 +102,14 @@ namespace OpenRA.Mods.RA.Effects
|
||||
|
||||
var highPos = (Info.High || Info.Angle > 0)
|
||||
? (pos - new float2(0, GetAltitude()))
|
||||
: pos;
|
||||
|
||||
world.AddFrameEndTask(w => w.Add(
|
||||
new Smoke(w, highPos.ToInt2(), Info.Trail)));
|
||||
: pos;
|
||||
|
||||
if (--ticksToNextSmoke < 0)
|
||||
{
|
||||
world.AddFrameEndTask(w => w.Add(
|
||||
new Smoke(w, highPos.ToInt2(), Info.Trail)));
|
||||
ticksToNextSmoke = Info.TrailInterval;
|
||||
}
|
||||
}
|
||||
|
||||
if (!Info.High) // check for hitting a wall
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace OpenRA.Mods.RA
|
||||
class SmokeTrailWhenDamagedInfo : ITraitInfo
|
||||
{
|
||||
public readonly int[] Offset = { 0, 0 };
|
||||
public readonly int Interval = 1;
|
||||
public readonly int Interval = 3;
|
||||
|
||||
public object Create(ActorInitializer init) { return new SmokeTrailWhenDamaged(init.self, this); }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user