Capturable husks for cnc

This commit is contained in:
Paul Chote
2011-04-10 13:07:37 +12:00
parent 362170ee67
commit 715425d821
6 changed files with 70 additions and 4 deletions

View File

@@ -21,7 +21,8 @@ namespace OpenRA.Mods.RA.Activities
public readonly string ToActor = null;
public int2 Offset = new int2(0,0);
public int Facing = 96;
public string[] Sounds = {};
public string[] Sounds = {};
public int ForceHealthPercentage = 0;
public Transform(Actor self, string toActor)
{
@@ -47,10 +48,14 @@ namespace OpenRA.Mods.RA.Activities
new FacingInit( Facing ),
};
var health = self.TraitOrDefault<Health>();
// TODO: fix potential desync from HPFraction
if (health != null)
init.Add( new HealthInit( health.HPFraction ));
{
// TODO: Fix bogus health init
if (ForceHealthPercentage > 0)
init.Add( new HealthInit( ForceHealthPercentage * 1f / 100 ));
else
init.Add( new HealthInit( health.HPFraction ));
}
var a = w.CreateActor( ToActor, init );
if (selected)