Revert meta (#1002)

## Description:

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

## Please put your Discord username so you can be contacted if a bug or
regression is found:

<DISCORD USERNAME>

---------

Co-authored-by: 1brucben <1benjbruce@gmail.com>
This commit is contained in:
evanpelle
2025-06-01 19:02:26 -07:00
committed by GitHub
co-authored by 1brucben
parent 2e0d8242e2
commit 0aac91e56a
9 changed files with 97 additions and 121 deletions
-1
View File
@@ -446,7 +446,6 @@ export interface Player {
// Resources & Population
gold(): Gold;
population(): number;
totalPopulation(): number;
workers(): number;
troops(): number;
targetTroopRatio(): number;
-1
View File
@@ -105,7 +105,6 @@ export interface PlayerUpdate {
tilesOwned: number;
gold: number;
population: number;
totalPopulation: number;
workers: number;
troops: number;
targetTroopRatio: number;
-3
View File
@@ -229,9 +229,6 @@ export class PlayerView {
population(): number {
return this.data.population;
}
totalPopulation(): number {
return this.data.totalPopulation;
}
workers(): number {
return this.data.workers;
}
+1 -17
View File
@@ -109,7 +109,7 @@ export class PlayerImpl implements Player {
) {
this._flag = playerInfo.flag;
this._name = sanitizeUsername(playerInfo.name);
this._targetTroopRatio = 60n;
this._targetTroopRatio = 95n;
this._troops = toInt(startTroops);
this._workers = 0n;
this._gold = 0n;
@@ -139,7 +139,6 @@ export class PlayerImpl implements Player {
tilesOwned: this.numTilesOwned(),
gold: Number(this._gold),
population: this.population(),
totalPopulation: this.totalPopulation(),
workers: this.workers(),
troops: this.troops(),
targetTroopRatio: this.targetTroopRatio(),
@@ -652,21 +651,6 @@ export class PlayerImpl implements Player {
population(): number {
return Number(this._troops + this._workers);
}
totalPopulation(): number {
return this.population() + this.attackingTroops();
}
private attackingTroops(): number {
const landAttackTroops = this._outgoingAttacks
.filter((a) => a.isActive())
.reduce((sum, a) => sum + a.troops(), 0);
const boatTroops = this.units(UnitType.TransportShip)
.map((u) => u.troops())
.reduce((sum, n) => sum + n, 0);
return landAttackTroops + boatTroops;
}
workers(): number {
return Math.max(1, Number(this._workers));
}