pokemon-io-core 0.0.110 → 0.0.112

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.
Files changed (86) hide show
  1. package/dist/core/battleState.d.ts +1 -1
  2. package/dist/core/fighters.d.ts +1 -1
  3. package/dist/engine/actions/move.js +16 -9
  4. package/dist/engine/combat/damage.js +17 -11
  5. package/dist/engine/events/applyRandomEvent.js +1 -3
  6. package/dist/engine/fighters/fighter.js +1 -1
  7. package/dist/skins/cliches/fighters.js +18 -18
  8. package/dist/skins/pokemon/fighters.js +18 -18
  9. package/package.json +2 -2
  10. package/dist/api/battle.d.ts +0 -90
  11. package/dist/api/room.d.ts +0 -29
  12. package/dist/api/socketTypes.d.ts +0 -96
  13. package/dist/core/actions.d.ts +0 -22
  14. package/dist/core/amulets.d.ts +0 -18
  15. package/dist/core/battleRuntime.d.ts +0 -46
  16. package/dist/core/emotes.d.ts +0 -13
  17. package/dist/core/engine.d.ts +0 -53
  18. package/dist/core/engine.js +0 -1046
  19. package/dist/core/events.d.ts +0 -142
  20. package/dist/core/ids.d.ts +0 -6
  21. package/dist/core/index.d.ts +0 -16
  22. package/dist/core/items.d.ts +0 -12
  23. package/dist/core/moves.d.ts +0 -87
  24. package/dist/core/randomEvents.d.ts +0 -28
  25. package/dist/core/randomEventsList.d.ts +0 -11
  26. package/dist/core/status.d.ts +0 -11
  27. package/dist/core/types.d.ts +0 -14
  28. package/dist/engine/actions/forcedSwitch.d.ts +0 -5
  29. package/dist/engine/actions/index.d.ts +0 -5
  30. package/dist/engine/actions/item.d.ts +0 -6
  31. package/dist/engine/actions/move.d.ts +0 -7
  32. package/dist/engine/actions/priority.d.ts +0 -6
  33. package/dist/engine/actions/switch.d.ts +0 -6
  34. package/dist/engine/combat/crit.d.ts +0 -2
  35. package/dist/engine/combat/damage.d.ts +0 -20
  36. package/dist/engine/combat/heal.d.ts +0 -6
  37. package/dist/engine/combat/index.d.ts +0 -5
  38. package/dist/engine/combat/stages.d.ts +0 -5
  39. package/dist/engine/combat/typeEffectiveness.d.ts +0 -3
  40. package/dist/engine/combat/winner.d.ts +0 -2
  41. package/dist/engine/debug.d.ts +0 -1
  42. package/dist/engine/effects/applyEffects.d.ts +0 -7
  43. package/dist/engine/effects/index.d.ts +0 -2
  44. package/dist/engine/effects/target.d.ts +0 -6
  45. package/dist/engine/engine.d.ts +0 -53
  46. package/dist/engine/engine.js +0 -1046
  47. package/dist/engine/events/applyRandomEvent.d.ts +0 -11
  48. package/dist/engine/events/index.d.ts +0 -2
  49. package/dist/engine/events/randomEventTrigger.d.ts +0 -16
  50. package/dist/engine/events.d.ts +0 -8
  51. package/dist/engine/fighters/fighter.d.ts +0 -4
  52. package/dist/engine/fighters/index.d.ts +0 -3
  53. package/dist/engine/fighters/selectors.d.ts +0 -13
  54. package/dist/engine/fighters/update.d.ts +0 -3
  55. package/dist/engine/index.d.ts +0 -12
  56. package/dist/engine/pokemonBattleService.d.ts +0 -6
  57. package/dist/engine/pokemonBattleService.js +0 -32
  58. package/dist/engine/rng.d.ts +0 -2
  59. package/dist/engine/rules.d.ts +0 -6
  60. package/dist/engine/runtime.d.ts +0 -7
  61. package/dist/engine/status/apply.d.ts +0 -6
  62. package/dist/engine/status/clear.d.ts +0 -6
  63. package/dist/engine/status/endOfTurn.d.ts +0 -6
  64. package/dist/engine/status/hardCc.d.ts +0 -3
  65. package/dist/engine/status/index.d.ts +0 -4
  66. package/dist/engine/turn/index.d.ts +0 -1
  67. package/dist/engine/turn/index.js +0 -1
  68. package/dist/engine/turn/resolveTurn.d.ts +0 -5
  69. package/dist/index.d.ts +0 -6
  70. package/dist/skins/CombatSkin.d.ts +0 -21
  71. package/dist/skins/cliches/clicheSkin.d.ts +0 -14
  72. package/dist/skins/cliches/fighters.d.ts +0 -2
  73. package/dist/skins/cliches/index.d.ts +0 -5
  74. package/dist/skins/cliches/items.d.ts +0 -2
  75. package/dist/skins/cliches/moves.d.ts +0 -2
  76. package/dist/skins/cliches/statuses.d.ts +0 -2
  77. package/dist/skins/cliches/types.d.ts +0 -13
  78. package/dist/skins/index.d.ts +0 -3
  79. package/dist/skins/pokemon/data/pokemon-moves.json +0 -609
  80. package/dist/skins/pokemon/fighters.d.ts +0 -2
  81. package/dist/skins/pokemon/index.d.ts +0 -6
  82. package/dist/skins/pokemon/items.d.ts +0 -2
  83. package/dist/skins/pokemon/moves.d.ts +0 -2
  84. package/dist/skins/pokemon/pokemonSkin.d.ts +0 -14
  85. package/dist/skins/pokemon/statuses.d.ts +0 -2
  86. package/dist/skins/pokemon/types.d.ts +0 -13
