much simpler rules loader

This commit is contained in:
Chris Forbes
2010-04-01 21:31:15 +13:00
parent c5fdda9141
commit 38605faecf
16 changed files with 110 additions and 120 deletions

View File

@@ -35,23 +35,21 @@ namespace OpenRA.Mods.RA.Activities
{
if (target == null || target.IsDead) return NextActivity;
var warhead = Rules.WarheadInfo["Super"];
if (self.Owner.Stances[ target.Owner ] == Stance.Ally)
{
if (target.Health == target.Info.Traits.Get<OwnedActorInfo>().HP)
return NextActivity;
target.InflictDamage(self, -EngineerCapture.EngineerDamage, warhead);
target.InflictDamage(self, -EngineerCapture.EngineerDamage, null);
}
else
{
if (target.Health - EngineerCapture.EngineerDamage <= 0)
{
target.Owner = self.Owner;
target.InflictDamage(self, target.Health - EngineerCapture.EngineerDamage, warhead);
target.InflictDamage(self, target.Health - EngineerCapture.EngineerDamage, null);
}
else
target.InflictDamage(self, EngineerCapture.EngineerDamage, warhead);
target.InflictDamage(self, EngineerCapture.EngineerDamage, null);
}
// the engineer is sacrificed.