mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-04 12:16:09 +00:00
alert when getting attacked
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { PriorityQueue } from "@datastructures-js/priority-queue";
|
||||
import { Cell, Execution, MutableGame, MutablePlayer, Player, PlayerID, TerrainType, TerraNullius, Tile } from "../game/Game";
|
||||
import { Cell, Execution, MutableGame, MutablePlayer, Player, PlayerID, PlayerType, TerrainType, TerraNullius, Tile } from "../game/Game";
|
||||
import { PseudoRandom } from "../PseudoRandom";
|
||||
import { manhattanDist } from "../Util";
|
||||
import { MessageType } from "../../client/graphics/layers/EventsDisplay";
|
||||
@@ -87,6 +87,9 @@ export class AttackExecution implements Execution {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this._owner.type() != PlayerType.Bot && this.target.isPlayer() && this.target.type() == PlayerType.Human) {
|
||||
mg.displayMessage(`You are being attacked by ${this._owner.displayName()}`, MessageType.ERROR, this._targetID)
|
||||
}
|
||||
if (this.sourceCell != null) {
|
||||
this.addNeighbors(mg.tile(this.sourceCell))
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user