fixing up engineer behavior
This commit is contained in:
@@ -129,6 +129,10 @@ namespace OpenRa.Game
|
|||||||
Game.LocalPlayer.IsReady ? "ready" : "not ready") { IsImmediate = true });
|
Game.LocalPlayer.IsReady ? "ready" : "not ready") { IsImmediate = true });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* temporary hack: DO NOT LEAVE IN */
|
||||||
|
if (e.KeyCode == Keys.F2)
|
||||||
|
Game.LocalPlayer = Game.players[(Game.LocalPlayer.Index + 1) % 4];
|
||||||
|
|
||||||
if (!Game.chat.isChatting)
|
if (!Game.chat.isChatting)
|
||||||
if (e.KeyCode >= Keys.D0 && e.KeyCode <= Keys.D9)
|
if (e.KeyCode >= Keys.D0 && e.KeyCode <= Keys.D9)
|
||||||
Game.controller.DoControlGroup( (int)e.KeyCode - (int)Keys.D0, (Modifiers)(int)e.Modifiers );
|
Game.controller.DoControlGroup( (int)e.KeyCode - (int)Keys.D0, (Modifiers)(int)e.Modifiers );
|
||||||
|
|||||||
@@ -21,19 +21,21 @@ namespace OpenRa.Game.Traits.Activities
|
|||||||
{
|
{
|
||||||
if (target.Health == target.Info.Strength)
|
if (target.Health == target.Info.Strength)
|
||||||
return NextActivity;
|
return NextActivity;
|
||||||
target.Health += EngineerCapture.EngineerDamage;
|
target.InflictDamage(self, -EngineerCapture.EngineerDamage, Rules.WarheadInfo["Super"]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
target.Health -= EngineerCapture.EngineerDamage;
|
if (target.Health - EngineerCapture.EngineerDamage <= 0)
|
||||||
if (target.Health <= 0)
|
|
||||||
{
|
{
|
||||||
target.Owner = self.Owner;
|
target.Owner = self.Owner;
|
||||||
target.Health = EngineerCapture.EngineerDamage;
|
target.InflictDamage(self, target.Health - EngineerCapture.EngineerDamage, Rules.WarheadInfo["Super"]);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
target.InflictDamage(self, EngineerCapture.EngineerDamage, Rules.WarheadInfo["Super"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// the engineer is sacrificed.
|
// the engineer is sacrificed.
|
||||||
|
self.Health = 0;
|
||||||
Game.world.AddFrameEndTask(w => w.Remove(self));
|
Game.world.AddFrameEndTask(w => w.Remove(self));
|
||||||
|
|
||||||
return NextActivity;
|
return NextActivity;
|
||||||
|
|||||||
Reference in New Issue
Block a user