diff --git a/TODO.txt b/TODO.txt index a04f2af6f..47adb1869 100644 --- a/TODO.txt +++ b/TODO.txt @@ -224,7 +224,10 @@ * emojis should be displayed on top of your name not under it DONE 12/9/2024 * the notification for a successful trade should be shorter, example: " 70k Gold from trade with "X" " DONE 12/9/2024 * countries don't actually spawn with some randomness, it's always the same exact spawn DONE 12/9/2024 -* you should get a notification and a reward (some money) for eliminating an enemy (perhaps take wtvr gold the enemy had) +* you should get a notification and a reward (some money) for eliminating an enemy DONE 12/9/2024 +* alert on attack +* alert on unit captured or destroyed +* only check islands/clusters when being attacked * store in BigQuery * make boats work on lakes (& oceania) * record game winner @@ -233,11 +236,9 @@ * record commit hash of game * when player dies, don't remove atom bombs * remove alliance when player dies -* only check islands/clusters when being attacked -* alert on attack -* alert on unit captured or destroyed * put delay on adjust troop ratio to reduce number of messages * make clientID & playerID smaller +* remove dash from game id * allow longer names and allow them to be displayed in the Rank UI not be cut (many are cut for now, even for countries) * pause button in single player * when hovering over another player have the name not appear ontop of the exit cross diff --git a/src/core/execution/AttackExecution.ts b/src/core/execution/AttackExecution.ts index 2152ecb9e..4c8937fd7 100644 --- a/src/core/execution/AttackExecution.ts +++ b/src/core/execution/AttackExecution.ts @@ -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 {