combat actually works
This commit is contained in:
@@ -77,6 +77,27 @@ namespace OpenRa.Game
|
||||
var loc = CenterLocation - 0.5f * size;
|
||||
return new RectangleF(loc.X, loc.Y, size.X, size.Y);
|
||||
}
|
||||
}
|
||||
|
||||
public void InflictDamage(Actor attacker, Bullet inflictor, int damage)
|
||||
{
|
||||
/* todo: auto-retaliate, etc */
|
||||
/* todo: death sequence for infantry based on inflictor */
|
||||
/* todo: start smoking if < conditionYellow and took damage, and not already smoking
|
||||
|
||||
if (Health <= 0) return; /* overkill! */
|
||||
|
||||
Health -= damage;
|
||||
if (Health <= 0)
|
||||
{
|
||||
Health = 0;
|
||||
if (attacker.Owner != null)
|
||||
attacker.Owner.Kills++;
|
||||
|
||||
Game.world.AddFrameEndTask(w => w.Remove(this));
|
||||
|
||||
/* todo: explosion */
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user