CORPORATION: more granular office size upgrades (#1179)

Allows corporation.upgradeOfficeSize to increase the size of a Corporation office by a non-multiple of 3 and also be charged a corresponding amount of corporate funds. See #1166 for details of current behavior.
This commit is contained in:
adeilt
2024-03-24 17:37:08 -07:00
committed by GitHub
parent db226ce0b8
commit 08097aaf09
6 changed files with 91 additions and 68 deletions
@@ -55,8 +55,6 @@ Maximum size with a given `MaxCost`:
$$MaxUpgradeLevel = 3\ast\log_{1.09}\left( MaxCost\ast\frac{0.09}{BasePrice} + {1.09}^{\frac{CurrentSize}{3}} \right)$$
When we divide office's size by 3, we need to use `Math.ceil()` to round up the value. This means upgrading from size 3 to size 4 costs the same as upgrading from size 3 to size 6. The most cost-effective size is always a multiple of 3.
## Energy and morale
They are calculated in START state.