mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-20 16:50:47 +00:00
Merge branch 'main' into trade3
This commit is contained in:
@@ -201,7 +201,7 @@ export class DefaultConfig implements Config {
|
||||
return 5 - falloutRatio * 2;
|
||||
}
|
||||
SAMCooldown(): number {
|
||||
return 75;
|
||||
return 120;
|
||||
}
|
||||
SiloCooldown(): number {
|
||||
return 75;
|
||||
@@ -240,6 +240,9 @@ export class DefaultConfig implements Config {
|
||||
disableNavMesh(): boolean {
|
||||
return this._gameConfig.disableNavMesh ?? false;
|
||||
}
|
||||
disableAlliances(): boolean {
|
||||
return this._gameConfig.disableAlliances ?? false;
|
||||
}
|
||||
isRandomSpawn(): boolean {
|
||||
return this._gameConfig.randomSpawn;
|
||||
}
|
||||
@@ -268,24 +271,30 @@ export class DefaultConfig implements Config {
|
||||
trainSpawnRate(numPlayerFactories: number): number {
|
||||
// hyperbolic decay, midpoint at 10 factories
|
||||
// expected number of trains = numPlayerFactories / trainSpawnRate(numPlayerFactories)
|
||||
return (numPlayerFactories + 10) * 18;
|
||||
return (numPlayerFactories + 10) * 15;
|
||||
}
|
||||
trainGold(rel: "self" | "team" | "ally" | "other"): Gold {
|
||||
const multiplier = this.goldMultiplier();
|
||||
let baseGold: bigint;
|
||||
trainGold(
|
||||
rel: "self" | "team" | "ally" | "other",
|
||||
citiesVisited: number,
|
||||
): Gold {
|
||||
// No penalty for the first 10 cities.
|
||||
citiesVisited = Math.max(0, citiesVisited - 9);
|
||||
let baseGold: number;
|
||||
switch (rel) {
|
||||
case "ally":
|
||||
baseGold = 35_000n;
|
||||
baseGold = 35_000;
|
||||
break;
|
||||
case "team":
|
||||
case "other":
|
||||
baseGold = 25_000n;
|
||||
baseGold = 25_000;
|
||||
break;
|
||||
case "self":
|
||||
baseGold = 10_000n;
|
||||
baseGold = 10_000;
|
||||
break;
|
||||
}
|
||||
return BigInt(Math.floor(Number(baseGold) * multiplier));
|
||||
const distPenalty = citiesVisited * 5_000;
|
||||
const gold = Math.max(5000, baseGold - distPenalty);
|
||||
return toInt(gold * this.goldMultiplier());
|
||||
}
|
||||
|
||||
trainStationMinRange(): number {
|
||||
@@ -640,7 +649,7 @@ export class DefaultConfig implements Config {
|
||||
const altAttackerLoss =
|
||||
1.3 * defenderTroopLoss * (mag / 100) * traitorMod;
|
||||
const attackerTroopLoss =
|
||||
0.5 * currentAttackerLoss + 0.5 * altAttackerLoss;
|
||||
0.7 * currentAttackerLoss + 0.3 * altAttackerLoss;
|
||||
|
||||
return {
|
||||
attackerTroopLoss,
|
||||
|
||||
Reference in New Issue
Block a user