Make INotifyKilled require explicit implementation
This commit is contained in:
@@ -127,7 +127,7 @@ namespace OpenRA.Mods.Common.Scripting
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Killed(Actor self, AttackInfo e)
|
void INotifyKilled.Killed(Actor self, AttackInfo e)
|
||||||
{
|
{
|
||||||
if (world.Disposing)
|
if (world.Disposing)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
this.info = info;
|
this.info = info;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Killed(Actor self, AttackInfo e)
|
void INotifyKilled.Killed(Actor self, AttackInfo e)
|
||||||
{
|
{
|
||||||
if (self.Owner.WinState == WinState.Lost || !self.World.Map.Contains(self.Location))
|
if (self.Owner.WinState == WinState.Lost || !self.World.Map.Contains(self.Location))
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
this.info = info;
|
this.info = info;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Killed(Actor self, AttackInfo e)
|
void INotifyKilled.Killed(Actor self, AttackInfo e)
|
||||||
{
|
{
|
||||||
if (e.Attacker == null || e.Attacker.Disposed)
|
if (e.Attacker == null || e.Attacker.Disposed)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
|
|
||||||
public class UpdatesPlayerStatistics : INotifyKilled
|
public class UpdatesPlayerStatistics : INotifyKilled
|
||||||
{
|
{
|
||||||
public void Killed(Actor self, AttackInfo e)
|
void INotifyKilled.Killed(Actor self, AttackInfo e)
|
||||||
{
|
{
|
||||||
if (self.Owner.WinState != WinState.Undefined)
|
if (self.Owner.WinState != WinState.Undefined)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
rs = self.Trait<RenderSprites>();
|
rs = self.Trait<RenderSprites>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Killed(Actor self, AttackInfo e)
|
void INotifyKilled.Killed(Actor self, AttackInfo e)
|
||||||
{
|
{
|
||||||
// Actors with Crushable trait will spawn CrushedSequence.
|
// Actors with Crushable trait will spawn CrushedSequence.
|
||||||
if (crushed || IsTraitDisabled)
|
if (crushed || IsTraitDisabled)
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
this.info = info;
|
this.info = info;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Killed(Actor self, AttackInfo e)
|
void INotifyKilled.Killed(Actor self, AttackInfo e)
|
||||||
{
|
{
|
||||||
self.World.WorldActor.Trait<ScreenShaker>().AddEffect(info.Intensity, self.CenterPosition, 1);
|
self.World.WorldActor.Trait<ScreenShaker>().AddEffect(info.Intensity, self.CenterPosition, 1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ namespace OpenRA.Mods.Common.Traits.Sound
|
|||||||
this.info = info;
|
this.info = info;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Killed(Actor self, AttackInfo e)
|
void INotifyKilled.Killed(Actor self, AttackInfo e)
|
||||||
{
|
{
|
||||||
var player = info.NotifyAll ? self.World.LocalPlayer : self.Owner;
|
var player = info.NotifyAll ? self.World.LocalPlayer : self.Owner;
|
||||||
Game.Sound.PlayNotification(self.World.Map.Rules, player, "Speech", info.Notification, self.Owner.Faction.InternalName);
|
Game.Sound.PlayNotification(self.World.Map.Rules, player, "Speech", info.Notification, self.Owner.Faction.InternalName);
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ namespace OpenRA.Mods.Common.Traits.Sound
|
|||||||
public DeathSounds(DeathSoundsInfo info)
|
public DeathSounds(DeathSoundsInfo info)
|
||||||
: base(info) { }
|
: base(info) { }
|
||||||
|
|
||||||
public void Killed(Actor self, AttackInfo e)
|
void INotifyKilled.Killed(Actor self, AttackInfo e)
|
||||||
{
|
{
|
||||||
if (IsTraitDisabled)
|
if (IsTraitDisabled)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
|
|
||||||
[RequireExplicitImplementation]
|
[RequireExplicitImplementation]
|
||||||
public interface INotifyDamage { void Damaged(Actor self, AttackInfo e); }
|
public interface INotifyDamage { void Damaged(Actor self, AttackInfo e); }
|
||||||
|
[RequireExplicitImplementation]
|
||||||
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