fixing up engineer behavior

This commit is contained in:
Chris Forbes
2009-12-28 20:24:06 +13:00
parent e80d59e851
commit 7b8a3c4968
2 changed files with 10 additions and 4 deletions

View File

@@ -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 );

View File

@@ -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;