mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-13 18:29:15 +00:00
nukes cause more troop damage
This commit is contained in:
@@ -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
|
||||
// }
|
||||
}
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user