Move Burns from RA to Common, move RallyPoint to Traits folder

This commit is contained in:
reaperrr
2014-11-09 16:42:31 +01:00
parent 41f3ee1080
commit 5e866b862b
4 changed files with 3 additions and 3 deletions

View File

@@ -91,7 +91,6 @@
<Compile Include="PaletteEffects\MenuPaletteEffect.cs" />
<Compile Include="PaletteEffects\NukePaletteEffect.cs" />
<Compile Include="PaletteEffects\WaterPaletteRotation.cs" />
<Compile Include="RallyPoint.cs" />
<Compile Include="ServerTraits\ColorValidator.cs" />
<Compile Include="ServerTraits\LobbyCommands.cs" />
<Compile Include="ServerTraits\LobbySettingsNotification.cs" />
@@ -99,9 +98,11 @@
<Compile Include="ServerTraits\PlayerPinger.cs" />
<Compile Include="Traits\BlocksBullets.cs" />
<Compile Include="Traits\Immobile.cs" />
<Compile Include="Traits\Burns.cs" />
<Compile Include="Traits\Demolishable.cs" />
<Compile Include="Traits\JamsMissiles.cs" />
<Compile Include="Traits\ProvidesRadar.cs" />
<Compile Include="Traits\RallyPoint.cs" />
<Compile Include="Traits\ShakeOnDeath.cs" />
<Compile Include="Traits\Power\AffectedByPowerOutage.cs" />
<Compile Include="Traits\Power\CanPowerDown.cs" />

View File

@@ -0,0 +1,51 @@
#region Copyright & License Information
/*
* Copyright 2007-2014 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
using OpenRA.Graphics;
using OpenRA.Mods.Common.Traits.Render;
using OpenRA.Traits;
namespace OpenRA.Mods.Common
{
[Desc("This actor will play a fire animation over its body and take damage over time.")]
class BurnsInfo : ITraitInfo, Requires<RenderSpritesInfo>
{
public readonly string Anim = "1";
public readonly int Damage = 1;
public readonly int Interval = 8;
public object Create(ActorInitializer init) { return new Burns(init.self, this); }
}
class Burns : ITick, ISync
{
[Sync] int ticks;
BurnsInfo Info;
public Burns(Actor self, BurnsInfo info)
{
Info = info;
var anim = new Animation(self.World, "fire", () => 0);
anim.IsDecoration = true;
anim.PlayRepeating(Info.Anim);
self.Trait<RenderSprites>().Add("fire", anim);
}
public void Tick(Actor self)
{
if (--ticks <= 0)
{
self.InflictDamage(self, Info.Damage, null);
ticks = Info.Interval;
}
}
}
}