From 34e34f544a00762ea699b97f69be5c379021b8f9 Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Sat, 30 Sep 2023 15:41:28 +0000 Subject: [PATCH] feat: let multiple ships buy mounts at once if we have more than 10Mc --- packages/cli/lib/behavior/central_command.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/cli/lib/behavior/central_command.dart b/packages/cli/lib/behavior/central_command.dart index a679b830..daf474e0 100644 --- a/packages/cli/lib/behavior/central_command.dart +++ b/packages/cli/lib/behavior/central_command.dart @@ -489,9 +489,13 @@ class CentralCommand { /// Returns true if [ship] should start the mountFromBuy behavior. bool shouldBuyMount(Ship ship, int credits) { // Are there any other ships actively buying mounts? - if (_behaviorCache.states.any( + bool otherShipsAreBuyingMounts = _behaviorCache.states.any( (s) => s.behavior == Behavior.mountFromBuy, - )) { + ); + // Only enforce the "one at a time" when we have less than 10M credits. + // The 10M is mostly a hack to allow deploying changes to mounts quickly + // late game. + if (credits < 10000000 || otherShipsAreBuyingMounts) { return false; } // Does this ship have a mount it needs?