@energy8platform/platform-core 0.16.2 → 0.17.0

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/src/lua/types.ts CHANGED
@@ -8,8 +8,6 @@ export interface GameDefinition {
8
8
  actions: Record<string, ActionDefinition>;
9
9
  bet_levels?: number[] | BetLevelsConfig;
10
10
  max_win?: MaxWinConfig;
11
- buy_bonus?: BuyBonusConfig;
12
- ante_bet?: AnteBetConfig;
13
11
  persistent_state?: PersistentStateConfig;
14
12
  /**
15
13
  * Session expiry duration as a Go-style duration string ("24h", "2h", "5ms").
@@ -30,22 +28,6 @@ export interface MaxWinConfig {
30
28
  fixed?: number;
31
29
  }
32
30
 
33
- export interface BuyBonusConfig {
34
- modes: Record<string, BuyBonusMode>;
35
- }
36
-
37
- export interface BuyBonusMode {
38
- cost_multiplier: number;
39
- /** Distribution of forced scatter counts. Optional — if omitted, Lua script handles bonus setup itself. */
40
- scatter_distribution?: Record<string, number>;
41
- /** Optional description */
42
- description?: string;
43
- }
44
-
45
- export interface AnteBetConfig {
46
- cost_multiplier: number;
47
- }
48
-
49
31
  export interface PersistentStateConfig {
50
32
  vars: string[];
51
33
  exposed_vars: string[];
@@ -53,12 +35,27 @@ export interface PersistentStateConfig {
53
35
 
54
36
  // ─── Actions & Transitions ──────────────────────────────
55
37
 
38
+ /**
39
+ * v5 action contract — cost_multiplier and feature_data live on the action
40
+ * itself. Removed in v5: top-level `buy_bonus`/`ante_bet` blocks, debit modes
41
+ * `'buy_bonus_cost'`/`'ante_bet_cost'`, action.buy_bonus_mode, params.ante_bet/
42
+ * params.buy_bonus flags. Lua reads action context via `state.action` and
43
+ * `state.action_config = { cost_multiplier, feature_data }`.
44
+ */
56
45
  export interface ActionDefinition {
57
46
  stage: string;
58
- debit: 'bet' | 'buy_bonus_cost' | 'ante_bet_cost' | 'none';
47
+ /** Either 'bet' (debit = bet × cost_multiplier) or 'none'/empty (no debit). */
48
+ debit: 'bet' | 'none';
49
+ /** Multiplier on `bet` when debit==='bet'. Defaults to 1.0. */
50
+ cost_multiplier?: number;
51
+ /**
52
+ * Opaque action-specific configuration exposed to Lua as
53
+ * `state.action_config.feature_data`. Common keys: `scatter_distribution`
54
+ * for buy-bonus actions, forced symbol counts, etc.
55
+ */
56
+ feature_data?: Record<string, unknown>;
59
57
  credit?: 'win' | 'none' | 'defer';
60
58
  requires_session?: boolean;
61
- buy_bonus_mode?: string;
62
59
  transitions: TransitionRule[];
63
60
  input_schema?: Record<string, unknown>;
64
61
  }
package/src/types.ts CHANGED
@@ -74,9 +74,6 @@ export type {
74
74
  LuaEngineConfig,
75
75
  LuaPlayResult,
76
76
  MaxWinConfig,
77
- BuyBonusConfig,
78
- BuyBonusMode,
79
- AnteBetConfig,
80
77
  PersistentStateConfig,
81
78
  BetLevelsConfig,
82
79
  SimulationConfig,