mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-23 07:29:02 -08:00
Refuel Enterprise at starbase
This commit is contained in:
@@ -75,6 +75,8 @@ namespace SuperStarTrek.Objects
|
|||||||
return _commandExecutors[command].ExecuteCommand(_quadrant);
|
return _commandExecutors[command].ExecuteCommand(_quadrant);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Refuel() => TotalEnergy = _maxEnergy;
|
||||||
|
|
||||||
internal bool Recognises(string command)
|
internal bool Recognises(string command)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
|
|||||||
@@ -60,5 +60,7 @@ namespace SuperStarTrek.Systems
|
|||||||
|
|
||||||
return quadrant.KlingonsFireOnEnterprise();
|
return quadrant.KlingonsFireOnEnterprise();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal void ReplenishTorpedoes() => TorpedoCount = _tubeCount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,5 +51,7 @@ namespace SuperStarTrek.Systems
|
|||||||
}
|
}
|
||||||
|
|
||||||
internal void AbsorbHit(int hitStrength) => ShieldEnergy -= hitStrength;
|
internal void AbsorbHit(int hitStrength) => ShieldEnergy -= hitStrength;
|
||||||
|
|
||||||
|
internal void DropShields() => ShieldEnergy = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,6 +32,13 @@ namespace SuperStarTrek.Systems
|
|||||||
_enterprise.VaryConditionOfRandomSystem();
|
_enterprise.VaryConditionOfRandomSystem();
|
||||||
var timeElapsed = _enterprise.Move(course, warpFactor, distanceToMove);
|
var timeElapsed = _enterprise.Move(course, warpFactor, distanceToMove);
|
||||||
|
|
||||||
|
if (_enterprise.IsDocked)
|
||||||
|
{
|
||||||
|
_enterprise.ShieldControl.DropShields();
|
||||||
|
_enterprise.Refuel();
|
||||||
|
_enterprise.PhotonTubes.ReplenishTorpedoes();
|
||||||
|
}
|
||||||
|
|
||||||
return CommandResult.Elapsed(timeElapsed);
|
return CommandResult.Elapsed(timeElapsed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user