nukes cause more troop damage

This commit is contained in:
Evan
2024-11-17 09:36:12 -08:00
parent b5a8339eb3
commit 0d5f514c48
2 changed files with 12 additions and 7 deletions
+6 -6
View File
@@ -24,11 +24,11 @@ export const devConfig = new class extends DefaultConfig {
return 100
}
numBots(): number {
return 400
}
// numBots(): number {
// return 400
// }
boatMaxDistance(): number {
return 2000
}
// boatMaxDistance(): number {
// return 2000
// }
}
+6 -1
View File
@@ -67,12 +67,17 @@ export class NukeExecution implements Execution {
return (d <= this.magnitude || rand.chance(2)) && d <= this.magnitude + 40
})
const ratio = Object.fromEntries(
this.mg.players().map(p => [p.id(), p.troops() / p.numTilesOwned()])
)
for (const tile of toDestroy) {
const owner = tile.owner()
if (owner.isPlayer()) {
const mp = this.mg.player(owner.id())
mp.relinquish(tile)
mp.removeTroops(mp.troops() / mp.numTilesOwned())
mp.removeTroops(ratio[mp.id()])
}
}
this.mg.units()