import { ItemMove } from '@gamepark/rules-api'; import { MaterialSoundConfig } from './MaterialSoundConfig'; /** * How a material sounds when it is handled — not what it is made of. * * The distinction is the whole point of this enum being a choice rather than a physical property. Coins * punched out of cardboard want the metallic sound of coins, because that is the sound the game is asking the * player to imagine; a wooden meeple and a plastic one are told apart by ear far less than a meeple and a * card. So a game picks the sound it wants to hear, and it picks it in one line: * * ```ts * export class MyTokenDescription extends TokenDescription { * soundKit = SoundKit.Wood * } * ``` * * Cards and dice do not expose the choice on purpose: a card sounds like a card in every game, and there is * nothing to gain from letting each one re-answer a question with one sensible answer. */ export declare enum SoundKit { Card = 0, Cardboard = 1, Wood = 2, Coin = 3, Chip = 4, Dice = 5 } /** * Build a default sound from a file published in `sounds/`. * * The volume is always low, and deliberately so. These sounds play in every game, on moves no one asked to * hear, and a default that is a touch too loud is not a small annoyance to be tuned later — it is the reason * a player reaches for the mute button once and never turns the sound back on. A game that wants its own * sound to be prominent raises it itself. */ export declare const defaultSound: (file: string, volume: number) => MaterialSoundConfig; /** * The rustle of a rulebook page, played when a dialog the player asked for opens — a material help, a * tutorial popup. Not every dialog: what it marks is text arriving to be read. * * It is declared here rather than next to the hook that plays it so that `check-sounds` sees it: that script * reads this file alone, and a default sound named anywhere else is a URL nothing guards against a rename. */ export declare const openDialogSound: MaterialSoundConfig; /** * The moves animated back-to-back with the one being resolved, in the same action. * * Some moves only make sense counted. `Material.rollItems()` produces one {@link RollItem} per die, so a * player throwing five dice produces five moves that the framework animates one after the other — and a * handful of dice thrown together is not the sound of one die, played five times. This is what lets a kit * pick the sound of the gesture rather than the sound of the move. */ export type SoundBatch = { /** How many moves of that same kind are animated in a row, this one included. */ size: number; /** Whether this move opens the run. A kit that plays one sound for the whole batch stays silent otherwise. */ first: boolean; }; /** * The sounds a kit plays for one move, in the order they are scheduled, or none when the move is better * left silent. * * Silence is a real answer here, and it is the one given to {@link ItemMoveType.Select}: selecting fires when * a player merely designates an item, several times a turn and often just to look at it, so a click on every * one of them turns into a stutter. * * @param kit the kit the material was given * @param move the move being animated * @param batch the moves animated in a row with it, see {@link SoundBatch} * @returns the sounds to play, empty to stay silent */ export declare const getSoundKitMoveSounds: (kit: SoundKit, move: ItemMove, batch: SoundBatch) => MaterialSoundConfig[]; /** * Every sound a kit can play, so they are all fetched and decoded before the game starts. * * A default that is only discovered when the move happens would be silent the first time it plays, which is * the one time anybody notices. This list must therefore stay exactly what {@link getSoundKitMoveSounds} can * return — no more, or every game pays for samples it never plays. * * @param kit the kit, or undefined for a material that makes no sound of its own * @returns the sounds to preload */ export declare const getSoundKitSounds: (kit?: SoundKit) => MaterialSoundConfig[];