diff --git a/OpenRA.Mods.RA/Burns.cs b/OpenRA.Mods.RA/Burns.cs new file mode 100644 index 0000000000..f82b8108e0 --- /dev/null +++ b/OpenRA.Mods.RA/Burns.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using OpenRA.Traits; +using OpenRA.Graphics; + +namespace OpenRA.Mods.RA +{ + class BurnsInfo : TraitInfo + { + public readonly string Anim = "1"; + public readonly int Damage = 1; + public readonly int Interval = 8; + } + + class Burns : ITick + { + [Sync] + int ticks; + bool isSetup; + + public void Tick(Actor self) + { + if (!isSetup) + { + isSetup = true; + + var anim = new Animation("fire", () => 0); + anim.PlayRepeating(self.Info.Traits.Get().Anim); + self.traits.Get().anims.Add("fire", + new RenderSimple.AnimationWithOffset(anim, () => new float2(0, -3), null)); + } + + if (--ticks <= 0) + { + self.InflictDamage(self, self.Info.Traits.Get().Damage, null); + ticks = self.Info.Traits.Get().Interval; + } + } + } +} diff --git a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj index 89e63b3087..730b003ee6 100644 --- a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj +++ b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj @@ -54,6 +54,7 @@ + diff --git a/mods/ra/sequences.xml b/mods/ra/sequences.xml index 36f65aab89..9c3c9521a7 100644 --- a/mods/ra/sequences.xml +++ b/mods/ra/sequences.xml @@ -924,4 +924,10 @@ + + + + + + \ No newline at end of file diff --git a/mods/ra/vehicles.yaml b/mods/ra/vehicles.yaml index 6ba8bb4b01..865f81416f 100644 --- a/mods/ra/vehicles.yaml +++ b/mods/ra/vehicles.yaml @@ -679,6 +679,7 @@ U2: Spread: 3,3 Speed: 6 AnimKey: turret + Burns: 2TNK.Husk: Inherits: ^Vehicle @@ -697,6 +698,7 @@ U2: Spread: 3,3 Speed: 6 AnimKey: turret + Burns: 3TNK.Husk: Inherits: ^Vehicle @@ -715,6 +717,7 @@ U2: Spread: 3,3 Speed: 6 AnimKey: turret + Burns: 4TNK.Husk: Inherits: ^Vehicle @@ -732,4 +735,5 @@ U2: Anim: turret Spread: 3,3 Speed: 6 - AnimKey: turret \ No newline at end of file + AnimKey: turret + Burns: \ No newline at end of file