Skip to content

Commit

Permalink
Fiddle change (#1772)
Browse files Browse the repository at this point in the history
when fiddled, can see who speaks but not the content of message

---------

Co-authored-by: Golbolco <[email protected]>
  • Loading branch information
drewsworthh and Golbolco authored Dec 3, 2024
1 parent e3a33a0 commit 1e8b566
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Games/core/Player.js
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,11 @@ module.exports = class Player {
for (let effect of this.effects) {
effect.hear(message);
if (message.cancel) return;
if(message.fiddled){
message = originalMessage;
message.content = message.sender.name + " says something, but you cannot hear them!";
message.modified = true;
break; }
}

if (!message.modified) message = originalMessage;
Expand Down
2 changes: 1 addition & 1 deletion Games/types/Mafia/effects/Fiddled.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = class Fiddled extends Effect {

hear(message) {
if (!message.isServer && message.sender != this.player) {
message.cancel = true;
message.fiddled = true;
}
}

Expand Down

0 comments on commit 1e8b566

Please sign in to comment.