feat: bomb planets

This commit is contained in:
Ilia Denisov
2026-01-19 23:08:57 +02:00
parent bd9db26ef4
commit 40b2cb27f6
13 changed files with 440 additions and 22 deletions
+3 -2
View File
@@ -74,8 +74,9 @@ func (c *Cache) UpgradeGroup(ri int, groupIndex uint, techInput string, limitShi
productionCapacity := c.PlanetProductionCapacity(pl.Number)
if c.ShipGroup(sgi).State() == game.StateUpgrade {
// to calculate actual capacity we must substract upgrade cost of selected group, if is upgrade state
productionCapacity -= c.ShipGroup(sgi).StateUpgrade.Cost()
// to calculate actual capacity we must "compensate" upgrade cost of selected group, if it is in upgrade state
// TODO: this is not tested
productionCapacity += c.ShipGroup(sgi).StateUpgrade.Cost()
}
uc := game.GroupUpgradeCost(*(c.ShipGroup(sgi)), *st, targetLevel[game.TechDrive], targetLevel[game.TechWeapons], targetLevel[game.TechShields], targetLevel[game.TechCargo])
costForShip := uc.UpgradeCost(1)