lots of stuff: harvester, acceptsore, half-destroyed buildings, building sounds
This commit is contained in:
@@ -7,7 +7,8 @@ using IjwFramework.Types;
|
||||
using OpenRa.FileFormats;
|
||||
using OpenRa.Game.GameRules;
|
||||
using OpenRa.Game.Graphics;
|
||||
using System.Drawing;
|
||||
using System.Drawing;
|
||||
using OpenRa.Game.Traits;
|
||||
|
||||
namespace OpenRa.Game
|
||||
{
|
||||
@@ -105,10 +106,22 @@ namespace OpenRa.Game
|
||||
|
||||
Game.world.AddFrameEndTask(w => w.Remove(this));
|
||||
|
||||
if (Owner == Game.LocalPlayer)
|
||||
Game.PlaySound("unitlst1.aud", false);
|
||||
|
||||
/* todo: explosion */
|
||||
if (Owner == Game.LocalPlayer && !traits.Contains<Building>())
|
||||
Game.PlaySound("unitlst1.aud", false);
|
||||
|
||||
if (traits.Contains<Building>())
|
||||
{
|
||||
Game.PlaySound("kaboom22.aud", false);
|
||||
// todo: spawn explosion sprites
|
||||
}
|
||||
}
|
||||
|
||||
var halfStrength = unitInfo.Strength / 2;
|
||||
if (Health < halfStrength && (Health + damage) >= halfStrength)
|
||||
{
|
||||
/* we just went below half health! */
|
||||
foreach (var nd in traits.WithInterface<INotifyDamage>())
|
||||
nd.Damaged(this, DamageState.Half);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user