Ma Sói Rules Auditor
Workflow
- Read
server/gameEngine.jsbefore changing role counts or role metadata. - Read the relevant resolution code in
server/index.js:night_action,night_skip,checkNightComplete,resolveNight,resolveVote,endGame. - Check the change against
references/rules.md. - Verify server and client still agree on hidden information:
- Dead roles may be revealed.
- Own role is visible.
- Wolf teammates are visible only to wolves.
- Seer gets only wolf / not-wolf, not exact village role.
- After edits, run at least:
node --check server/index.jsnode --check server/gameEngine.jscd client && npm run buildwhen client code changed.
Review Checklist
- Wolf count is
4-5 => 1,6-9 => 2,10+ => 3. WOLF_KINGdoes not appear by default before 10 players.- Wolves share one night target and the last valid target wins.
- Doctor can self-save, cannot save the same target two nights in a row, and never learns the wolf target.
- Witch can use at most one action per night, cannot self-save, cannot self-poison, and save only applies to the wolf target.
- Hunter can shoot after dying by wolf, poison, or hanging.
- Wolf King drags only when hanged by vote.
- Idiot survives first hanging, reveals role, and loses future voting rights.
- Win condition remains: village wins when all wolves die; wolves win when living wolves are at least living non-wolves.
References
Load references/rules.md when a task touches role behavior, phase resolution, role balance, or gameplay edge cases.