diff --git a/src/client/graphics/layers/EventsDisplay.ts b/src/client/graphics/layers/EventsDisplay.ts index 1178ddda4..407658016 100644 --- a/src/client/graphics/layers/EventsDisplay.ts +++ b/src/client/graphics/layers/EventsDisplay.ts @@ -80,6 +80,17 @@ export class EventsDisplay extends LitElement implements Layer { this.events = remainingEvents; this.requestUpdate(); } + + const myPlayer = this.game.myPlayer(); + if (!myPlayer) { + return; + } + myPlayer.incomingAttacks().forEach((a) => { + // console.log(`got incoming attack: ${JSON.stringify(a)}`); + }); + myPlayer.outgoingAttacks().forEach((a) => { + // console.log(`got outgoing attack: ${JSON.stringify(a)}`); + }); } private addEvent(event: Event) { @@ -125,10 +136,10 @@ export class EventsDisplay extends LitElement implements Layer { } const requestor = this.game.playerBySmallID( - update.requestorID, + update.requestorID ) as PlayerView; const recipient = this.game.playerBySmallID( - update.recipientID, + update.recipientID ) as PlayerView; this.addEvent({ @@ -139,7 +150,7 @@ export class EventsDisplay extends LitElement implements Layer { className: "btn", action: () => this.eventBus.emit( - new SendAllianceReplyIntentEvent(requestor, recipient, true), + new SendAllianceReplyIntentEvent(requestor, recipient, true) ), }, { @@ -147,7 +158,7 @@ export class EventsDisplay extends LitElement implements Layer { className: "btn-info", action: () => this.eventBus.emit( - new SendAllianceReplyIntentEvent(requestor, recipient, false), + new SendAllianceReplyIntentEvent(requestor, recipient, false) ), }, ], @@ -156,7 +167,7 @@ export class EventsDisplay extends LitElement implements Layer { createdAt: this.game.ticks(), onDelete: () => this.eventBus.emit( - new SendAllianceReplyIntentEvent(requestor, recipient, false), + new SendAllianceReplyIntentEvent(requestor, recipient, false) ), }); } @@ -168,7 +179,7 @@ export class EventsDisplay extends LitElement implements Layer { } const recipient = this.game.playerBySmallID( - update.request.recipientID, + update.request.recipientID ) as PlayerView; this.addEvent({ @@ -213,8 +224,8 @@ export class EventsDisplay extends LitElement implements Layer { update.player1ID === myPlayer.smallID() ? update.player2ID : update.player2ID === myPlayer.smallID() - ? update.player1ID - : null; + ? update.player1ID + : null; const other = this.game.playerBySmallID(otherID) as PlayerView; if (!other || !myPlayer.isAlive() || !other.isAlive()) return; @@ -250,7 +261,7 @@ export class EventsDisplay extends LitElement implements Layer { ? AllPlayers : this.game.playerBySmallID(update.emoji.recipientID); const sender = this.game.playerBySmallID( - update.emoji.senderID, + update.emoji.senderID ) as PlayerView; if (recipient == myPlayer) { @@ -306,7 +317,7 @@ export class EventsDisplay extends LitElement implements Layer { (event, index) => html`