mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 09:40:44 +00:00
playtest
This commit is contained in:
@@ -86,6 +86,7 @@ export interface Config {
|
||||
startManpower(playerInfo: PlayerInfo): number;
|
||||
troopIncreaseRate(player: Player | PlayerView): number;
|
||||
goldAdditionRate(player: Player | PlayerView): Gold;
|
||||
conquerGoldAmount(captured: Player): Gold;
|
||||
attackTilesPerTick(
|
||||
attckTroops: number,
|
||||
attacker: Player,
|
||||
|
||||
@@ -204,7 +204,7 @@ export class DefaultConfig implements Config {
|
||||
return 5 - falloutRatio * 2;
|
||||
}
|
||||
SAMCooldown(): number {
|
||||
return 120;
|
||||
return 75;
|
||||
}
|
||||
SiloCooldown(): number {
|
||||
return 75;
|
||||
@@ -318,7 +318,7 @@ export class DefaultConfig implements Config {
|
||||
// Sigmoid: concave start, sharp S-curve middle, linear end - heavily punishes trades under range debuff.
|
||||
const debuff = this.tradeShipShortRangeDebuff();
|
||||
const baseGold =
|
||||
75_000 / (1 + Math.exp(-0.03 * (dist - debuff))) + 50 * dist;
|
||||
75_000 / (1 + Math.exp(-0.03 * (dist - debuff))) + 75 * dist;
|
||||
return BigInt(Math.floor(baseGold * this.goldMultiplierFor(player)));
|
||||
}
|
||||
|
||||
@@ -379,7 +379,7 @@ export class DefaultConfig implements Config {
|
||||
UnitType.Port,
|
||||
UnitType.Factory,
|
||||
),
|
||||
constructionDuration: this.instantBuild() ? 0 : 2 * 10,
|
||||
constructionDuration: this.instantBuild() ? 0 : 10 * 10,
|
||||
upgradable: true,
|
||||
};
|
||||
break;
|
||||
@@ -512,6 +512,17 @@ export class DefaultConfig implements Config {
|
||||
return base;
|
||||
}
|
||||
|
||||
public conquerGoldAmount(captured: Player): Gold {
|
||||
if (
|
||||
captured.type() === PlayerType.Bot ||
|
||||
captured.type() === PlayerType.Nation
|
||||
) {
|
||||
return captured.gold();
|
||||
} else {
|
||||
return captured.gold() / 2n;
|
||||
}
|
||||
}
|
||||
|
||||
private startingGoldFor(playerInfo: PlayerInfo): Gold {
|
||||
const base = BigInt(this._gameConfig.startingGold ?? 0);
|
||||
const hc = this._gameConfig.hostCheats;
|
||||
@@ -672,16 +683,11 @@ export class DefaultConfig implements Config {
|
||||
mag = 0;
|
||||
}
|
||||
if (
|
||||
attacker.type() === PlayerType.Human &&
|
||||
(attacker.type() === PlayerType.Human ||
|
||||
attacker.type() === PlayerType.Nation) &&
|
||||
defender.type() === PlayerType.Bot
|
||||
) {
|
||||
mag *= 0.8;
|
||||
}
|
||||
if (
|
||||
attacker.type() === PlayerType.Nation &&
|
||||
defender.type() === PlayerType.Bot
|
||||
) {
|
||||
mag *= 0.8;
|
||||
mag *= 0.7;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -718,7 +724,7 @@ export class DefaultConfig implements Config {
|
||||
const altAttackerLoss =
|
||||
1.3 * defenderTroopLoss * (mag / 100) * traitorMod;
|
||||
const attackerTroopLoss =
|
||||
0.7 * currentAttackerLoss + 0.3 * altAttackerLoss;
|
||||
0.6 * currentAttackerLoss + 0.4 * altAttackerLoss;
|
||||
|
||||
return {
|
||||
attackerTroopLoss,
|
||||
@@ -853,7 +859,7 @@ export class DefaultConfig implements Config {
|
||||
toAdd *= ratio;
|
||||
|
||||
if (player.type() === PlayerType.Bot) {
|
||||
toAdd *= 0.6;
|
||||
toAdd *= 0.5;
|
||||
}
|
||||
|
||||
if (player.type() === PlayerType.Nation) {
|
||||
@@ -906,7 +912,7 @@ export class DefaultConfig implements Config {
|
||||
}
|
||||
|
||||
defaultNukeSpeed(): number {
|
||||
return 6;
|
||||
return 8;
|
||||
}
|
||||
|
||||
defaultNukeTargetableRange(): number {
|
||||
|
||||
@@ -1204,6 +1204,9 @@ export class GameImpl implements Game {
|
||||
const skipGoldTransfer =
|
||||
attacksSent === 0n && conquered.type() === PlayerType.Human;
|
||||
const gold = skipGoldTransfer ? 0n : conquered.gold();
|
||||
const goldCaptured = skipGoldTransfer
|
||||
? 0n
|
||||
: this._config.conquerGoldAmount(conquered);
|
||||
|
||||
if (skipGoldTransfer) {
|
||||
this.displayMessage(
|
||||
@@ -1222,22 +1225,22 @@ export class GameImpl implements Game {
|
||||
conqueror.id(),
|
||||
gold,
|
||||
{
|
||||
gold: renderNumber(gold),
|
||||
gold: renderNumber(goldCaptured),
|
||||
name: conquered.displayName(),
|
||||
},
|
||||
);
|
||||
conqueror.addGold(gold);
|
||||
conqueror.addGold(goldCaptured);
|
||||
conquered.removeGold(gold);
|
||||
|
||||
// Record stats
|
||||
this.stats().goldWar(conqueror, conquered, gold);
|
||||
this.stats().goldWar(conqueror, conquered, goldCaptured);
|
||||
}
|
||||
|
||||
this.addUpdate({
|
||||
type: GameUpdateType.ConquestEvent,
|
||||
conquerorId: conqueror.id(),
|
||||
conqueredId: conquered.id(),
|
||||
gold,
|
||||
gold: goldCaptured,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user