added infantry taking cover behavior

This commit is contained in:
Chris Forbes
2009-12-17 21:52:39 +13:00
parent 36e788b685
commit ac2b666366
9 changed files with 184 additions and 16 deletions

View File

@@ -111,10 +111,13 @@ namespace OpenRa.Game
public void InflictDamage(Actor attacker, int damage, WarheadInfo warhead)
{
/* todo: auto-retaliate, etc */
/* todo: death sequence for infantry based on inflictor */
if (IsDead) return; /* overkill! don't count extra hits as more kills! */
/* apply the damage modifiers, if we have any. */
damage = (int)traits.WithInterface<IDamageModifier>().Aggregate(
(float)damage, (a, t) => t.GetDamageModifier() * a);
Health -= damage;
if (Health <= 0)
{