Remove the AttackSwallow Info field overloading.

This commit is contained in:
Paul Chote
2014-12-14 10:49:35 +13:00
parent 8e001663dc
commit a50ccd1020
2 changed files with 6 additions and 9 deletions

View File

@@ -28,13 +28,8 @@ namespace OpenRA.Mods.D2k
class AttackSwallow : AttackFrontal
{
new public readonly AttackSwallowInfo Info;
public AttackSwallow(Actor self, AttackSwallowInfo info)
: base(self, info)
{
Info = info;
}
: base(self, info) { }
public override void DoAttack(Actor self, Target target)
{

View File

@@ -30,6 +30,7 @@ namespace OpenRA.Mods.D2k
readonly RenderUnit renderUnit;
readonly RadarPings radarPings;
readonly AttackSwallow swallow;
readonly AttackSwallowInfo swallowInfo;
readonly IPositionable positionable;
int countdown;
@@ -41,9 +42,10 @@ namespace OpenRA.Mods.D2k
this.weapon = weapon;
positionable = self.Trait<Mobile>();
swallow = self.Trait<AttackSwallow>();
swallowInfo = (AttackSwallowInfo)swallow.Info;
renderUnit = self.Trait<RenderUnit>();
radarPings = self.World.WorldActor.TraitOrDefault<RadarPings>();
countdown = swallow.Info.AttackTime;
countdown = swallowInfo.AttackTime;
renderUnit.DefaultAnimation.ReplaceAnim("burrowed");
stance = AttackState.Burrowed;
@@ -86,7 +88,7 @@ namespace OpenRA.Mods.D2k
void NotifyPlayer(Player player, WPos location)
{
Sound.PlayNotification(player.World.Map.Rules, player, "Speech", swallow.Info.WormAttackNotification, player.Country.Race);
Sound.PlayNotification(player.World.Map.Rules, player, "Speech", swallowInfo.WormAttackNotification, player.Country.Race);
radarPings.Add(() => true, location, Color.Red, 50);
}
@@ -128,7 +130,7 @@ namespace OpenRA.Mods.D2k
return NextActivity;
}
countdown = swallow.Info.ReturnTime;
countdown = swallowInfo.ReturnTime;
stance = AttackState.ReturningUnderground;
}