mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-23 04:15:25 +00:00
destroyer moves upwards
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { Colord } from "colord";
|
||||
import { Theme } from "../../../core/configuration/Config";
|
||||
import { Unit, UnitEvent, Cell, Game, Tile, UnitType } from "../../../core/game/Game";
|
||||
import { bfs, dist } from "../../../core/Util";
|
||||
import { bfs, dist, euclDist } from "../../../core/Util";
|
||||
import { Layer } from "./Layer";
|
||||
import { EventBus } from "../../../core/EventBus";
|
||||
|
||||
@@ -72,7 +72,13 @@ export class UnitLayer implements Layer {
|
||||
}
|
||||
|
||||
private handleDestroyerEvent(event: UnitEvent) {
|
||||
|
||||
bfs(event.oldTile, euclDist(event.oldTile, 3)).forEach(t => {
|
||||
this.clearCell(t.cell())
|
||||
})
|
||||
bfs(event.unit.tile(), euclDist(event.unit.tile(), 3))
|
||||
.forEach(t => this.paintCell(t.cell(), this.theme.borderColor(event.unit.owner().info()), 255))
|
||||
bfs(event.unit.tile(), euclDist(event.unit.tile(), 2))
|
||||
.forEach(t => this.paintCell(t.cell(), this.theme.territoryColor(event.unit.owner().info()), 180))
|
||||
}
|
||||
|
||||
private handleBoatEvent(event: UnitEvent) {
|
||||
|
||||
Reference in New Issue
Block a user