added tracking of deaths as well as kills

This commit is contained in:
Chris Forbes
2010-05-02 13:31:56 +12:00
parent 32c73fa72f
commit 94b2055eb2
4 changed files with 7 additions and 3 deletions

View File

@@ -185,8 +185,9 @@ namespace OpenRA
if (Health <= 0)
{
Health = 0;
if (attacker.Owner != null)
attacker.Owner.Kills++;
Owner.Deaths++;
if (RemoveOnDeath)
World.AddFrameEndTask(w => w.Remove(this));

View File

@@ -33,6 +33,7 @@ namespace OpenRA
{
public Actor PlayerActor;
public int Kills;
public int Deaths;
public readonly string Palette;
public readonly Color Color;

View File

@@ -64,6 +64,7 @@ namespace OpenRA.Mods.Aftermath
// Remove from world
self.Health = 0;
detonatedBy.Owner.Kills++;
self.Owner.Deaths++;
w.Remove(self);
} );
}

View File

@@ -68,7 +68,8 @@ namespace OpenRA.Mods.RA
while (!cargo.IsEmpty(self))
{
chronosphere.Owner.Kills++;
cargo.Unload(self);
var a = cargo.Unload(self);
a.Owner.Deaths++;
}
}