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

This commit is contained in:
Ilan Schemoul
2025-03-29 01:37:47 +01: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;
if (!betrayed.isTraitor() && traitor === myPlayer) {
const malusPercent = Math.round(
(1 - this.game.config().traitorDefenseDebuff()) * 100,
);
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,
highlight: true,
createdAt: this.game.ticks(),