@oasis-discord/game-blocks
v0.1.0
Published
Shared game logic blocks for the Oasis Discord ecosystem
Downloads
141
Readme
@oasis-discord/game-blocks
Shared game logic blocks for the Oasis Discord ecosystem. Pure TypeScript — no database calls, no HTTP calls. Import what you need, configure it, use it.
Install
npm install @oasis-discord/game-blocksBlocks
| Block | Import | Description |
|---|---|---|
| Turn Management | TurnManager | Player queue, advance, skip, timeout |
| Lobby System | Lobby | Join/leave/ready, host controls, player gates |
| State Machine | StateMachine | Named states, transitions, guards, hooks |
| Game Phase | GamePhase | Named phases with per-phase rules |
| Score Tracking | ScoreTracker | Points per player, leaderboard, tiebreaker |
| Player Elimination | EliminationTracker | Remove players, mark spectators |
| Lives / HP | LivesSystem | Counter with floor, decrement, zero-detection |
| Role Assignment | RoleAssigner | Assign roles from pool to players |
| Weighted RNG | weightedRandom | Weighted random selection |
| Payout Table | PayoutTable | Config table + inputs → payout multiplier |
| Prompt Collection | PromptCollector | Collect N responses, reveal on trigger |
| Judge Rotation | JudgeRotation | Circular czar/judge queue |
| Image Rendering | renderBoard | Sharp-based board/grid image |
| Image Compositing | compositeImage | Stack image layers into one scene |
| Reaction Threshold | ReactionThreshold | Fire callback when reaction hits count |
| Cooldown Engine | CooldownEngine | Per-user per-action TTL via Redis |
License
MIT
