nukes now reduce attacking troops and transport ships (same as rest of pop) (#350)

Co-authored-by: Evan <evanpelle@gmail.com>
This commit is contained in:
Ilan Schemoul
2025-03-31 12:39:18 -07:00
committed by GitHub
co-authored by Evan
parent 745017aee2
commit 11791719e4
8 changed files with 277 additions and 57 deletions
+11 -7
View File
@@ -13,14 +13,18 @@ export function constructionExecution(
x: number,
y: number,
unit: UnitType,
ticks = 4,
) {
game.addExecution(new ConstructionExecution(playerID, game.ref(x, y), unit));
// Init exec
game.executeNextTick();
// 4 ticks by default as it usually goes like this
// Init of construction execution
// Exec construction execution
game.executeNextTick();
// Add the execution related to the building
game.executeNextTick();
// First tick of the execution of the constructed structure/unit
game.executeNextTick();
// Tick of construction execution which adds the execution related to the building/unit
// First tick of the execution of the constructed building/unit
// (sometimes step 3 and 4 are merged in one)
for (let i = 0; i < ticks; i++) {
game.executeNextTick();
}
}