invuln moved to mod
This commit is contained in:
31
OpenRa.Mods.RA/Effects/InvulnEffect.cs
Normal file
31
OpenRa.Mods.RA/Effects/InvulnEffect.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using System.Collections.Generic;
|
||||
using OpenRa.Graphics;
|
||||
using OpenRa.Traits;
|
||||
using OpenRa.Effects;
|
||||
|
||||
namespace OpenRa.Mods.RA.Effects
|
||||
{
|
||||
class InvulnEffect : IEffect
|
||||
{
|
||||
Actor a;
|
||||
IronCurtainable b;
|
||||
|
||||
public InvulnEffect(Actor a)
|
||||
{
|
||||
this.a = a;
|
||||
this.b = a.traits.Get<IronCurtainable>();
|
||||
}
|
||||
|
||||
public void Tick( World world )
|
||||
{
|
||||
if (a.IsDead || b.GetDamageModifier() > 0)
|
||||
world.AddFrameEndTask(w => w.Remove(this));
|
||||
}
|
||||
|
||||
public IEnumerable<Renderable> Render()
|
||||
{
|
||||
foreach (var r in a.Render())
|
||||
yield return r.WithPalette(PaletteType.Invuln);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user