pokemon-io-core 0.0.134 → 0.0.136

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.
@@ -6,8 +6,8 @@ export interface StageDefinition {
6
6
  id: string;
7
7
  /** Display name for the stage */
8
8
  label: string;
9
- /** Path to the background image/gif */
10
- backgroundSrc: string;
9
+ /** Image key for loading the stage background */
10
+ img: string;
11
11
  /** Alternative text for accessibility */
12
12
  alt: string;
13
13
  }
@@ -1,5 +1,5 @@
1
1
  import { BattleActions, BattleEvent, BattleState } from "../../core/index.js";
2
- export declare const resolveTurn: (state: BattleState, actions: BattleActions) => {
2
+ export declare const resolveTurn: (state: BattleState, actions: BattleActions, skinId?: string) => {
3
3
  newState: BattleState;
4
4
  events: BattleEvent[];
5
5
  };
@@ -12,7 +12,7 @@ import { applyEndOfTurnStatuses } from "../status/endOfTurn.js";
12
12
  import { hasHardCc } from "../status/hardCc.js";
13
13
  import { shouldTriggerRandomEvent, selectRandomEvent } from "../events/randomEventTrigger.js";
14
14
  import { applyRandomEvent } from "../events/applyRandomEvent.js";
15
- import { CORE_RANDOM_EVENTS } from "../../core/index.js";
15
+ import { getRandomEventsForSkin } from "../../core/randomEventsList.js";
16
16
  import { TRIBE_STATUS_IDS } from "../../skins/cliches/constants.js";
17
17
  // ------------------------------------------------------
18
18
  // Helpers KO -> forced switch (estilo Pokémon real)
@@ -51,7 +51,7 @@ const computeForcedSwitchFromFaint = (state, lastActingPlayerKey, actorFighterId
51
51
  return null;
52
52
  };
53
53
  // ------------------------------------------------------
54
- export const resolveTurn = (state, actions) => {
54
+ export const resolveTurn = (state, actions, skinId) => {
55
55
  const runtimeState = state;
56
56
  let currentState = runtimeState;
57
57
  const recalcForPlayer = (player) => {
@@ -275,11 +275,8 @@ export const resolveTurn = (state, actions) => {
275
275
  const shouldCheckRandomEvent = !currentState.forcedSwitch && // Skip if forced switch pending
276
276
  winnerAtEnd === "none"; // Skip if battle ended
277
277
  if (shouldCheckRandomEvent && shouldTriggerRandomEvent(currentState.turnNumber)) {
278
- // Select random event
279
- const availableEvents = [
280
- ...CORE_RANDOM_EVENTS,
281
- // TODO: Add skin-specific events (POKEMON_RANDOM_EVENTS)
282
- ];
278
+ // Select random event based on skin
279
+ const availableEvents = getRandomEventsForSkin(skinId || 'pokemon');
283
280
  const randomEvent = selectRandomEvent(availableEvents);
284
281
  // Emit banner event
285
282
  events.push({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pokemon-io-core",
3
- "version": "0.0.134",
3
+ "version": "0.0.136",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",