pokemon-io-core 0.0.135 → 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.
|
@@ -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 {
|
|
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({
|