add burning
This commit is contained in:
42
OpenRA.Mods.RA/Burns.cs
Normal file
42
OpenRA.Mods.RA/Burns.cs
Normal file
@@ -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<Burns>
|
||||||
|
{
|
||||||
|
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<BurnsInfo>().Anim);
|
||||||
|
self.traits.Get<RenderSimple>().anims.Add("fire",
|
||||||
|
new RenderSimple.AnimationWithOffset(anim, () => new float2(0, -3), null));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (--ticks <= 0)
|
||||||
|
{
|
||||||
|
self.InflictDamage(self, self.Info.Traits.Get<BurnsInfo>().Damage, null);
|
||||||
|
ticks = self.Info.Traits.Get<BurnsInfo>().Interval;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -54,6 +54,7 @@
|
|||||||
<Compile Include="Activities\Steal.cs" />
|
<Compile Include="Activities\Steal.cs" />
|
||||||
<Compile Include="Activities\Teleport.cs" />
|
<Compile Include="Activities\Teleport.cs" />
|
||||||
<Compile Include="AirstrikePower.cs" />
|
<Compile Include="AirstrikePower.cs" />
|
||||||
|
<Compile Include="Burns.cs" />
|
||||||
<Compile Include="C4Demolition.cs" />
|
<Compile Include="C4Demolition.cs" />
|
||||||
<Compile Include="CarpetBomb.cs" />
|
<Compile Include="CarpetBomb.cs" />
|
||||||
<Compile Include="Chronoshiftable.cs" />
|
<Compile Include="Chronoshiftable.cs" />
|
||||||
|
|||||||
@@ -924,4 +924,10 @@
|
|||||||
<sequence name="open" start="0" length="60" tick="120" src="playersmoke" />
|
<sequence name="open" start="0" length="60" tick="120" src="playersmoke" />
|
||||||
<sequence name="idle" start="60" length="32" tick="120" src="playersmoke" />
|
<sequence name="idle" start="60" length="32" tick="120" src="playersmoke" />
|
||||||
</unit>
|
</unit>
|
||||||
|
<unit name="fire">
|
||||||
|
<sequence name="1" start="0" length="15" src="fire1" />
|
||||||
|
<sequence name="2" start="0" length="15" src="fire2" />
|
||||||
|
<sequence name="3" start="0" length="15" src="fire3" />
|
||||||
|
<sequence name="4" start="0" length="15" src="fire4" />
|
||||||
|
</unit>
|
||||||
</sequences>
|
</sequences>
|
||||||
@@ -679,6 +679,7 @@ U2:
|
|||||||
Spread: 3,3
|
Spread: 3,3
|
||||||
Speed: 6
|
Speed: 6
|
||||||
AnimKey: turret
|
AnimKey: turret
|
||||||
|
Burns:
|
||||||
|
|
||||||
2TNK.Husk:
|
2TNK.Husk:
|
||||||
Inherits: ^Vehicle
|
Inherits: ^Vehicle
|
||||||
@@ -697,6 +698,7 @@ U2:
|
|||||||
Spread: 3,3
|
Spread: 3,3
|
||||||
Speed: 6
|
Speed: 6
|
||||||
AnimKey: turret
|
AnimKey: turret
|
||||||
|
Burns:
|
||||||
|
|
||||||
3TNK.Husk:
|
3TNK.Husk:
|
||||||
Inherits: ^Vehicle
|
Inherits: ^Vehicle
|
||||||
@@ -715,6 +717,7 @@ U2:
|
|||||||
Spread: 3,3
|
Spread: 3,3
|
||||||
Speed: 6
|
Speed: 6
|
||||||
AnimKey: turret
|
AnimKey: turret
|
||||||
|
Burns:
|
||||||
|
|
||||||
4TNK.Husk:
|
4TNK.Husk:
|
||||||
Inherits: ^Vehicle
|
Inherits: ^Vehicle
|
||||||
@@ -732,4 +735,5 @@ U2:
|
|||||||
Anim: turret
|
Anim: turret
|
||||||
Spread: 3,3
|
Spread: 3,3
|
||||||
Speed: 6
|
Speed: 6
|
||||||
AnimKey: turret
|
AnimKey: turret
|
||||||
|
Burns:
|
||||||
Reference in New Issue
Block a user