Files
spigot-tyrant/design/concepts/game-state-machine.md
T

36 lines
2.2 KiB
Markdown

---
type: Design Concept
title: Tyrant Game State Machine
description: Defines lifecycle, succession, selection, and pause behavior for a Tyrant game.
---
# Tyrant Game State Machine
## Lifecycle
The game begins unstarted. An administrator starts it by assigning the first Tyrant; the administrator may explicitly assign the first Vigilante or allow selection from eligible recently active players. A running game may be paused without deleting its state and later resumed.
Pausing freezes gameplay progression, role inactivity checks, pending-selection deadlines, ability cooldowns, and daily-use timers. Role and class effects are suppressed while paused and restored on resume.
## Tyrant succession
When a player directly kills the Tyrant, that killer becomes the new Tyrant. When no player is credited with the death, an eligible opted-in player active during the preceding 24 hours is selected randomly. The former Tyrant is excluded when another candidate exists.
Every Tyrant death ends the reign, clears all role-side assignments, resets the former Tyrant's reign progression, and requires a new Vigilante. The new Tyrant receives one starting unlock choice.
## Vigilante succession
Every Vigilante death ends that assignment regardless of cause. A replacement is selected randomly from eligible opted-in players active during the preceding 24 hours. The Tyrant is never eligible. The previous Vigilante is excluded when another eligible non-Tyrant exists and may be selected again only as a fallback. Followers are cleared rather than transferred.
A Tyrant earns progression from the death only when the Tyrant personally killed the Vigilante.
## Pending selections
An offline random selectee has 24 hours of unpaused time to log in and confirm the assignment. Failure causes another selection. When no eligible candidate exists, the position remains vacant and selection retries periodically without assigning the Tyrant to both roles.
## Related stories
- [Start, pause, and administer the game](../user-stories/us-001-start-pause-and-administer.md)
- [Transfer and reset the Tyrant role](../user-stories/us-002-transfer-and-reset-tyrant.md)
- [Handle inactivity and pending selections](../user-stories/us-010-handle-inactivity-and-selection.md)