easier to take nuclear land if most of the land are nuclear (#241)

- **Revert "Change BorderTiles from Array to Set (#230)"**
- **easier to take nuclear land if most of the land are nuclear**
This commit is contained in:
Ilan Schemoul
2025-03-14 01:05:22 +01:00
committed by GitHub
parent b9dad022fc
commit c4f612eb98
2 changed files with 8 additions and 5 deletions
+1 -1
View File
@@ -163,7 +163,7 @@ export interface Config {
tradeShipSpawnRate(): number;
defensePostRange(): number;
defensePostDefenseBonus(): number;
falloutDefenseModifier(): number;
falloutDefenseModifier(percentOfFallout: number): number;
difficultyModifier(difficulty: Difficulty): number;
// 0-1
traitorDefenseDebuff(): number;
+7 -4
View File
@@ -126,8 +126,10 @@ export class DefaultConfig implements Config {
return 250_000;
}
falloutDefenseModifier(): number {
return 5;
falloutDefenseModifier(falloutRatio: number): number {
// falloutRatio is between 0 and 1
// So defense modifier is between [5, 2.5]
return 5 - falloutRatio * 2;
}
defensePostRange(): number {
@@ -374,8 +376,9 @@ export class DefaultConfig implements Config {
}
if (gm.hasFallout(tileToConquer)) {
mag *= this.falloutDefenseModifier();
speed *= this.falloutDefenseModifier();
const falloutRatio = gm.numTilesWithFallout() / gm.numLandTiles();
mag *= this.falloutDefenseModifier(falloutRatio);
speed *= this.falloutDefenseModifier(falloutRatio);
}
if (attacker.isPlayer() && defender.isPlayer()) {