Skip to content

Commit

Permalink
Update mafia.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
motogp-bit committed Dec 24, 2024
1 parent 017dfba commit 6903706
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions server/chat-plugins/mafia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1986,11 +1986,13 @@ export const pages: Chat.PageTable = {
buf += `<p><details><summary class="button" style="text-align:left; display:inline-block">Role Details</summary>`;
buf += `<table><tr><td style="text-align:center;"><img width="75" height="75" src="//${Config.routes.client}/fx/mafia-${role.image || 'villager'}.png"></td><td style="text-align:left;width:100%"><ul>${role.memo.map(m => `<li>${m}</li>`).join('')}</ul></td></tr></table>`;
buf += `</details></p>`;
for (let i = 0; i < game.dayNum; i++) {
previousActionsPL += `<b>Night ${i}</b><br/>`;
previousActionsPL += `${isPlayer.actionArr?.[i] ? `${isPlayer.actionArr[i]}` : ''}<br/>`;
}
if (game.phase === "day" || game.dayNum > 0) buf += `<p><details><summary class="button" style="text-align:left; display:inline-block">Previous Actions</summary>${previousActionsPL}</span></details></p>`;
for (let i = 0; i < game.dayNum; i++) {
previousActionsPL += `<b>Night ${i}</b><br/>`;
previousActionsPL += `${isPlayer.actionArr?.[i] ? `${isPlayer.actionArr[i]}` : ''}<br/>`;
}
if (game.phase === "day" || game.dayNum > 0) {
buf += `<p><details><summary class="button" style="text-align:left; display:inline-block">Previous Actions</summary>${previousActionsPL}</span></details></p>`;
}
}
}
if (game.phase === "day") {
Expand Down Expand Up @@ -2102,7 +2104,9 @@ export const pages: Chat.PageTable = {
buf += `: <button class="button" name="send" value="/msgroom ${room.roomid},/mafia revive ${eliminated.id}">Revive</button></p>`;
}
buf += `<hr/></details></p>`;
if (game.phase === "day" || game.dayNum > 0) buf += `<p><details><summary class="button" style="text-align:left; display:inline-block">Previous Night Actions</summary>${previousActions}</span></details></p>`;
if (game.phase === "day" || game.dayNum > 0) {
buf += `<p><details><summary class="button" style="text-align:left; display:inline-block">Previous Night Actions</summary>${previousActions}</span></details></p>`;
}
buf += `<p><details><summary class="button" style="text-align:left; display:inline-block">How to setup roles</summary>`;
buf += `<h3>Setting the roles</h3>`;
buf += `<p>To set the roles, use /mafia setroles [comma seperated list of roles] OR /mafia setroles [theme] in ${room.title}.</p>`;
Expand Down

0 comments on commit 6903706

Please sign in to comment.