Files
OpenRA/OpenRa.Game/Traits/Unit.cs
Chris Forbes 409a48b22a more
2010-01-10 13:06:39 +13:00

31 lines
641 B
C#
Executable File

using OpenRa.Game.GameRules;
namespace OpenRa.Game.Traits
{
class UnitInfo : ITraitInfo
{
public readonly int HP = 0;
public readonly ArmorType Armor = ArmorType.none;
public readonly bool Crewed = false; // replace with trait?
public object Create(Actor self) { return new Unit(self); }
}
class Unit : INotifyDamage
{
[Sync]
public int Facing;
[Sync]
public int Altitude;
public Unit( Actor self ) { }
public void Damaged(Actor self, AttackInfo e)
{
if (e.DamageState == DamageState.Dead)
if (self.Owner == Game.LocalPlayer)
Sound.Play("unitlst1.aud");
}
}
}