feat: message to explain debuff to traitors (#351)

This commit is contained in:
Ilan Schemoul
2025-03-28 17:37:47 -07:00
committed by GitHub
parent b20a10564b
commit c890ae1507
+6 -1
View File
@@ -261,8 +261,13 @@ export class EventsDisplay extends LitElement implements Layer {
const traitor = this.game.playerBySmallID(update.traitorID) as PlayerView; const traitor = this.game.playerBySmallID(update.traitorID) as PlayerView;
if (!betrayed.isTraitor() && traitor === myPlayer) { if (!betrayed.isTraitor() && traitor === myPlayer) {
const malusPercent = Math.round(
(1 - this.game.config().traitorDefenseDebuff()) * 100,
);
this.addEvent({ this.addEvent({
description: `You broke your alliance with ${betrayed.name()}, making you a TRAITOR`, description:
`You broke your alliance with ${betrayed.name()}, making you a TRAITOR ` +
`(${malusPercent}% defense debuff)`,
type: MessageType.ERROR, type: MessageType.ERROR,
highlight: true, highlight: true,
createdAt: this.game.ticks(), createdAt: this.game.ticks(),