mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-17 17:49:14 +00:00
bugfix: show updated cost when building a unit while another unit of same type is under construction
This commit is contained in:
@@ -114,7 +114,8 @@ export class DefaultConfig implements Config {
|
||||
cost: (p: Player) =>
|
||||
p.type() == PlayerType.Human && this.creativeMode()
|
||||
? 0
|
||||
: (p.units(UnitType.Warship).length + 1) * 250_000,
|
||||
: (p.unitsIncludingConstruction(UnitType.Warship).length + 1) *
|
||||
250_000,
|
||||
territoryBound: false,
|
||||
maxHealth: 1000,
|
||||
};
|
||||
@@ -131,7 +132,10 @@ export class DefaultConfig implements Config {
|
||||
? 0
|
||||
: Math.min(
|
||||
1_000_000,
|
||||
Math.pow(2, p.units(UnitType.Port).length) * 250_000,
|
||||
Math.pow(
|
||||
2,
|
||||
p.unitsIncludingConstruction(UnitType.Port).length,
|
||||
) * 250_000,
|
||||
),
|
||||
territoryBound: true,
|
||||
constructionDuration: this.creativeMode() ? 0 : 2 * 10,
|
||||
@@ -180,7 +184,9 @@ export class DefaultConfig implements Config {
|
||||
? 0
|
||||
: Math.min(
|
||||
250_000,
|
||||
(p.units(UnitType.DefensePost).length + 1) * 50_000,
|
||||
(p.unitsIncludingConstruction(UnitType.DefensePost).length +
|
||||
1) *
|
||||
50_000,
|
||||
),
|
||||
territoryBound: true,
|
||||
constructionDuration: this.creativeMode() ? 0 : 5 * 10,
|
||||
@@ -192,7 +198,10 @@ export class DefaultConfig implements Config {
|
||||
? 0
|
||||
: Math.min(
|
||||
1_000_000,
|
||||
Math.pow(2, p.units(UnitType.City).length) * 125_000,
|
||||
Math.pow(
|
||||
2,
|
||||
p.unitsIncludingConstruction(UnitType.City).length,
|
||||
) * 125_000,
|
||||
),
|
||||
territoryBound: true,
|
||||
constructionDuration: this.creativeMode() ? 0 : 2 * 10,
|
||||
|
||||
Reference in New Issue
Block a user