Make INotifyDamage require explicit implementation
This commit is contained in:
@@ -1108,7 +1108,7 @@ namespace OpenRA.Mods.Common.AI
|
|||||||
QueueOrder(Order.StartProduction(queue.Actor, name, 1));
|
QueueOrder(Order.StartProduction(queue.Actor, name, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Damaged(Actor self, AttackInfo e)
|
void INotifyDamage.Damaged(Actor self, AttackInfo e)
|
||||||
{
|
{
|
||||||
if (!IsEnabled || e.Attacker == null)
|
if (!IsEnabled || e.Attacker == null)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ namespace OpenRA.Mods.Common.Scripting
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Damaged(Actor self, AttackInfo e)
|
void INotifyDamage.Damaged(Actor self, AttackInfo e)
|
||||||
{
|
{
|
||||||
if (world.Disposing)
|
if (world.Disposing)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
lastAttackTime = -info.NotifyInterval * 25;
|
lastAttackTime = -info.NotifyInterval * 25;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Damaged(Actor self, AttackInfo e)
|
void INotifyDamage.Damaged(Actor self, AttackInfo e)
|
||||||
{
|
{
|
||||||
if (e.Attacker == null)
|
if (e.Attacker == null)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
lastAttackTime = -info.NotifyInterval * 25;
|
lastAttackTime = -info.NotifyInterval * 25;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Damaged(Actor self, AttackInfo e)
|
void INotifyDamage.Damaged(Actor self, AttackInfo e)
|
||||||
{
|
{
|
||||||
// Don't track self-damage
|
// Don't track self-damage
|
||||||
if (e.Attacker != null && e.Attacker.Owner == self.Owner)
|
if (e.Attacker != null && e.Attacker.Owner == self.Owner)
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
rs.Add(new AnimationWithOffset(anim, null, () => !isSmoking));
|
rs.Add(new AnimationWithOffset(anim, null, () => !isSmoking));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Damaged(Actor self, AttackInfo e)
|
void INotifyDamage.Damaged(Actor self, AttackInfo e)
|
||||||
{
|
{
|
||||||
if (info.DamageTypes.Count > 0 && !e.Damage.DamageTypes.Overlaps(info.DamageTypes))
|
if (info.DamageTypes.Count > 0 && !e.Damage.DamageTypes.Overlaps(info.DamageTypes))
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Damaged(Actor self, AttackInfo e)
|
void INotifyDamage.Damaged(Actor self, AttackInfo e)
|
||||||
{
|
{
|
||||||
if (e.Damage.Value > 0)
|
if (e.Damage.Value > 0)
|
||||||
damageTicks = Info.DamageCooldown;
|
damageTicks = Info.DamageCooldown;
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
[RequireExplicitImplementation]
|
[RequireExplicitImplementation]
|
||||||
public interface INotifyDamageStateChanged { void DamageStateChanged(Actor self, AttackInfo e); }
|
public interface INotifyDamageStateChanged { void DamageStateChanged(Actor self, AttackInfo e); }
|
||||||
|
|
||||||
|
[RequireExplicitImplementation]
|
||||||
public interface INotifyDamage { void Damaged(Actor self, AttackInfo e); }
|
public interface INotifyDamage { void Damaged(Actor self, AttackInfo e); }
|
||||||
public interface INotifyKilled { void Killed(Actor self, AttackInfo e); }
|
public interface INotifyKilled { void Killed(Actor self, AttackInfo e); }
|
||||||
public interface INotifyAppliedDamage { void AppliedDamage(Actor self, Actor damaged, AttackInfo e); }
|
public interface INotifyAppliedDamage { void AppliedDamage(Actor self, Actor damaged, AttackInfo e); }
|
||||||
|
|||||||
Reference in New Issue
Block a user