private void ShowAttackAnimationAndSound() { Upgrade.GenericSecondaryWeapon chosenSecondaryWeapon = Combat.ChosenWeapon as Upgrade.GenericSecondaryWeapon; if (chosenSecondaryWeapon == null || chosenSecondaryWeapon.HasType(Upgrade.UpgradeType.Cannon) || chosenSecondaryWeapon.HasType(Upgrade.UpgradeType.Illicit)) { // Primary Weapons, Cannons, and Illicits (HotShotBlaster) Sounds.PlayShots(Selection.ActiveShip.SoundShotsPath, Selection.ActiveShip.ShotsCount); Selection.ThisShip.AnimatePrimaryWeapon(); } else if (chosenSecondaryWeapon.HasType(Upgrade.UpgradeType.Torpedo) || chosenSecondaryWeapon.HasType(Upgrade.UpgradeType.Missile)) { // Torpedos and Missiles Sounds.PlayShots("Proton-Torpedoes", 1); Selection.ThisShip.AnimateMunitionsShot(); } else if (chosenSecondaryWeapon.HasType(Upgrade.UpgradeType.Turret)) { // Turrets Sounds.PlayShots(Selection.ActiveShip.SoundShotsPath, Selection.ActiveShip.ShotsCount); Selection.ThisShip.AnimateTurretWeapon(); } }
public void PerformTorpedoesAttack(object sender, EventArgs e) { Tooltips.EndTooltip(); //TODO: Get upgrade correctly Upgrade.GenericSecondaryWeapon secondaryWeapon = null; foreach (var upgrade in Selection.ThisShip.InstalledUpgrades) { if (upgrade.Key == Upgrade.UpgradeSlot.Torpedoes) { secondaryWeapon = upgrade.Value as Upgrade.GenericSecondaryWeapon; } } Combat.SelectWeapon(secondaryWeapon); Messages.ShowInfo("Attack with " + secondaryWeapon.Name); Phases.FinishSubPhase(typeof(WeaponSelectionDecisionSubPhase)); Combat.TryPerformAttack(); }