This commit is contained in:
evanpelle
2024-11-13 15:08:51 -08:00
committed by Evan
parent 4236a580e3
commit 09ead3791d
3 changed files with 107 additions and 45 deletions
+7 -1
View File
@@ -1,8 +1,10 @@
import { AllPlayers, Cell, Execution, MutableGame, MutablePlayer, PlayerID } from "../game/Game";
import { AllPlayers, Cell, Execution, MutableGame, MutablePlayer, PlayerID, UnitType } from "../game/Game";
export class PortExecution implements Execution {
private active = true
private mg: MutableGame
private player: MutablePlayer
constructor(
private _owner: PlayerID,
@@ -11,9 +13,13 @@ export class PortExecution implements Execution {
init(mg: MutableGame, ticks: number): void {
this.mg = mg
this.player = mg.player(this._owner)
}
tick(ticks: number): void {
this.player.addUnit(UnitType.Port, 0, this.mg.tile(this.cell))
this.active = false
}
owner(): MutablePlayer {
+1 -1
View File
@@ -38,7 +38,7 @@ export class Item {
export const Items = {
Nuke: new Item("Nuke", 1_000_000),
Destroyer: new Item("Destroyer", 10),
Port: new Item("Port", 10)
Port: new Item("Port", 0)
} as const;
export class Nation {