attack troops no longer show in pop display

This commit is contained in:
1brucben
2025-04-24 14:22:35 +02:00
parent ce77245909
commit 27a50d2349
4 changed files with 9 additions and 8 deletions
+2 -2
View File
@@ -218,10 +218,10 @@ export class WinModal extends LitElement implements Layer {
new SendWinnerEvent(winner.clientID(), wu.allPlayersStats, "player"),
);
if (winner == this.game.myPlayer()) {
this._title = "Chicken Jockey!";
this._title = "You Won!";
this.won = true;
} else {
this._title = `Chicken Jockey!`;
this._title = `${wu.winner} has won!`;
this.won = false;
}
this.show();
+1 -1
View File
@@ -595,7 +595,7 @@ export class DefaultConfig implements Config {
10 +
(800 / max + 1 / 160) * (0.7 * player.troops() + 1.3 * player.workers());
const ratio = 1 - player.population() / max;
const ratio = 1 - player.adjustedPopulation() / max;
toAdd *= ratio;
if (player.type() == PlayerType.Bot) {
+1
View File
@@ -359,6 +359,7 @@ export interface Player {
// Resources & Population
gold(): Gold;
population(): number;
adjustedPopulation(): number;
workers(): number;
troops(): number;
targetTroopRatio(): number;
+5 -5
View File
@@ -639,12 +639,12 @@ export class PlayerImpl implements Player {
}
population(): number {
return (
Number(this._troops + this._workers) +
this.attackingTroops() +
this.boatTroops()
);
return Number(this._troops + this._workers);
}
adjustedPopulation(): number {
return this.population() + this.boatTroops() + this.attackingTroops();
}
private attackingTroops(): number {
return this._outgoingAttacks
.filter((a) => a.isActive())