Skip to content

Commit

Permalink
Merge pull request #219 from Ido-Barnea/210-write-where-a-piece-spawned
Browse files Browse the repository at this point in the history
Write where a piece spawned in kill log
  • Loading branch information
Ido-Barnea authored Feb 21, 2024
2 parents 2350c86 + 97e362b commit 28d9bbe
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions development/code/ui/logs/Log.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import {
HELL_BOARD_ID,
NOTATIONS_LETTERS,
NOTATIONS_NUMBERS,
VOID_BOARD_ID,
} from '../../Constants';
import { Piece } from '../../logic/pieces/Piece';
import { Position } from '../../logic/pieces/PiecesUtilities';
import { HELL_BOARD } from '../BoardManager';
import { Logger } from './Logger';

export enum LogColor {
Expand Down Expand Up @@ -66,9 +68,12 @@ export class KillLog extends Log {
let message = `${killedPieceIcon} ${killedPieceColor} ${killedPieceName} was `;

if (killedPiece.position.boardId === VOID_BOARD_ID) {
message += 'permanently ';
message += 'permanently killed by ';
} else {
const spawnedInBoard =
killedPiece.position.boardId === HELL_BOARD_ID ? 'Hell' : 'Heaven';
message += `sent to ${spawnedInBoard} by `;
}
message += 'killed by ';

if (cause instanceof Piece) {
const {
Expand Down

0 comments on commit 28d9bbe

Please sign in to comment.