KAZIK/docs/native-slots.md
Artvasil09 881a0061dc Add native NPC visitors with contracts, Clover slots, Pyramid, and party table scenes
Implement 32x32 BFS visitor navigation and daily contracts system with companion .npc journals; add native assembly scenes for Clover slots, Pyramid cards, Blackjack Party and Russian Party; package animation and sprite packs; add comprehensive offline test suites and rebuild shipping binaries.
2026-10-13 09:47:33 +03:00

67 lines
3.7 KiB
Markdown

# Native 777
The 777 cabinet in the hall now opens a playable first-person graphical slot
machine, rather than the unavailable panel or a console routine. Runtime rules,
input, reel movement, sprite clipping and bank settlement are MASM only.
## Rules
There is one paying line: the middle symbol on each of three independent drums.
Each drum has 20 stops, with these symbol counts: cherries 5, lemon 4, grapes 3,
bell 3, BAR 2, seven 1, diamond 1 and crown 1. Stops are sampled once when the
stake is charged; animation and repeated renderer calls cannot reroll them.
Three matches pay gross multipliers: seven 100, cherries 8, lemon 10, bell 15,
BAR 25, grapes 12, diamond 60 and crown 150. Exactly two cherries pay 2x;
any other exact pair returns 1x. No match pays nothing. Gross payouts include
the charged stake. The footer separates actual credited payout from signed net
profit/loss. An exact non-cherry pair is a neutral stake refund, with no victory
sound or winning-line flash. The pay table identifies the middle paying line.
Under independently and uniformly sampled stops the configured return is
7202 / 8000 = 90.025%; this is not a guarantee of individual-session results.
Stake choices are 10, 50, 100, 500, 1000, 5000 and 10000. The native bank cap
remains 1000000000. Stakes are saved immediately and outcomes are settled and
saved once. An insufficient bankroll never starts a paid spin.
## Interaction
Space/Enter and the spin button start one spin; W/S, arrow keys or the minus/plus
buttons change the stake between spins. P or the payouts button opens a separate
paytable. Escape first closes that overlay without leaving the machine.
During a spin, Escape or the header exit button queues a return to the same hall
position after all three drums stop and the payout is saved. It does not pause,
refund, forfeit a valid result, or allow another stake to be queued. Closing the
application before settlement retains the already deducted stake; resumable
pending rounds are not implemented.
## Art And Timing
The cabinet and eight symbol sprites were generated with the built-in image_gen
tool in the existing detailed retro pixel-art direction. Source assets and exact
prompts are in `assets/sprites/slots/`; the project does not depend on the tool's
external image cache. `pack_slot_assets.py` normalizes them offline to one
opaque 640x480 cabinet and eight alpha-tested 64x64 symbols in ANM1 packs.
Reels move through their complete strips with a monotonic quadratic ease-out,
stopping at 1800, 2400 and 3000 milliseconds. Icons are clipped to each reel's
window; neighboring cabinet artwork cannot be overwritten. The opaque cabinet
uses a direct framebuffer copy rather than alpha sampling every background pixel.
No pre-rendered spin video, C game implementation or frame-dependent RNG is used.
## Verification
`test_casino_actions.ps1 -SkipPreview` includes 8000 stop combinations, 500
complete spins at four update rates, millisecond-by-millisecond monotonicity,
idempotent payout, maximum-bank handling, missing/malformed assets, insufficient
stakes, paytable and queued exit checks. Test saves remain disabled in the
native test build. `check_slot_frames.py` checks eight real MASM framebuffer
snapshots, sequential stops and symbol clipping. `check_slot_build.py` compares
the shipping and test COFF code for every slot handler.
`test_street_asset_paths.ps1` also initializes/frees the shipping native slot
cabinet from project-root and TEMP working directories, without launching a window.
CloverPit now has a separate native 5x3 machine; see `native-clover.md`. Talisman
effects, native achievements and slot-specific profile statistics still need
separate integration; neither machine calls their legacy console implementations.