pokemon-io-core 0.0.111 → 0.0.113
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/core/battleState.d.ts +1 -1
- package/dist/core/fighters.d.ts +1 -1
- package/dist/engine/actions/move.js +5 -1
- package/dist/engine/combat/damage.js +17 -11
- package/dist/engine/events/applyRandomEvent.js +1 -3
- package/dist/engine/fighters/fighter.js +1 -1
- package/dist/skins/cliches/fighters.js +18 -18
- package/dist/skins/pokemon/fighters.js +18 -18
- package/package.json +2 -2
- package/dist/api/battle.d.ts +0 -90
- package/dist/api/room.d.ts +0 -29
- package/dist/api/socketTypes.d.ts +0 -96
- package/dist/core/actions.d.ts +0 -22
- package/dist/core/amulets.d.ts +0 -18
- package/dist/core/battleRuntime.d.ts +0 -46
- package/dist/core/emotes.d.ts +0 -13
- package/dist/core/engine.d.ts +0 -53
- package/dist/core/engine.js +0 -1046
- package/dist/core/events.d.ts +0 -142
- package/dist/core/ids.d.ts +0 -6
- package/dist/core/index.d.ts +0 -16
- package/dist/core/items.d.ts +0 -12
- package/dist/core/moves.d.ts +0 -87
- package/dist/core/randomEvents.d.ts +0 -28
- package/dist/core/randomEventsList.d.ts +0 -11
- package/dist/core/status.d.ts +0 -11
- package/dist/core/types.d.ts +0 -14
- package/dist/engine/actions/forcedSwitch.d.ts +0 -5
- package/dist/engine/actions/index.d.ts +0 -5
- package/dist/engine/actions/item.d.ts +0 -6
- package/dist/engine/actions/move.d.ts +0 -7
- package/dist/engine/actions/priority.d.ts +0 -6
- package/dist/engine/actions/switch.d.ts +0 -6
- package/dist/engine/combat/crit.d.ts +0 -2
- package/dist/engine/combat/damage.d.ts +0 -20
- package/dist/engine/combat/heal.d.ts +0 -6
- package/dist/engine/combat/index.d.ts +0 -5
- package/dist/engine/combat/stages.d.ts +0 -5
- package/dist/engine/combat/typeEffectiveness.d.ts +0 -3
- package/dist/engine/combat/winner.d.ts +0 -2
- package/dist/engine/debug.d.ts +0 -1
- package/dist/engine/effects/applyEffects.d.ts +0 -7
- package/dist/engine/effects/index.d.ts +0 -2
- package/dist/engine/effects/target.d.ts +0 -6
- package/dist/engine/engine.d.ts +0 -53
- package/dist/engine/engine.js +0 -1046
- package/dist/engine/events/applyRandomEvent.d.ts +0 -11
- package/dist/engine/events/index.d.ts +0 -2
- package/dist/engine/events/randomEventTrigger.d.ts +0 -16
- package/dist/engine/events.d.ts +0 -8
- package/dist/engine/fighters/fighter.d.ts +0 -4
- package/dist/engine/fighters/index.d.ts +0 -3
- package/dist/engine/fighters/selectors.d.ts +0 -13
- package/dist/engine/fighters/update.d.ts +0 -3
- package/dist/engine/index.d.ts +0 -12
- package/dist/engine/pokemonBattleService.d.ts +0 -6
- package/dist/engine/pokemonBattleService.js +0 -32
- package/dist/engine/rng.d.ts +0 -2
- package/dist/engine/rules.d.ts +0 -6
- package/dist/engine/runtime.d.ts +0 -7
- package/dist/engine/status/apply.d.ts +0 -6
- package/dist/engine/status/clear.d.ts +0 -6
- package/dist/engine/status/endOfTurn.d.ts +0 -6
- package/dist/engine/status/hardCc.d.ts +0 -3
- package/dist/engine/status/index.d.ts +0 -4
- package/dist/engine/turn/index.d.ts +0 -1
- package/dist/engine/turn/index.js +0 -1
- package/dist/engine/turn/resolveTurn.d.ts +0 -5
- package/dist/index.d.ts +0 -6
- package/dist/skins/CombatSkin.d.ts +0 -21
- package/dist/skins/cliches/clicheSkin.d.ts +0 -14
- package/dist/skins/cliches/fighters.d.ts +0 -2
- package/dist/skins/cliches/index.d.ts +0 -5
- package/dist/skins/cliches/items.d.ts +0 -2
- package/dist/skins/cliches/moves.d.ts +0 -2
- package/dist/skins/cliches/statuses.d.ts +0 -2
- package/dist/skins/cliches/types.d.ts +0 -13
- package/dist/skins/index.d.ts +0 -3
- package/dist/skins/pokemon/data/pokemon-moves.json +0 -609
- package/dist/skins/pokemon/fighters.d.ts +0 -2
- package/dist/skins/pokemon/index.d.ts +0 -6
- package/dist/skins/pokemon/items.d.ts +0 -2
- package/dist/skins/pokemon/moves.d.ts +0 -2
- package/dist/skins/pokemon/pokemonSkin.d.ts +0 -14
- package/dist/skins/pokemon/statuses.d.ts +0 -2
- package/dist/skins/pokemon/types.d.ts +0 -13
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { RandomEventDefinition } from "../../core/randomEvents.js";
|
|
2
|
-
import type { BattleState } from "../../core/battleState.js";
|
|
3
|
-
import type { BattleEvent } from "../../core/events.js";
|
|
4
|
-
/**
|
|
5
|
-
* Apply a random event to the battle state
|
|
6
|
-
* Follows Single Responsibility - only handles event application
|
|
7
|
-
*/
|
|
8
|
-
export declare const applyRandomEvent: (state: BattleState, event: RandomEventDefinition) => {
|
|
9
|
-
state: BattleState;
|
|
10
|
-
events: BattleEvent[];
|
|
11
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { type RandomEventDefinition } from "../../core/randomEvents.js";
|
|
2
|
-
/**
|
|
3
|
-
* Determina si debe dispararse un evento aleatorio en este turno
|
|
4
|
-
*
|
|
5
|
-
* @param turnNumber - Número del turno actual
|
|
6
|
-
* @returns true si debe ocurrir un evento
|
|
7
|
-
*/
|
|
8
|
-
export declare function shouldTriggerRandomEvent(turnNumber: number): boolean;
|
|
9
|
-
/**
|
|
10
|
-
* Selecciona un evento aleatorio basado en los pesos de rareza
|
|
11
|
-
* Usa "weighted random selection" para dar más probabilidad a eventos comunes
|
|
12
|
-
*
|
|
13
|
-
* @param events - Array de eventos disponibles
|
|
14
|
-
* @returns Evento seleccionado
|
|
15
|
-
*/
|
|
16
|
-
export declare function selectRandomEvent(events: RandomEventDefinition[]): RandomEventDefinition;
|
package/dist/engine/events.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { BattleFighter } from "../../core/index.js";
|
|
2
|
-
import { PlayerFighterBattleConfig, RuntimeBattleState } from "../rules.js";
|
|
3
|
-
export declare const createBattleFighter: (cfg: PlayerFighterBattleConfig) => BattleFighter;
|
|
4
|
-
export declare const recomputeEffectiveStatsForFighter: (state: RuntimeBattleState, fighter: BattleFighter) => BattleFighter;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { BattleFighter, PlayerBattleState } from "../../core/index.js";
|
|
2
|
-
import { RuntimeBattleState } from "../rules.js";
|
|
3
|
-
export declare const getActiveFighter: (player: PlayerBattleState) => BattleFighter;
|
|
4
|
-
export declare const getOpponentAndSelf: (state: RuntimeBattleState, playerKey: "player1" | "player2") => {
|
|
5
|
-
self: BattleFighter;
|
|
6
|
-
opponent: BattleFighter;
|
|
7
|
-
};
|
|
8
|
-
export declare const getPlayersAndActives: (state: RuntimeBattleState, playerKey: "player1" | "player2") => {
|
|
9
|
-
selfPlayer: PlayerBattleState;
|
|
10
|
-
oppPlayer: PlayerBattleState;
|
|
11
|
-
self: BattleFighter;
|
|
12
|
-
opponent: BattleFighter;
|
|
13
|
-
};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { BattleFighter } from "../../core/index.js";
|
|
2
|
-
import { RuntimeBattleState } from "../rules.js";
|
|
3
|
-
export declare const updateFightersInState: (state: RuntimeBattleState, actingPlayerKey: "player1" | "player2", updatedSelf: BattleFighter, updatedOpponent: BattleFighter) => RuntimeBattleState;
|
package/dist/engine/index.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export * from './debug.js';
|
|
2
|
-
export * from './events.js';
|
|
3
|
-
export * from './rng.js';
|
|
4
|
-
export * from './rules.js';
|
|
5
|
-
export * from './runtime.js';
|
|
6
|
-
export * from './actions/index.js';
|
|
7
|
-
export * from './combat/index.js';
|
|
8
|
-
export * from './effects/index.js';
|
|
9
|
-
export * from './fighters/index.js';
|
|
10
|
-
export * from './status/index.js';
|
|
11
|
-
export * from './turn/index.js';
|
|
12
|
-
export * from './events/index.js';
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { BattleActions, BattleState } from "../core/index.js";
|
|
2
|
-
export declare const createPokemonBattle: (fighter1Id: string, fighter2Id: string) => BattleState;
|
|
3
|
-
export declare const runPokemonTurn: (state: BattleState, actions: BattleActions) => {
|
|
4
|
-
newState: BattleState;
|
|
5
|
-
events: import("../index.js").BattleEvent[];
|
|
6
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { POKEMON_FIGHTERS, POKEMON_MOVES, POKEMON_TYPE_MATRIX, POKEMON_TYPES, } from "../skins/pokemon";
|
|
2
|
-
import { createInitialBattleState, resolveTurn, } from "../core/engine.js";
|
|
3
|
-
const findPokemon = (id) => POKEMON_FIGHTERS.find((p) => p.id === id);
|
|
4
|
-
const findMove = (id) => POKEMON_MOVES.find((m) => m.id === id);
|
|
5
|
-
export const createPokemonBattle = (fighter1Id, fighter2Id) => {
|
|
6
|
-
const f1 = findPokemon(fighter1Id);
|
|
7
|
-
const f2 = findPokemon(fighter2Id);
|
|
8
|
-
const config = {
|
|
9
|
-
types: POKEMON_TYPES,
|
|
10
|
-
typeEffectiveness: POKEMON_TYPE_MATRIX,
|
|
11
|
-
moves: POKEMON_MOVES,
|
|
12
|
-
items: [], // MVP: sin items
|
|
13
|
-
amulets: [],
|
|
14
|
-
statuses: [],
|
|
15
|
-
player1: {
|
|
16
|
-
fighter: f1,
|
|
17
|
-
maxHp: f1.baseStats.defense + f1.baseStats.offense,
|
|
18
|
-
moves: POKEMON_MOVES.filter((m) => (f1.recommendedMoves ?? []).includes(m.id)),
|
|
19
|
-
items: [],
|
|
20
|
-
amulet: null,
|
|
21
|
-
},
|
|
22
|
-
player2: {
|
|
23
|
-
fighter: f2,
|
|
24
|
-
maxHp: f2.baseStats.defense + f1.baseStats.offense,
|
|
25
|
-
moves: POKEMON_MOVES.filter((m) => (f2.recommendedMoves ?? []).includes(m.id)),
|
|
26
|
-
items: [],
|
|
27
|
-
amulet: null,
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
return createInitialBattleState(config);
|
|
31
|
-
};
|
|
32
|
-
export const runPokemonTurn = (state, actions) => resolveTurn(state, actions);
|
package/dist/engine/rng.d.ts
DELETED
package/dist/engine/rules.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { BattleState, BattleRules, BattleRuntime } from "../core/index.js";
|
|
2
|
-
export type { BattleRules, BattleRuntime, BattleConfig, PlayerBattleConfig, PlayerFighterBattleConfig, } from "../core/index.js";
|
|
3
|
-
export interface RuntimeBattleState extends BattleState {
|
|
4
|
-
runtime: BattleRuntime;
|
|
5
|
-
}
|
|
6
|
-
export declare const DEFAULT_RULES: BattleRules;
|
package/dist/engine/runtime.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { BattleState, FighterStats } from "../core/index.js";
|
|
2
|
-
import { BattleConfig } from "./rules.js";
|
|
3
|
-
export declare const buildMap: <T extends {
|
|
4
|
-
id: string;
|
|
5
|
-
}>(list: T[]) => Record<string, T>;
|
|
6
|
-
export declare const cloneStats: (stats: FighterStats) => FighterStats;
|
|
7
|
-
export declare const createInitialBattleState: (config: BattleConfig) => BattleState;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { BattleEvent, BattleFighter, StatusId } from "../../core/index.js";
|
|
2
|
-
import { RuntimeBattleState } from "../rules.js";
|
|
3
|
-
export declare const applyStatusToFighter: (state: RuntimeBattleState, target: BattleFighter, statusId: StatusId) => {
|
|
4
|
-
updated: BattleFighter;
|
|
5
|
-
events: BattleEvent[];
|
|
6
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { BattleEvent, BattleFighter, ClearStatusEffect } from "../../core/index.js";
|
|
2
|
-
import { RuntimeBattleState } from "../rules.js";
|
|
3
|
-
export declare const clearStatusFromFighter: (state: RuntimeBattleState, target: BattleFighter, effect: ClearStatusEffect) => {
|
|
4
|
-
updated: BattleFighter;
|
|
5
|
-
events: BattleEvent[];
|
|
6
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './resolveTurn.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './resolveTurn.js';
|
package/dist/index.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { TypeDefinition, TypeEffectivenessMatrix, MoveDefinition, ItemDefinition, AmuletDefinition, StatusDefinition } from "../core/index.js";
|
|
2
|
-
import { PlayerBattleConfig } from "../engine/rules.js";
|
|
3
|
-
export interface TeamFighterLoadout {
|
|
4
|
-
fighterId: string | null;
|
|
5
|
-
moveIds: string[];
|
|
6
|
-
}
|
|
7
|
-
export interface PlayerTeamLoadout {
|
|
8
|
-
fighters: TeamFighterLoadout[];
|
|
9
|
-
itemIds: string[];
|
|
10
|
-
amuletId: string | null;
|
|
11
|
-
}
|
|
12
|
-
export interface CombatSkin {
|
|
13
|
-
readonly id: string;
|
|
14
|
-
getTypes(): TypeDefinition[];
|
|
15
|
-
getTypeEffectiveness(): TypeEffectivenessMatrix;
|
|
16
|
-
getMoves(): MoveDefinition[];
|
|
17
|
-
getItems(): ItemDefinition[];
|
|
18
|
-
getAmulets(): AmuletDefinition[];
|
|
19
|
-
getStatuses(): StatusDefinition[];
|
|
20
|
-
buildPlayerConfig(loadout: PlayerTeamLoadout): PlayerBattleConfig;
|
|
21
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ItemDefinition, MoveDefinition } from "../../core/index.js";
|
|
2
|
-
import { PlayerBattleConfig } from "../../engine/rules.js";
|
|
3
|
-
import type { CombatSkin, PlayerTeamLoadout } from "../CombatSkin.js";
|
|
4
|
-
export declare class TribeSkin implements CombatSkin {
|
|
5
|
-
readonly id = "tribe";
|
|
6
|
-
getTypes(): import("../../index.js").TypeDefinition[];
|
|
7
|
-
getTypeEffectiveness(): import("../../index.js").TypeEffectivenessMatrix;
|
|
8
|
-
getMoves(): MoveDefinition[];
|
|
9
|
-
getItems(): ItemDefinition[];
|
|
10
|
-
getAmulets(): never[];
|
|
11
|
-
getStatuses(): import("../../index.js").StatusDefinition[];
|
|
12
|
-
buildPlayerConfig(loadout: PlayerTeamLoadout): PlayerBattleConfig;
|
|
13
|
-
}
|
|
14
|
-
export declare const createTribeSkin: () => CombatSkin;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { TypeDefinition, TypeEffectivenessMatrix, TypeId } from "../../core/index.js";
|
|
2
|
-
export declare const TRIBE_TYPE_IDS: {
|
|
3
|
-
readonly canallita: "canallita";
|
|
4
|
-
readonly cayetano: "cayetano";
|
|
5
|
-
readonly perroflauta: "perroflauta";
|
|
6
|
-
readonly cryptobro: "cryptobro";
|
|
7
|
-
readonly cunado: "cunado";
|
|
8
|
-
readonly gymbro: "gymbro";
|
|
9
|
-
};
|
|
10
|
-
export type TribeTypeId = (typeof TRIBE_TYPE_IDS)[keyof typeof TRIBE_TYPE_IDS];
|
|
11
|
-
export declare const TRIBE_TYPES: TypeDefinition[];
|
|
12
|
-
export declare const TRIBE_TYPE_MATRIX: TypeEffectivenessMatrix;
|
|
13
|
-
export declare const getTribeTypeEffectiveness: (attackerTypeId: TypeId, defenderTypeId: TypeId) => number;
|
package/dist/skins/index.d.ts
DELETED