@energy8platform/game-engine 0.33.8 → 0.33.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/slot.d.ts CHANGED
@@ -918,6 +918,18 @@ interface CreateReelSystemOptions {
918
918
  /** Custom feature modules to register alongside the 13 built-ins. */
919
919
  features?: ReelFeature[];
920
920
  }
921
+ /** Options for a stepped chain (`cascade` / `reelStep`). */
922
+ interface StepRunOpts<TStep> {
923
+ turbo?: boolean;
924
+ /** Carry the running multiplier across free spins (with `cascade.multiplier.persistInFreeSpins`). */
925
+ freeSpins?: boolean;
926
+ /**
927
+ * Fires after each step has settled, with the step's index and the running multiplier AFTER it.
928
+ * The hook for a step-by-step payout readout: report the win accrued so far to the shell via
929
+ * `api.shell.reportWin(...)`. Awaited, so an async hook paces the chain.
930
+ */
931
+ onStep?: (index: number, step: TStep, multiplier: number) => void | Promise<void>;
932
+ }
921
933
  interface ReelSystem {
922
934
  /** Root container — add this to your scene. */
923
935
  readonly view: Container;
@@ -935,20 +947,16 @@ interface ReelSystem {
935
947
  /** Replace the whole config. */
936
948
  setConfig(config: ReelSystemConfig): void;
937
949
  spin(target: CellData[][], opts?: SpinRunOpts): Promise<void>;
938
- /** Run a cascade chain. With `freeSpins` + `cascade.multiplier.persistInFreeSpins`, the multiplier carries over instead of resetting. */
939
- cascade(steps: TumbleStep[], opts?: {
940
- turbo?: boolean;
941
- freeSpins?: boolean;
942
- }): Promise<void>;
950
+ /** Run a cascade chain. With `freeSpins` + `cascade.multiplier.persistInFreeSpins`, the multiplier
951
+ * carries over instead of resetting. Generic in the step type, so `onStep` hands back the game's
952
+ * own step (with its per-step win) rather than the bare TumbleStep. */
953
+ cascade<TStep extends TumbleStep>(steps: TStep[], opts?: StepRunOpts<TStep>): Promise<void>;
943
954
  /**
944
955
  * Run a ReelStep™ chain: each step pays its winning cells, then scrolls every reel down by
945
956
  * `shifts[col]` positions (0 = reel stays put). Multiplier carries over with `freeSpins` +
946
957
  * `cascade.multiplier.persistInFreeSpins`, same as `cascade`.
947
958
  */
948
- reelStep(steps: ReelStepData[], opts?: {
949
- turbo?: boolean;
950
- freeSpins?: boolean;
951
- }): Promise<void>;
959
+ reelStep<TStep extends ReelStepData>(steps: TStep[], opts?: StepRunOpts<TStep>): Promise<void>;
952
960
  /** Current running cascade / reel-step multiplier. */
953
961
  readonly multiplier: number;
954
962
  /** Register a custom feature (or override a built-in by reusing its key). */
@@ -1049,4 +1057,4 @@ declare class MultiplierAccumulator {
1049
1057
  }
1050
1058
 
1051
1059
  export { AnimatedSymbol, AnticipationController, BigWinOverlay, CascadeController, CountUpDisplay, DEFAULT_REEL_CONFIG, EASING_BY_NAME, FEATURES, FEATURE_KEYS, FEATURE_LIST, INTENSITY_SCALE, MultiplierAccumulator, PRESETS, PRESET_LIST, ReelGrid, ReelSpinController, ReelStepController, SpinEngine, SymbolCell, TumbleController, buildReelStepTape, cellPositionOf, createReelSystem, easingByName, effectiveRowsPerReel, mergeReelConfig, pickTier, resolveGeometry, resolveGridGeometry, resolveReelConfig, tierIndexAtValue, valueAt, waysCount };
1052
- export type { AnimatedSymbolConfig, AnticipationConfig, AnticipationDecision, BigWinOverlayConfig, BlurConfig, CarryPolicy, CascadeAnim, CascadeConfig, CascadeStepData, CascadeTimings, CellData, CellFrameStyle, CellSizeSpec, CellState, CountUpConfig, CreateReelSystemOptions, DecorationConfig, DeepPartial, EasingName, EvaluationMode, ExpandingWildConfig, FeatureContext, FeatureKey, FeaturesConfig, GeometryInput, GiantConfig, GridConfig, HoldAndSpinConfig, Intensity, MotionConfig, MotionStyle, MultiplierConfig, MysteryConfig, NudgeConfig, PresetId, RandomWildConfig, ReelFeature, ReelGridConfig, ReelModifierConfig, ReelPreset, ReelSpinData, ReelSpinTimings, ReelStepData, ReelStopPlan$1 as ReelStopPlan, ReelSystem, ReelSystemConfig, ResolvedGeometry, SettleConfig, SpinData, SpinRunOpts, ReelStopPlan as SpinStopPlan, SplitConfig, SquashConfig, StackedConfig, StickyConfig, StopMode, StopOrder, SymbolCellConfig, SymbolResolver, SymbolTextures, SymbolView, TransformConfig, TumbleStep, WalkingWildConfig, WinConfig, WinTier };
1060
+ export type { AnimatedSymbolConfig, AnticipationConfig, AnticipationDecision, BigWinOverlayConfig, BlurConfig, CarryPolicy, CascadeAnim, CascadeConfig, CascadeStepData, CascadeTimings, CellData, CellFrameStyle, CellSizeSpec, CellState, CountUpConfig, CreateReelSystemOptions, DecorationConfig, DeepPartial, EasingName, EvaluationMode, ExpandingWildConfig, FeatureContext, FeatureKey, FeaturesConfig, GeometryInput, GiantConfig, GridConfig, HoldAndSpinConfig, Intensity, MotionConfig, MotionStyle, MultiplierConfig, MysteryConfig, NudgeConfig, PresetId, RandomWildConfig, ReelFeature, ReelGridConfig, ReelModifierConfig, ReelPreset, ReelSpinData, ReelSpinTimings, ReelStepData, ReelStopPlan$1 as ReelStopPlan, ReelSystem, ReelSystemConfig, ResolvedGeometry, SettleConfig, SpinData, SpinRunOpts, ReelStopPlan as SpinStopPlan, SplitConfig, SquashConfig, StackedConfig, StepRunOpts, StickyConfig, StopMode, StopOrder, SymbolCellConfig, SymbolResolver, SymbolTextures, SymbolView, TransformConfig, TumbleStep, WalkingWildConfig, WinConfig, WinTier };
package/dist/slot.esm.js CHANGED
@@ -2943,6 +2943,7 @@ function createReelSystem(opts) {
2943
2943
  for (let i = 0; i < steps.length; i++) {
2944
2944
  await tumble.step(steps[i], i, cOpts);
2945
2945
  board = steps[i].settledGrid;
2946
+ await cOpts?.onStep?.(i, steps[i], tumble.multiplier);
2946
2947
  }
2947
2948
  if (config.cascade.multiplier.enabled)
2948
2949
  log?.(`Cascade multiplier ×${tumble.multiplier}`);
@@ -2954,6 +2955,7 @@ function createReelSystem(opts) {
2954
2955
  for (let i = 0; i < steps.length; i++) {
2955
2956
  await reelStepCtl.step(steps[i], i, rOpts);
2956
2957
  board = steps[i].settledGrid;
2958
+ await rOpts?.onStep?.(i, steps[i], reelStepCtl.multiplier);
2957
2959
  }
2958
2960
  if (config.cascade.multiplier.enabled)
2959
2961
  log?.(`ReelStep multiplier ×${reelStepCtl.multiplier}`);