Описание
## Cobblemon Sports Betting (Server-Side)
Bet on Cobblemon battles using in-game item currency.
---
## Features
- Betting on head-to-head matches with settable odds (A vs B)
- Numismatic Overhaul coins as currency (bronze/silver/gold)
- Chest-style GUIs for betting and props/parlays
- Bossbar:
- Odds display while betting is open
- Live “A vs B” with remaining Pokémon during battles
- Winner rainbow bossbar
- Automatic payout resolution with House Pays or pooled-scaling modes
- Props & Parlays: First Faint A/B
- Gated /openprops while betting is open
- NPC trainer battle support (PvE) inside the arena
## Currency
Accepted items:
- Tag: `my_betting_mod:currency` (datapack-editable)
- Defaults if Numismatic Overhaul is present:
- `numismatic-overhaul:bronze_coin` (1 bronze)
- `numismatic-overhaul:silver_coin` (100 bronze)
- `numismatic-overhaul:gold_coin` (10,000 bronze)
Accounting and payouts are done in bronze units and paid out with highest denominations first.
---
## GUIs
### Betting Menu (`/openbetmenu`)
- A (emerald) and B (redstone) buttons show names and odds.
- Center stake slot accepts only currency items.
- Confirm (gold ingot): reads your stake in the slot, converts to bronze, and places a bet.
- Take Back Bet: refunds your confirmed bets while betting is open.
- Behavior mirrors prepaid flow: the slot isn’t cleared until you confirm successfully.
### Props/Parlay Menu (`/openprops` while betting is open)
- Add 1–2 legs:
- First Faint A or B (multiplier from config)
- Stake slot accepts only currency; coins remain visible until you confirm successfully.
- Place Parlay: on success, creates a slip and sound cue (if enabled).
---
## Bossbar & Arena Lifecycle
- Auto-open when exactly one player is in Area A and one player is in Area B (same dimension), unless in cooldown.
- Betting odds are displayed on a bossbar to nearby players.
- At battle start, betting closes and bossbar switches to live mode with remaining Pokémon counts.
- At battle end, a winner bossbar appears (rainbow); optional fireworks can be launched at a configured position.
---
## Odds, Payouts, and Slips
- House Pays ON: winners are paid full odds; losers lose stake.
- House Pays OFF: winners are paid from the loser pool; if insufficient, payouts scale down with a percentage shown on slips. If no opposing bets exist, winners are refunded.
- Result slips on resolution (when receipts are enabled):
- WON: shows stake and payout, glint enabled; includes scaled % when applicable
- LOST: shows target and lost stake
- REFUND: shows refund amount when no opposing bets existed
- Parlay slips on resolution:
- Win: combined multiplier, stake, leg details, glint
- Loss: failed leg noted, no glint
---
## Regions & Fireworks
Define three regions:
- Area A: waiting area for Player A
- Area B: waiting area for Player B
- Arena: actual battle area
Fireworks (optional): set a dimension and BlockPos to launch a few bursts on winner announcement.
Regions and fireworks are stored in the mod’s JSON config and editable in-game via the Admin Menu.
---
## Commands
Player:
- `/openbetmenu` — open betting menu (when betting is open)
- `/openprops` — open props/parlay menu (gated to betting open)
- `/bethelp [props|admin]` — in-game help
Admin:
- `/setodds ` — set odds (x100)
- `/odds add|remove|list` — manage predefined odds for pairs
- `/openadminmenu` — toggle House Pays, Auto-Open, regions, fireworks
- `/betflags receipts|sounds|self on|off` — feature toggles
- `/betprops show|set firstfaintmult|totaloverthr|totalovermult` — props configuration
- `/betdebug menu|reset|resolve ` — testing and manual resolution helpers
---
## Configuration
Feature Flags (`/betflags`):
- Receipts — give bet/parlay placement slips and result slips
- Sounds — play UI click sounds on confirms
- Self — disallow betting on your own match
Props (`/betprops`):
- First Faint multiplier (x100)
- Total Faints Over threshold
- Total Faints Over multiplier (x100)
Predefined Odds (`/odds`):
- Save commonly used A/B odds and auto-apply on auto-open.
House Pays:
- When enabled, full advertised payouts are covered by the house.
Cool-down and Winner delay:
- Short cool-down prevents instant re-open; winner bossbar has a display window before odds reappear.
---
## License
This project inherits its license from the original template. See `LICENSE`.