mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-28 21:54:17 -08:00
Fix energy usage by warp engines.
This commit is contained in:
@@ -179,6 +179,13 @@ namespace SuperStarTrek.Objects
|
||||
_quadrant.SetEnterpriseSector(sector);
|
||||
SectorCoordinates = sector;
|
||||
|
||||
TotalEnergy -= distance + 10;
|
||||
if (Energy < 0)
|
||||
{
|
||||
_output.WriteLine("Shield Control supplies energy to complete the maneuver.");
|
||||
ShieldControl.ShieldEnergy = Math.Max(0, TotalEnergy);
|
||||
}
|
||||
|
||||
return GetTimeElapsed(quadrant, warpFactor);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace SuperStarTrek.Systems
|
||||
_input = input;
|
||||
}
|
||||
|
||||
public float ShieldEnergy { get; private set; }
|
||||
public float ShieldEnergy { get; set; }
|
||||
|
||||
protected override bool CanExecuteCommand() => IsOperational("{name} inoperable");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user