much simpler rules loader
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -36,8 +36,8 @@ namespace OpenRA.Mods.RA.Activities
|
||||
public IActivity Tick(Actor self)
|
||||
{
|
||||
if (target == null || target.IsDead) return NextActivity;
|
||||
self.World.AddFrameEndTask(w => w.Add(new DelayedAction(25*2,
|
||||
() => target.InflictDamage(self, target.Health, Rules.WarheadInfo["DemolishWarhead"]))));
|
||||
self.World.AddFrameEndTask(w => w.Add(new DelayedAction(25 * 2,
|
||||
() => target.InflictDamage(self, target.Health, null))));
|
||||
return NextActivity;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.Effects;
|
||||
using OpenRA.Traits;
|
||||
using OpenRA.Traits.Activities;
|
||||
|
||||
namespace OpenRA.Mods.RA
|
||||
{
|
||||
@@ -50,14 +51,8 @@ namespace OpenRA.Mods.RA
|
||||
return;
|
||||
|
||||
var info = self.Info.Traits.Get<MineInfo>();
|
||||
var warhead = Rules.WarheadInfo[info.Warhead];
|
||||
|
||||
self.World.AddFrameEndTask(w =>
|
||||
{
|
||||
w.Remove(self);
|
||||
w.Add(new Explosion(w, self.CenterLocation.ToInt2(), warhead.Explosion, false));
|
||||
crusher.InflictDamage(crusher, info.Damage, warhead);
|
||||
});
|
||||
Combat.DoExplosion(self, info.Warhead, self.CenterLocation.ToInt2(), 0);
|
||||
self.QueueActivity(new RemoveSelf());
|
||||
}
|
||||
|
||||
public bool IsPathableCrush(UnitMovementType umt, Player player)
|
||||
|
||||
Reference in New Issue
Block a user