must build port before destroyer

This commit is contained in:
evanpelle
2024-11-13 15:31:31 -08:00
committed by Evan
parent 09ead3791d
commit febabf00db
3 changed files with 38 additions and 25 deletions
+3 -3
View File
@@ -1,4 +1,4 @@
import { Cell, Execution, Items, MutableGame, MutablePlayer, PlayerID, Tile } from "../game/Game";
import { Cell, Execution, BuildItems, MutableGame, MutablePlayer, PlayerID, Tile } from "../game/Game";
import { PseudoRandom } from "../PseudoRandom";
import { bfs, dist, euclideanDist, manhattanDist } from "../Util";
@@ -26,12 +26,12 @@ export class NukeExecution implements Execution {
}
tick(ticks: number): void {
if (this.sender.gold() < Items.Nuke.cost) {
if (this.sender.gold() < BuildItems.Nuke.cost) {
console.warn(`player ${this.sender} insufficient gold for nuke`)
this.active = false
return
}
this.sender.removeGold(Items.Nuke.cost)
this.sender.removeGold(BuildItems.Nuke.cost)
const rand = new PseudoRandom(this.mg.ticks())
const tile = this.mg.tile(this.cell)