Conversation
22Chaos
commented
Mar 3, 2026
- Percival, Morgana, and Merlin now only see question marks if deceptive roles (Morgana,Melron,Moregano) are in play
- Refactor role visibility logic for self-visibility
- Post-game announcements for spiesMelronSaw and spiesMoreganoSaw now only triggered if respective roles are in play
- Percival, Morgana, and Merlin now only see question marks if deceptive roles (Morgana,Melron,Moregano) are in play - Refactor role visibility logic for self-visibility - Post-game announcements for spiesMelronSaw and spiesMoreganoSaw now only triggered if respective roles are in play
|
|
||
| private announceIllusionsIfAny() { | ||
| // Melron | ||
| if(this.resRoles.includes(Role.Melron)) { |
There was a problem hiding this comment.
Please format code with prettier
| if(this.resRoles.includes(Role.Melron)) { | ||
| const melronRole = this.specialRoles[Role.Melron]; | ||
| if (melronRole) { | ||
| if (melronRole) { //TODO: is this if required now? |
There was a problem hiding this comment.
Your comment is correct. Let's remove this.
| roleTags[ | ||
| this.room.anonymizer.anon(this.room.playersInGame[i].username) | ||
| ] = this.role; | ||
| } |
There was a problem hiding this comment.
Are you saying that currently in anon games, you don't see your own role tag in the UI?
Edit: Thinking about this a bit more, we should solve this a different way. It looks like the UI renders its own role tag through a different code path.
| ) | ||
| merlinsCount++; | ||
| } | ||
| for (let i = 0; i < this.room.playersInGame.length; i++) { |
There was a problem hiding this comment.
Please space it out and fix formatting too 🙏
| moreganoExists = true; | ||
| break; | ||
| } | ||
| else continue; |
There was a problem hiding this comment.
This line doesn't do anything :)
| roleTags[ | ||
| this.room.anonymizer.anon(this.room.playersInGame[i].username) | ||
| ] = moreganoExists ? "Morgana?" : this.role; | ||
| } |
| ] = 'Hitberon'; | ||
| } | ||
|
|
||
|
|
| { | ||
| roleTags[ | ||
| this.room.anonymizer.anon(this.room.playersInGame[i].username) | ||
| ] = moreganoExists ? "Morgana?" : this.role; |
There was a problem hiding this comment.
ProAvalon/src/gameplay/gameEngine/game.ts
Lines 1062 to 1067 in 20e774c
This is currently where we give the role that is displayed. Can we instead of doing all this logic, simply send to the client whether to show an extra "?" on the UI side?
| if (playerData.username === gameData.username) { | ||
| //if rendering our own player, give it the role tag | ||
| //if he is vanilla resistance or vanilla spy | ||
| if (playerData.username === gameData.username && gameData.role === gameData.alliance) { |