submarines are forced to the surface on damage

This commit is contained in:
Chris Forbes
2009-12-20 18:06:40 +13:00
parent 14e27df197
commit b08e1e9350
2 changed files with 12 additions and 9 deletions

View File

@@ -4,19 +4,22 @@ using OpenRa.Game.Graphics;
namespace OpenRa.Game.Traits namespace OpenRa.Game.Traits
{ {
class Submarine : IRenderModifier, INotifyAttack, ITick class Submarine : IRenderModifier, INotifyAttack, ITick, INotifyDamage
{ {
int remainingSurfaceTime = 2; /* setup for initial dive */ int remainingSurfaceTime = 2; /* setup for initial dive */
public Submarine(Actor self) { } public Submarine(Actor self) { }
public void Attacking(Actor self) void DoSurface()
{ {
if (remainingSurfaceTime <= 0) if (remainingSurfaceTime <= 0)
OnSurface(); OnSurface();
remainingSurfaceTime = (int)(Rules.General.SubmergeDelay * 60 * 25); remainingSurfaceTime = (int)(Rules.General.SubmergeDelay * 60 * 25);
} }
public void Attacking(Actor self) { DoSurface(); }
public void Damaged(Actor self, AttackInfo e) { DoSurface(); }
public IEnumerable<Tuple<Sprite, float2, int>> public IEnumerable<Tuple<Sprite, float2, int>>
ModifyRender(Actor self, IEnumerable<Tuple<Sprite, float2, int>> rs) ModifyRender(Actor self, IEnumerable<Tuple<Sprite, float2, int>> rs)
@@ -46,5 +49,5 @@ namespace OpenRa.Game.Traits
{ {
Sound.Play("subshow1.aud"); /* is this the right sound?? */ Sound.Play("subshow1.aud"); /* is this the right sound?? */
} }
} }
} }

View File

@@ -42,7 +42,7 @@ Planes
Ships Ships
CA Works CA Works
SS Doesn't surface on damage SS Works
DD AA weapon doesn't work, depth charges don't work DD AA weapon doesn't work, depth charges don't work
PT depth charges don't work PT depth charges don't work
LST Cargo doesn't work LST Cargo doesn't work