diff --git a/src/client/index.html b/src/client/index.html
index 303e92093..45daf07a6 100644
--- a/src/client/index.html
+++ b/src/client/index.html
@@ -203,7 +203,7 @@
/>
-
+
diff --git a/src/core/configuration/Config.ts b/src/core/configuration/Config.ts
index 6990856fb..aa11c4c41 100644
--- a/src/core/configuration/Config.ts
+++ b/src/core/configuration/Config.ts
@@ -123,7 +123,7 @@ export interface Config {
donateCooldown(): Tick;
defaultDonationAmount(sender: Player): number;
unitInfo(type: UnitType): UnitInfo;
- tradeShipGold(dist: number, numTradeShips: number): Gold;
+ tradeShipGold(dist: number, numPorts: number): Gold;
tradeShipSpawnRate(numTradeShips: number): number;
tradeShipCap(): number;
safeFromPiratesCooldownMax(): number;
diff --git a/src/core/configuration/DefaultConfig.ts b/src/core/configuration/DefaultConfig.ts
index 1402f22b5..092074003 100644
--- a/src/core/configuration/DefaultConfig.ts
+++ b/src/core/configuration/DefaultConfig.ts
@@ -189,7 +189,7 @@ export class DefaultConfig implements Config {
return 0.5;
}
traitorSpeedDebuff(): number {
- return 0.5;
+ return 0.7;
}
traitorDuration(): number {
return 30 * 10; // 30 seconds
@@ -245,11 +245,13 @@ export class DefaultConfig implements Config {
defensePostRange(): number {
return 30;
}
+
defensePostDefenseBonus(): number {
return 5;
}
+
defensePostSpeedBonus(): number {
- return 2;
+ return 3;
}
playerTeams(): number | typeof Duos {
@@ -278,8 +280,8 @@ export class DefaultConfig implements Config {
}
tradeShipGold(dist: number, numPorts: number): Gold {
- const baseGold = Math.floor(10000 + 150 * Math.pow(dist, 1.1));
- const bonusPortNum = 25;
+ const baseGold = Math.floor(50000 + 130 * dist ** 1.1);
+ const bonusPortNum = 100;
if (numPorts < bonusPortNum) {
return BigInt(baseGold);
} else {
@@ -376,7 +378,7 @@ export class DefaultConfig implements Config {
cost: (p: Player) =>
p.type() === PlayerType.Human && this.infiniteGold()
? 0n
- : 40_000_000n,
+ : 30_000_000n,
territoryBound: false,
};
case UnitType.MIRVWarhead:
@@ -576,8 +578,8 @@ export class DefaultConfig implements Config {
if (defender.isPlayer()) {
let largeDefenderDebuff = 1;
- if (defender.numTilesOwned() > 100_000) {
- largeDefenderDebuff = Math.sqrt(100_000 / defender.numTilesOwned());
+ if (defender.numTilesOwned() > 50_000) {
+ largeDefenderDebuff = Math.sqrt(50_000 / defender.numTilesOwned());
}
return {
attackerTroopLoss:
@@ -614,8 +616,18 @@ export class DefaultConfig implements Config {
numAdjacentTilesWithEnemy: number,
): number {
if (defender.isPlayer()) {
+ let defendingTroops = defender.troops();
+ for (const attack of defender.outgoingAttacks()) {
+ if (
+ attack.target().isPlayer() &&
+ attack.target().id() === attacker.id()
+ ) {
+ // If the defender has a counter attack, that should count as defending troops.
+ defendingTroops += attack.troops();
+ }
+ }
return (
- within(((5 * attackTroops) / defender.troops()) * 2, 0.01, 0.5) *
+ within(((5 * attackTroops) / defendingTroops) * 2, 0.01, 0.5) *
numAdjacentTilesWithEnemy *
3
);
@@ -758,7 +770,7 @@ export class DefaultConfig implements Config {
}
defaultNukeSpeed(): number {
- return 4;
+ return 6;
}
// Humans can be population, soldiers attacking, soldiers in boat etc.
diff --git a/src/core/execution/TradeShipExecution.ts b/src/core/execution/TradeShipExecution.ts
index 37ea4143a..fb4aad586 100644
--- a/src/core/execution/TradeShipExecution.ts
+++ b/src/core/execution/TradeShipExecution.ts
@@ -131,10 +131,7 @@ export class TradeShipExecution implements Execution {
this.tradeShip!.delete(false);
const gold = this.mg
.config()
- .tradeShipGold(
- this.tilesTraveled,
- this.mg.units(UnitType.TradeShip).length,
- );
+ .tradeShipGold(this.tilesTraveled, this.mg.units(UnitType.Port).length);
if (this.wasCaptured) {
this.tradeShip!.owner().addGold(gold);