Have MIRV damage asymptote to 5% of total population (#1570)

## Description:

Decreasing MIRV warhead blast radius nerfed them too much, so have them
destroy 95% of population.

## 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 have read and accepted the CLA aggreement (only required once).

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

evan
This commit is contained in:
evanpelle
2025-07-25 15:44:32 -07:00
committed by GitHub
parent 65937b7e69
commit 932d4f3be2
3 changed files with 52 additions and 8 deletions
+28 -4
View File
@@ -203,6 +203,10 @@ export class NukeExecution implements Execution {
const toDestroy = this.tilesToDestroy();
this.maybeBreakAlliances(toDestroy);
const maxPop = this.target().isPlayer()
? this.mg.config().maxPopulation(this.target() as Player)
: 1;
for (const tile of toDestroy) {
const owner = this.mg.owner(tile);
if (owner.isPlayer()) {
@@ -210,25 +214,45 @@ export class NukeExecution implements Execution {
owner.removeTroops(
this.mg
.config()
.nukeDeathFactor(owner.troops(), owner.numTilesOwned()),
.nukeDeathFactor(
this.nukeType,
owner.troops(),
owner.numTilesOwned(),
maxPop,
),
);
owner.removeWorkers(
this.mg
.config()
.nukeDeathFactor(owner.workers(), owner.numTilesOwned()),
.nukeDeathFactor(
this.nukeType,
owner.workers(),
owner.numTilesOwned(),
maxPop,
),
);
owner.outgoingAttacks().forEach((attack) => {
const deaths =
this.mg
?.config()
.nukeDeathFactor(attack.troops(), owner.numTilesOwned()) ?? 0;
.nukeDeathFactor(
this.nukeType,
attack.troops(),
owner.numTilesOwned(),
maxPop,
) ?? 0;
attack.setTroops(attack.troops() - deaths);
});
owner.units(UnitType.TransportShip).forEach((attack) => {
const deaths =
this.mg
?.config()
.nukeDeathFactor(attack.troops(), owner.numTilesOwned()) ?? 0;
.nukeDeathFactor(
this.nukeType,
attack.troops(),
owner.numTilesOwned(),
maxPop,
) ?? 0;
attack.setTroops(attack.troops() - deaths);
});
}