@@ -21,7 +21,7 @@ export type VolatileStatus = {
21
21
  } | null;
22
22
  export interface BattleFighter {
23
23
  fighterId: FighterId;
24
- classId: TypeId;
24
+ classIds: TypeId[];
25
25
  maxHp: number;
26
26
  currentHp: number;
27
27
  baseStats: FighterStats;
@@ -5,7 +5,7 @@ export interface FighterDefinition {
5
5
  name: string;
6
6
  description?: string;
7
7
  img?: string;
8
- classId: TypeId;
8
+ classIds: TypeId[];
9
9
  baseStats: FighterStats;
10
10
  recommendedMoves?: MoveId[];
11
11
  recommendedItems?: ItemId[];
@@ -149,7 +149,11 @@ export const resolveDamageMove = (state, playerKey, action) => {
149
149
  // -------------------------------------------------------------
150
150
  const critChance = computeCritChance(state.runtime.rules, updatedSelf.effectiveStats.crit);
151
151
  const isCritical = chance(critChance);
152
- const effectiveness = getTypeEffectiveness(state, move.typeId, updatedOpponent.classId);
152
+ let effectiveness = 1;
153
+ const defClassIds = updatedOpponent.classIds;
154
+ for (const cid of defClassIds) {
155
+ effectiveness *= getTypeEffectiveness(state, move.typeId, cid);
156
+ }
153
157
  dbg("HIT", {
154
158
  fighterId: self.fighterId,
155
159
  moveId: move.id,
@@ -158,14 +162,9 @@ export const resolveDamageMove = (state, playerKey, action) => {
158
162
  effectiveness,
159
163
  defenderBeforeHp: opponent.currentHp,
160
164
  });
161
- dbg("MOVE_EFFECTS", {
162
- moveId: move.id,
163
- moveName: move.name,
164
- effects: move.effects,
165
- });
166
- // Apply Effects
167
- const { actor: finalSelf, target: finalOpp, events: extraEvents, } = applyEffectsOnTarget(state, updatedSelf, updatedOpponent, move.typeId, isCritical, move.effects);
168
- events.push(...extraEvents);
165
+ // Events are pushed in order:
166
+ // 1. Move Hit (summary: critical/effective)
167
+ // 2. Effects (damage, recoil, status...)
169
168
  events.push({
170
169
  ...createBaseEvent(state.turnNumber, "move_hit", `${self.fighterId} acierta ${move.name}`),
171
170
  actorId: self.fighterId,
@@ -174,6 +173,14 @@ export const resolveDamageMove = (state, playerKey, action) => {
174
173
  isCritical,
175
174
  effectiveness,
176
175
  });
176
+ dbg("MOVE_EFFECTS", {
177
+ moveId: move.id,
178
+ moveName: move.name,
179
+ effects: move.effects,
180
+ });
181
+ // Apply Effects
182
+ const { actor: finalSelf, target: finalOpp, events: extraEvents, } = applyEffectsOnTarget(state, updatedSelf, updatedOpponent, move.typeId, isCritical, move.effects);
183
+ events.push(...extraEvents);
177
184
  let newState = updateFightersInState(state, playerKey, finalSelf, finalOpp);
178
185
  // --- FORCED SWITCH (Roar) ---
179
186
  const hasForceSwitch = move.effects.some((e) => e.kind === "force_switch");
@@ -8,14 +8,20 @@ export const computeDamage = (input) => {
8
8
  const rules = state.runtime.rules;
9
9
  const attackerOff = attacker.effectiveStats.offense;
10
10
  const defenderDef = defender.effectiveStats.defense;
11
- const typeEffectiveness = getTypeEffectiveness(state, moveTypeId, defender.classId);
11
+ let typeEffectiveness = 1;
12
+ for (const defTypeId of defender.classIds) {
13
+ const eff = getTypeEffectiveness(state, moveTypeId, defTypeId);
14
+ typeEffectiveness *= eff;
15
+ }
12
16
  if (typeEffectiveness === 0) {
13
17
  return {
14
18
  damage: 0,
15
19
  effectiveness: 0,
16
20
  };
17
21
  }
18
- const stabMultiplier = attacker.classId === moveTypeId ? rules.stabMultiplier : 1;
22
+ const stabMultiplier = attacker.classIds.includes(moveTypeId)
23
+ ? rules.stabMultiplier
24
+ : 1;
19
25
  const critMultiplier = isCritical ? rules.critMultiplier : 1;
20
26
  const randomFactor = randomInRange(rules.randomMinDamageFactor, rules.randomMaxDamageFactor);
21
27
  const rawDamage = basePower *
@@ -24,17 +30,17 @@ export const computeDamage = (input) => {
24
30
  stabMultiplier *
25
31
  critMultiplier *
26
32
  randomFactor;
27
- dbg("🧨 computeDamage", `
28
- basePower(${basePower}) *
29
- (attackerOff(${attackerOff}) / Math.max(1, defenderDef(${defenderDef}))) = ${attackerOff / Math.max(1, defenderDef)}*
30
- typeEffectiveness(${typeEffectiveness}) *
31
- stabMultiplier(${stabMultiplier}) *
32
- critMultiplier(${critMultiplier}) *
33
- randomFactor(${randomFactor}) = ${rawDamage}
33
+ dbg("🧨 computeDamage", `
34
+ basePower(${basePower}) *
35
+ (attackerOff(${attackerOff}) / Math.max(1, defenderDef(${defenderDef}))) = ${attackerOff / Math.max(1, defenderDef)}*
36
+ typeEffectiveness(${typeEffectiveness}) *
37
+ stabMultiplier(${stabMultiplier}) *
38
+ critMultiplier(${critMultiplier}) *
39
+ randomFactor(${randomFactor}) = ${rawDamage}
34
40
  `);
35
41
  const finalDamage = Math.max(1, Math.floor(rawDamage));
36
- dbg("🧨 computeDamage", `
37
- finalDamage(${finalDamage}) = Math.max(1, Math.floor(rawDamage))
42
+ dbg("🧨 computeDamage", `
43
+ finalDamage(${finalDamage}) = Math.max(1, Math.floor(rawDamage))
38
44
  `);
39
45
  return {
40
46
  damage: finalDamage,
@@ -94,11 +94,9 @@ const checkCondition = (fighter, condition) => {
94
94
  const hpPercent2 = (fighter.currentHp / maxHp2) * 100;
95
95
  return hpPercent2 > condition.value;
96
96
  case "fighter_type":
97
- // BattleFighter uses classId, not types array
98
- // Match against classId
99
97
  if (typeof condition.value !== "string")
100
98
  return false;
101
- return fighter.classId === condition.value;
99
+ return fighter.classIds.includes(condition.value);
102
100
  case "has_status":
103
101
  return fighter.statuses && fighter.statuses.length > 0;
104
102
  case "stat_stage_above":
@@ -6,7 +6,7 @@ export const createBattleFighter = (cfg) => {
6
6
  }
7
7
  return {
8
8
  fighterId: cfg.fighter.id,
9
- classId: cfg.fighter.classId,
9
+ classIds: cfg.fighter.classIds,
10
10
  maxHp: cfg.maxHp,
11
11
  currentHp: cfg.maxHp,
12
12
  baseStats: cloneStats(cfg.fighter.baseStats),
@@ -12,7 +12,7 @@ export const TRIBE_FIGHTERS = [
12
12
  name: "Becario NFT",
13
13
  description: "Cree que se hará rico mañana. Rápido hablando, frágil si le preguntas qué hace.",
14
14
  img: "becario_nft", // Asume que tienes esta imagen o mapeala
15
- classId: TRIBE_TYPE_IDS.cryptobro,
15
+ classIds: [TRIBE_TYPE_IDS.cryptobro],
16
16
  baseStats: makeStats(55, 35, 90, 15),
17
17
  recommendedMoves: ["venta_humo", "spam_whatsapp"],
18
18
  },
@@ -21,7 +21,7 @@ export const TRIBE_FIGHTERS = [
21
21
  name: "RRPP de Discoteca",
22
22
  description: "Te promete entrada gratis hasta la 1:00. Ofensivo pero se quema rápido.",
23
23
  img: "rrpp_discoteca",
24
- classId: TRIBE_TYPE_IDS.canallita,
24
+ classIds: [TRIBE_TYPE_IDS.canallita],
25
25
  baseStats: makeStats(52, 38, 75, 10),
26
26
  recommendedMoves: ["tortazo_cara", "colilla"],
27
27
  },
@@ -30,7 +30,7 @@ export const TRIBE_FIGHTERS = [
30
30
  name: "Junior de ESADE",
31
31
  description: "Lleva chaleco incluso en verano. Resiste bien gracias al dinero de papá.",
32
32
  img: "junior_esade",
33
- classId: TRIBE_TYPE_IDS.cayetano,
33
+ classIds: [TRIBE_TYPE_IDS.cayetano],
34
34
  baseStats: makeStats(40, 58, 45, 5),
35
35
  recommendedMoves: ["golpe_remo", "cafe_hirviendo"],
36
36
  },
@@ -39,7 +39,7 @@ export const TRIBE_FIGHTERS = [
39
39
  name: "Malabarista de Semáforo",
40
40
  description: "Aguanta mucho tiempo en el mismo sitio. Soporte natural del ecosistema urbano.",
41
41
  img: "malabarista",
42
- classId: TRIBE_TYPE_IDS.perroflauta,
42
+ classIds: [TRIBE_TYPE_IDS.perroflauta],
43
43
  baseStats: makeStats(35, 60, 40, 5),
44
44
  recommendedMoves: ["malabares", "pedir_un_euro"],
45
45
  },
@@ -48,7 +48,7 @@ export const TRIBE_FIGHTERS = [
48
48
  name: "Borracho Filósofo",
49
49
  description: "Le duele la cabeza pero te suelta verdades incómodas a gritos.",
50
50
  img: "borracho",
51
- classId: TRIBE_TYPE_IDS.cunado,
51
+ classIds: [TRIBE_TYPE_IDS.cunado],
52
52
  baseStats: makeStats(50, 40, 60, 12),
53
53
  recommendedMoves: ["yo_se_mas"],
54
54
  },
@@ -57,7 +57,7 @@ export const TRIBE_FIGHTERS = [
57
57
  name: "Novato del Gym",
58
58
  description: "Muy duro de cabeza, pero lento haciendo los ejercicios.",
59
59
  img: "novato_gym",
60
- classId: TRIBE_TYPE_IDS.gymbro,
60
+ classIds: [TRIBE_TYPE_IDS.gymbro],
61
61
  baseStats: makeStats(40, 58, 20, 5),
62
62
  recommendedMoves: ["flexion", "disco_movil"],
63
63
  },
@@ -67,7 +67,7 @@ export const TRIBE_FIGHTERS = [
67
67
  name: "Trader Agresivo",
68
68
  description: "Vende cursos online. Balanceado y con gran capacidad de estafa.",
69
69
  img: "trader",
70
- classId: TRIBE_TYPE_IDS.cryptobro,
70
+ classIds: [TRIBE_TYPE_IDS.cryptobro],
71
71
  baseStats: makeStats(65, 45, 95, 10),
72
72
  recommendedMoves: ["venta_humo", "spam_whatsapp"],
73
73
  },
@@ -76,7 +76,7 @@ export const TRIBE_FIGHTERS = [
76
76
  name: "Rey del Reservado",
77
77
  description: "Pide botellas con bengalas. Daño masivo a la tarjeta de crédito.",
78
78
  img: "reservado",
79
- classId: TRIBE_TYPE_IDS.canallita,
79
+ classIds: [TRIBE_TYPE_IDS.canallita],
80
80
  baseStats: makeStats(70, 45, 60, 8),
81
81
  recommendedMoves: ["tortazo_cara", "colilla"],
82
82
  },
@@ -85,7 +85,7 @@ export const TRIBE_FIGHTERS = [
85
85
  name: "Heredero de la Empresa",
86
86
  description: "Tanque con náuticos blindados. Una muralla de abogados.",
87
87
  img: "heredero",
88
- classId: TRIBE_TYPE_IDS.cayetano,
88
+ classIds: [TRIBE_TYPE_IDS.cayetano],
89
89
  baseStats: makeStats(50, 65, 55, 5),
90
90
  recommendedMoves: ["golpe_remo", "cafe_hirviendo"],
91
91
  },
@@ -94,7 +94,7 @@ export const TRIBE_FIGHTERS = [
94
94
  name: "Activista de Twitter",
95
95
  description: "Depredador de las redes, ataca letalmente desde el anonimato.",
96
96
  img: "activista",
97
- classId: TRIBE_TYPE_IDS.perroflauta,
97
+ classIds: [TRIBE_TYPE_IDS.perroflauta],
98
98
  baseStats: makeStats(68, 40, 100, 12),
99
99
  recommendedMoves: ["malabares", "pedir_un_euro"],
100
100
  },
@@ -103,7 +103,7 @@ export const TRIBE_FIGHTERS = [
103
103
  name: "Todólogo de Bar",
104
104
  description: "IQ de 5000 (según él). Poder mental puro, cero defensa ante hechos reales.",
105
105
  img: "todologo",
106
- classId: TRIBE_TYPE_IDS.cunado,
106
+ classIds: [TRIBE_TYPE_IDS.cunado],
107
107
  baseStats: makeStats(75, 30, 95, 8),
108
108
  recommendedMoves: ["codazo", "yo_se_mas"],
109
109
  },
@@ -112,7 +112,7 @@ export const TRIBE_FIGHTERS = [
112
112
  name: "Portero de Discoteca",
113
113
  description: "No pasas con esas zapatillas. Defensa física impenetrable.",
114
114
  img: "portero",
115
- classId: TRIBE_TYPE_IDS.gymbro,
115
+ classIds: [TRIBE_TYPE_IDS.gymbro],
116
116
  baseStats: makeStats(35, 80, 30, 5),
117
117
  recommendedMoves: ["flexion", "derrumbe"],
118
118
  },
@@ -122,7 +122,7 @@ export const TRIBE_FIGHTERS = [
122
122
  name: "Elon Musk de Hacendado",
123
123
  description: "Leyenda del emprendimiento. Domina LinkedIn con poder bruto.",
124
124
  img: "elon_hacendado",
125
- classId: TRIBE_TYPE_IDS.cryptobro,
125
+ classIds: [TRIBE_TYPE_IDS.cryptobro],
126
126
  baseStats: makeStats(70, 55, 85, 10),
127
127
  recommendedMoves: ["rug_pull", "tuit_elon"],
128
128
  },
@@ -131,7 +131,7 @@ export const TRIBE_FIGHTERS = [
131
131
  name: "Dueño del Garito",
132
132
  description: "Leyenda de la noche madrileña. Arrasa con todo a su paso.",
133
133
  img: "dueno_garito",
134
- classId: TRIBE_TYPE_IDS.canallita,
134
+ classIds: [TRIBE_TYPE_IDS.canallita],
135
135
  baseStats: makeStats(75, 50, 85, 10),
136
136
  recommendedMoves: ["tortazo_cara", "cubatazo"],
137
137
  },
@@ -140,7 +140,7 @@ export const TRIBE_FIGHTERS = [
140
140
  name: "Don Amancio",
141
141
  description: "Leviatán del textil capaz de comprar el país entero.",
142
142
  img: "amancio",
143
- classId: TRIBE_TYPE_IDS.cayetano,
143
+ classIds: [TRIBE_TYPE_IDS.cayetano],
144
144
  baseStats: makeStats(75, 65, 60, 8),
145
145
  recommendedMoves: ["golpe_remo", "yate_papa"],
146
146
  },
@@ -149,7 +149,7 @@ export const TRIBE_FIGHTERS = [
149
149
  name: "Líder de la Comuna",
150
150
  description: "Coloso del huerto urbano. Combina toxicidad pasiva y fuerza bruta.",
151
151
  img: "lider_comuna",
152
- classId: TRIBE_TYPE_IDS.perroflauta,
152
+ classIds: [TRIBE_TYPE_IDS.perroflauta],
153
153
  baseStats: makeStats(62, 63, 60, 6),
154
154
  recommendedMoves: ["malabares", "huelga_general"],
155
155
  },
@@ -158,7 +158,7 @@ export const TRIBE_FIGHTERS = [
158
158
  name: "Teórico de la Conspiración",
159
159
  description: "El ancestro de todos los foros. Versátil y místico.",
160
160
  img: "conspiranoico",
161
- classId: TRIBE_TYPE_IDS.cunado,
161
+ classIds: [TRIBE_TYPE_IDS.cunado],
162
162
  baseStats: makeStats(65, 65, 80, 10),
163
163
  recommendedMoves: ["codazo", "dato_inventado"],
164
164
  },
@@ -167,7 +167,7 @@ export const TRIBE_FIGHTERS = [
167
167
  name: "Jefe de Desokupa",
168
168
  description: "Creador de polémicas, poder físico devastador.",
169
169
  img: "desokupa",
170
- classId: TRIBE_TYPE_IDS.gymbro,
170
+ classIds: [TRIBE_TYPE_IDS.gymbro],
171
171
  baseStats: makeStats(80, 70, 50, 6),
172
172
  recommendedMoves: ["flexion", "derrumbe"],
173
173
  },
@@ -12,7 +12,7 @@ export const POKEMON_FIGHTERS = [
12
12
  name: "Pikachu",
13
13
  description: "Rápido y ágil, confía en su velocidad y golpes críticos.",
14
14
  img: "pikachu",
15
- classId: POKEMON_TYPE_IDS.electric,
15
+ classIds: [POKEMON_TYPE_IDS.electric],
16
16
  baseStats: makeStats(55, 35, 90, 15), // Suma: 90
17
17
  recommendedMoves: ["tackle", "thunder_shock"],
18
18
  },
@@ -21,7 +21,7 @@ export const POKEMON_FIGHTERS = [
21
21
  name: "Cyndaquil",
22
22
  description: "Pequeño volcán en erupción, ofensivo pero frágil.",
23
23
  img: "cyndaquil",
24
- classId: POKEMON_TYPE_IDS.fire,
24
+ classIds: [POKEMON_TYPE_IDS.fire],
25
25
  baseStats: makeStats(52, 38, 75, 10), // Suma: 90
26
26
  recommendedMoves: ["tackle", "ember"],
27
27
  },
@@ -30,7 +30,7 @@ export const POKEMON_FIGHTERS = [
30
30
  name: "Squirtle",
31
31
  description: "Caparazón resistente, ideal para resistir el daño inicial.",
32
32
  img: "squirtle",
33
- classId: POKEMON_TYPE_IDS.water,
33
+ classIds: [POKEMON_TYPE_IDS.water],
34
34
  baseStats: makeStats(40, 58, 45, 5), // Suma: 98
35
35
  recommendedMoves: ["tackle", "water_gun"],
36
36
  },
@@ -39,7 +39,7 @@ export const POKEMON_FIGHTERS = [
39
39
  name: "Chikorita",
40
40
  description: "Soporte natural, destaca por su defensa y persistencia.",
41
41
  img: "chikorita",
42
- classId: POKEMON_TYPE_IDS.grass,
42
+ classIds: [POKEMON_TYPE_IDS.grass],
43
43
  baseStats: makeStats(35, 60, 40, 5), // Suma: 95
44
44
  recommendedMoves: ["tackle", "vine_whip"],
45
45
  },
@@ -48,7 +48,7 @@ export const POKEMON_FIGHTERS = [
48
48
  name: "Psyduck",
49
49
  description: "Dolor de cabeza constante que desata ráfagas psíquicas.",
50
50
  img: "psyduck",
51
- classId: POKEMON_TYPE_IDS.psychic,
51
+ classIds: [POKEMON_TYPE_IDS.psychic],
52
52
  baseStats: makeStats(50, 40, 60, 12), // Suma: 90
53
53
  recommendedMoves: ["confusion"],
54
54
  },
@@ -57,7 +57,7 @@ export const POKEMON_FIGHTERS = [
57
57
  name: "Geodude",
58
58
  description: "Roca sólida, muy duro de derribar pero extremadamente lento.",
59
59
  img: "geodude",
60
- classId: POKEMON_TYPE_IDS.rock,
60
+ classIds: [POKEMON_TYPE_IDS.rock],
61
61
  baseStats: makeStats(40, 58, 20, 5), // Suma: 98
62
62
  recommendedMoves: ["tackle", "rock_throw"],
63
63
  },
@@ -67,7 +67,7 @@ export const POKEMON_FIGHTERS = [
67
67
  name: "Electabuzz",
68
68
  description: "Duelista eléctrico balanceado con gran capacidad ofensiva.",
69
69
  img: "electabuzz",
70
- classId: POKEMON_TYPE_IDS.electric,
70
+ classIds: [POKEMON_TYPE_IDS.electric],
71
71
  baseStats: makeStats(65, 45, 95, 10), // Suma: 110
72
72
  recommendedMoves: ["tackle", "thunder_shock"],
73
73
  },
@@ -76,7 +76,7 @@ export const POKEMON_FIGHTERS = [
76
76
  name: "Magmortar",
77
77
  description: "Artillería pesada de fuego, daño masivo a media distancia.",
78
78
  img: "magmortar",
79
- classId: POKEMON_TYPE_IDS.fire,
79
+ classIds: [POKEMON_TYPE_IDS.fire],
80
80
  baseStats: makeStats(70, 45, 60, 8), // Suma: 115
81
81
  recommendedMoves: ["tackle", "ember"],
82
82
  },
@@ -85,7 +85,7 @@ export const POKEMON_FIGHTERS = [
85
85
  name: "Blastoise",
86
86
  description: "Tanque con cañones hidráulicos, una muralla ofensiva.",
87
87
  img: "blastoise",
88
- classId: POKEMON_TYPE_IDS.water,
88
+ classIds: [POKEMON_TYPE_IDS.water],
89
89
  baseStats: makeStats(50, 65, 55, 5), // Suma: 115
90
90
  recommendedMoves: ["tackle", "water_gun"],
91
91
  },
@@ -94,7 +94,7 @@ export const POKEMON_FIGHTERS = [
94
94
  name: "Sceptile",
95
95
  description: "Depredador de la selva, golpea letalmente desde las sombras.",
96
96
  img: "sceptile",
97
- classId: POKEMON_TYPE_IDS.grass,
97
+ classIds: [POKEMON_TYPE_IDS.grass],
98
98
  baseStats: makeStats(68, 40, 100, 12), // Suma: 108
99
99
  recommendedMoves: ["tackle", "vine_whip"],
100
100
  },
@@ -103,7 +103,7 @@ export const POKEMON_FIGHTERS = [
103
103
  name: "Alakazam",
104
104
  description: "Coeficiente intelectual de 5000, poder mental puro sin defensa física.",
105
105
  img: "alakazam",
106
- classId: POKEMON_TYPE_IDS.psychic,
106
+ classIds: [POKEMON_TYPE_IDS.psychic],
107
107
  baseStats: makeStats(75, 30, 95, 8), // Suma: 105
108
108
  recommendedMoves: ["tackle", "confusion"],
109
109
  },
@@ -112,7 +112,7 @@ export const POKEMON_FIGHTERS = [
112
112
  name: "Onix",
113
113
  description: "Serpiente de roca gigante, defensa física casi impenetrable.",
114
114
  img: "onix",
115
- classId: POKEMON_TYPE_IDS.rock,
115
+ classIds: [POKEMON_TYPE_IDS.rock],
116
116
  baseStats: makeStats(35, 80, 30, 5), // Suma: 115
117
117
  recommendedMoves: ["tackle", "rock_slide"],
118
118
  },
@@ -122,7 +122,7 @@ export const POKEMON_FIGHTERS = [
122
122
  name: "Zapdos",
123
123
  description: "Ave legendaria del trueno, domina los cielos con poder bruto.",
124
124
  img: "zapdos",
125
- classId: POKEMON_TYPE_IDS.electric,
125
+ classIds: [POKEMON_TYPE_IDS.electric],
126
126
  baseStats: makeStats(70, 55, 85, 10), // Suma: 125
127
127
  recommendedMoves: ["peck", "thunderbolt"],
128
128
  },
@@ -131,7 +131,7 @@ export const POKEMON_FIGHTERS = [
131
131
  name: "Charizard",
132
132
  description: "Dragón de fuego icónico, arrasa con todo a su paso.",
133
133
  img: "charizard",
134
- classId: POKEMON_TYPE_IDS.fire,
134
+ classIds: [POKEMON_TYPE_IDS.fire],
135
135
  baseStats: makeStats(75, 50, 85, 10), // Suma: 125
136
136
  recommendedMoves: ["tackle", "ember"],
137
137
  },
@@ -140,7 +140,7 @@ export const POKEMON_FIGHTERS = [
140
140
  name: "Kyogre",
141
141
  description: "Leviatán mítico capaz de inundar el mundo entero.",
142
142
  img: "kyogre",
143
- classId: POKEMON_TYPE_IDS.water,
143
+ classIds: [POKEMON_TYPE_IDS.water],
144
144
  baseStats: makeStats(75, 65, 60, 8), // Suma: 140
145
145
  recommendedMoves: ["tackle", "water_gun"],
146
146
  },
@@ -149,7 +149,7 @@ export const POKEMON_FIGHTERS = [
149
149
  name: "Venusaur",
150
150
  description: "Coloso de la jungla, combina toxicidad y fuerza bruta.",
151
151
  img: "venusaur",
152
- classId: POKEMON_TYPE_IDS.grass,
152
+ classIds: [POKEMON_TYPE_IDS.grass],
153
153
  baseStats: makeStats(62, 63, 60, 6), // Suma: 125
154
154
  recommendedMoves: ["tackle", "vine_whip"],
155
155
  },
@@ -158,7 +158,7 @@ export const POKEMON_FIGHTERS = [
158
158
  name: "Mew",
159
159
  description: "El ancestro de todos los Pokémon, versátil y místico.",
160
160
  img: "mew",
161
- classId: POKEMON_TYPE_IDS.psychic,
161
+ classIds: [POKEMON_TYPE_IDS.psychic],
162
162
  baseStats: makeStats(65, 65, 80, 10), // Suma: 130
163
163
  recommendedMoves: ["tackle", "confusion"], // Corregido vine_whip
164
164
  },
@@ -167,7 +167,7 @@ export const POKEMON_FIGHTERS = [
167
167
  name: "Groudon",
168
168
  description: "Creador de continentes, poder terrestre devastador.",
169
169
  img: "groudon",
170
- classId: POKEMON_TYPE_IDS.rock,
170
+ classIds: [POKEMON_TYPE_IDS.rock],
171
171
  baseStats: makeStats(80, 70, 50, 6), // Suma: 150
172
172
  recommendedMoves: ["tackle", "rock_slide"], // Corregido vine_whip
173
173
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pokemon-io-core",
3
- "version": "0.0.110",
3
+ "version": "0.0.112",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -52,7 +52,7 @@
52
52
  },
53
53
  "scripts": {
54
54
  "build": "tsc -p .",
55
- "prepublishOnly": "pnpm run build",
55
+ "prepublishOnly": "npm run build",
56
56
  "publish": "npm publish --access public"
57
57
  },
58
58
  "keywords": [],
@@ -1,90 +0,0 @@
1
- import { BattleEvent, StatusId, VolatileStatus } from "../core/index.js";
2
- export interface BattlePlayerStatusView {
3
- statusId: StatusId;
4
- stacks: number;
5
- remainingTurns: number;
6
- }
7
- export interface BattlePlayerMoveView {
8
- moveId: string;
9
- currentPP: number;
10
- maxPP: number;
11
- }
12
- export interface BattlePlayerItemView {
13
- itemId: string;
14
- usesRemaining: number;
15
- maxUses: number;
16
- }
17
- export interface BattleTeamSlotView {
18
- fighterId: string;
19
- hp: number;
20
- isAlive: boolean;
21
- statuses: BattlePlayerStatusView[];
22
- }
23
- export interface BattlePlayerView {
24
- playerId: string;
25
- nickname: string;
26
- hp: number;
27
- statuses: BattlePlayerStatusView[];
28
- volatileStatus: VolatileStatus;
29
- activeFighterId: string | null;
30
- activeIndex: number;
31
- activeMoves: BattlePlayerMoveView[];
32
- inventory: BattlePlayerItemView[];
33
- team: BattleTeamSlotView[];
34
- statStages?: {
35
- offense: number;
36
- defense: number;
37
- speed: number;
38
- crit: number;
39
- accuracy: number;
40
- evasion: number;
41
- };
42
- }
43
- export type BattleStatus = "ongoing" | "awaiting_forced_switch" | "finished";
44
- export type ForcedSwitchReason = "roar" | "faint";
45
- export interface ForcedSwitchView {
46
- targetPlayerId: string;
47
- sourcePlayerId: string;
48
- reason: ForcedSwitchReason;
49
- turnNumber: number;
50
- }
51
- export interface BattleView {
52
- roomId: string;
53
- status: BattleStatus;
54
- winnerId: string | null;
55
- currentTurnPlayerId: string | null;
56
- startedAt: string;
57
- players: BattlePlayerView[];
58
- events: BattleEvent[];
59
- turnStartActiveFighterIdByPlayerId?: Record<string, string | null>;
60
- turnStartHpByPlayerId: {
61
- [playerId: string]: number;
62
- };
63
- turnStartStatusesByPlayerId?: Record<string, BattlePlayerStatusView[]>;
64
- turnStartStatStagesByPlayerId?: Record<string, {
65
- offense: number;
66
- defense: number;
67
- speed: number;
68
- crit: number;
69
- accuracy: number;
70
- evasion: number;
71
- }>;
72
- turnNumber: number;
73
- pendingActions?: {
74
- player1: boolean;
75
- player2: boolean;
76
- };
77
- pendingRandomEvent?: {
78
- eventName: string;
79
- eventDescription: string;
80
- imageUrl?: string;
81
- effects: Array<{
82
- effectType: string;
83
- target: string;
84
- percentValue?: number;
85
- statType?: string;
86
- statChange?: number;
87
- }>;
88
- } | null;
89
- forcedSwitch: ForcedSwitchView | null;
90
- }
@@ -1,29 +0,0 @@
1
- export interface PlayerLoadoutFighterView {
2
- fighterId: string;
3
- moveIds: string[];
4
- }
5
- export interface PlayerLoadoutView {
6
- fighters: PlayerLoadoutFighterView[];
7
- itemIds: string[];
8
- amuletId: string | null;
9
- }
10
- export interface PlayerView {
11
- id: string;
12
- nickname: string;
13
- isOwner: boolean;
14
- isSelf: boolean;
15
- isReady: boolean;
16
- loadout: PlayerLoadoutView | null;
17
- }
18
- export type RoomStatusView = "waiting" | "in_battle" | "finished";
19
- export interface RoomView {
20
- id: string;
21
- ownerId: string;
22
- status: RoomStatusView;
23
- fightersPerPlayer: number;
24
- players: PlayerView[];
25
- skinId: string;
26
- stageId: string;
27
- name: string;
28
- hasPassword: boolean;
29
- }