mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-25 15:54:36 +00:00
attack troops no longer show in pop display
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -359,6 +359,7 @@ export interface Player {
|
||||
// Resources & Population
|
||||
gold(): Gold;
|
||||
population(): number;
|
||||
adjustedPopulation(): number;
|
||||
workers(): number;
|
||||
troops(): number;
|
||||
targetTroopRatio(): number;
|
||||
|
||||
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user