Core: Added the attacker to IDamageModifier' GetDamageModifier

This commit is contained in:
geckosoft
2010-10-25 15:06:36 +02:00
committed by Chris Forbes
parent 2640603f6c
commit e7c61fac5c
8 changed files with 8 additions and 8 deletions

View File

@@ -82,7 +82,7 @@ namespace OpenRA.Traits
/* apply the damage modifiers, if we have any. */
var modifier = (float)self.TraitsImplementing<IDamageModifier>().Concat(self.Owner.PlayerActor.TraitsImplementing<IDamageModifier>())
.Select(t => t.GetDamageModifier(warhead)).Product();
.Select(t => t.GetDamageModifier(attacker, warhead)).Product();
damage = (int)(damage * modifier);

View File

@@ -106,7 +106,7 @@ namespace OpenRA.Traits
public interface INotifyAttack { void Attacking(Actor self); }
public interface IRenderModifier { IEnumerable<Renderable> ModifyRender(Actor self, IEnumerable<Renderable> r); }
public interface IDamageModifier { float GetDamageModifier( WarheadInfo warhead ); }
public interface IDamageModifier { float GetDamageModifier(Actor attacker, WarheadInfo warhead); }
public interface ISpeedModifier { float GetSpeedModifier(); }
public interface IFirepowerModifier { float GetFirepowerModifier(); }
public interface IPalette { void InitPalette( WorldRenderer wr ); }