mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2026-01-07 10:50:53 -08:00
Fix torpedo count
This commit is contained in:
@@ -42,7 +42,7 @@ namespace SuperStarTrek.Objects
|
|||||||
public float TotalEnergy { get; private set; }
|
public float TotalEnergy { get; private set; }
|
||||||
public int DamagedSystemCount => _systems.Count(s => s.IsDamaged);
|
public int DamagedSystemCount => _systems.Count(s => s.IsDamaged);
|
||||||
public IEnumerable<Subsystem> Systems => _systems;
|
public IEnumerable<Subsystem> Systems => _systems;
|
||||||
public int TorpedoCount { get; }
|
public PhotonTubes PhotonTubes => (PhotonTubes)_commandExecutors[Command.TOR];
|
||||||
public bool IsDocked => _quadrant.EnterpriseIsNextToStarbase;
|
public bool IsDocked => _quadrant.EnterpriseIsNextToStarbase;
|
||||||
public bool IsStranded => TotalEnergy < 10 || Energy < 10 && ShieldControl.IsDamaged;
|
public bool IsStranded => TotalEnergy < 10 || Energy < 10 && ShieldControl.IsDamaged;
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,8 @@ namespace SuperStarTrek.Systems
|
|||||||
return CommandResult.Ok;
|
return CommandResult.Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TorpedoCount -= 1;
|
||||||
|
|
||||||
var isHit = false;
|
var isHit = false;
|
||||||
_output.WriteLine("Torpedo track:");
|
_output.WriteLine("Torpedo track:");
|
||||||
foreach (var sector in course.GetSectorsFrom(_enterprise.SectorCoordinates))
|
foreach (var sector in course.GetSectorsFrom(_enterprise.SectorCoordinates))
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ namespace SuperStarTrek.Systems
|
|||||||
yield return $"Condition {_enterprise.Condition}";
|
yield return $"Condition {_enterprise.Condition}";
|
||||||
yield return $"Quadrant {_enterprise.QuadrantCoordinates}";
|
yield return $"Quadrant {_enterprise.QuadrantCoordinates}";
|
||||||
yield return $"Sector {_enterprise.SectorCoordinates}";
|
yield return $"Sector {_enterprise.SectorCoordinates}";
|
||||||
yield return $"Photon torpedoes {_enterprise.TorpedoCount}";
|
yield return $"Photon torpedoes {_enterprise.PhotonTubes.TorpedoCount}";
|
||||||
yield return $"Total energy {Math.Ceiling(_enterprise.TotalEnergy)}";
|
yield return $"Total energy {Math.Ceiling(_enterprise.TotalEnergy)}";
|
||||||
yield return $"Shields {(int)_enterprise.ShieldControl.ShieldEnergy}";
|
yield return $"Shields {(int)_enterprise.ShieldControl.ShieldEnergy}";
|
||||||
yield return $"Klingons remaining {_galaxy.KlingonCount}";
|
yield return $"Klingons remaining {_galaxy.KlingonCount}";
|
||||||
|
|||||||
Reference in New Issue
Block a user