pokemon-io-core 0.0.52 → 0.0.54

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 (41) hide show
  1. package/package.json +6 -6
  2. package/dist/api/battle.js +0 -2
  3. package/dist/api/index.d.ts +0 -3
  4. package/dist/api/index.js +0 -3
  5. package/dist/api/room.js +0 -2
  6. package/dist/api/socketTypes.js +0 -1
  7. package/dist/core/actions.js +0 -1
  8. package/dist/core/amulets.js +0 -1
  9. package/dist/core/battleState.d.ts +0 -39
  10. package/dist/core/battleState.js +0 -1
  11. package/dist/core/engine.d.ts +0 -45
  12. package/dist/core/engine.js +0 -869
  13. package/dist/core/events.js +0 -1
  14. package/dist/core/fighters.js +0 -1
  15. package/dist/core/ids.js +0 -1
  16. package/dist/core/index.d.ts +0 -11
  17. package/dist/core/index.js +0 -11
  18. package/dist/core/items.js +0 -1
  19. package/dist/core/moves.js +0 -2
  20. package/dist/core/status.js +0 -1
  21. package/dist/core/types.js +0 -1
  22. package/dist/engine/engine.d.ts +0 -45
  23. package/dist/engine/engine.js +0 -869
  24. package/dist/engine/index.d.ts +0 -1
  25. package/dist/engine/index.js +0 -1
  26. package/dist/engine/pokemonBattleService.d.ts +0 -6
  27. package/dist/engine/pokemonBattleService.js +0 -32
  28. package/dist/index.d.ts +0 -6
  29. package/dist/index.js +0 -6
  30. package/dist/skins/CombatSkin.d.ts +0 -18
  31. package/dist/skins/CombatSkin.js +0 -1
  32. package/dist/skins/index.d.ts +0 -2
  33. package/dist/skins/index.js +0 -2
  34. package/dist/skins/pokemon/fighters.js +0 -174
  35. package/dist/skins/pokemon/index.d.ts +0 -6
  36. package/dist/skins/pokemon/index.js +0 -6
  37. package/dist/skins/pokemon/items.js +0 -143
  38. package/dist/skins/pokemon/moves.js +0 -459
  39. package/dist/skins/pokemon/pokemonSkin.js +0 -91
  40. package/dist/skins/pokemon/statuses.js +0 -85
  41. package/dist/skins/pokemon/types.js +0 -97
@@ -1,459 +0,0 @@
1
- import { POKEMON_TYPE_IDS } from "./types";
2
- export const POKEMON_MOVES = [
3
- // =====================================================
4
- // FUEGO
5
- // =====================================================
6
- // 1) Nuke fuego
7
- {
8
- id: "overheat",
9
- name: "Sofoco Ígneo",
10
- typeId: POKEMON_TYPE_IDS.fire,
11
- accuracy: 85,
12
- maxPP: 5,
13
- priority: 0,
14
- effects: [
15
- { kind: "damage", basePower: 80 },
16
- { kind: "damage", flatAmount: 10, target: "self" }, // coste: se hace daño
17
- ],
18
- },
19
- // 2) Golpe estable fuerte fuego
20
- {
21
- id: "flamethrower",
22
- name: "Lanzallamas",
23
- typeId: POKEMON_TYPE_IDS.fire,
24
- accuracy: 100,
25
- maxPP: 15,
26
- priority: 0,
27
- effects: [{ kind: "damage", basePower: 60 }],
28
- },
29
- // 3) Daño bajo + quemar
30
- {
31
- id: "ember",
32
- name: "Ascuas",
33
- typeId: POKEMON_TYPE_IDS.fire,
34
- accuracy: 100,
35
- maxPP: 25,
36
- priority: 0,
37
- effects: [
38
- { kind: "damage", basePower: 40 },
39
- { kind: "apply_status", statusId: "burn" },
40
- ],
41
- },
42
- // 4) Cura + limpia estados blandos
43
- {
44
- id: "purifying_flame",
45
- name: "Llama Purificadora",
46
- typeId: POKEMON_TYPE_IDS.fire,
47
- accuracy: 100,
48
- maxPP: 10,
49
- priority: 0,
50
- effects: [
51
- { kind: "heal", target: "self", amount: 22 },
52
- {
53
- kind: "clear_status",
54
- target: "self",
55
- kinds: ["soft"],
56
- },
57
- ],
58
- },
59
- // 5) Golpe medio estable
60
- {
61
- id: "fire_claw",
62
- name: "Garra Ígnea",
63
- typeId: POKEMON_TYPE_IDS.fire,
64
- accuracy: 100,
65
- maxPP: 20,
66
- priority: 0,
67
- effects: [{ kind: "damage", basePower: 50 }],
68
- },
69
- // 6) Cura simple
70
- {
71
- id: "healing_warmth",
72
- name: "Calor Reconfortante",
73
- typeId: POKEMON_TYPE_IDS.fire,
74
- accuracy: 100,
75
- maxPP: 15,
76
- priority: 0,
77
- effects: [{ kind: "heal", target: "self", amount: 18 }],
78
- },
79
- // =====================================================
80
- // AGUA
81
- // =====================================================
82
- // 1) Nuke agua
83
- {
84
- id: "hydro_cannon",
85
- name: "Cañón Hidro",
86
- typeId: POKEMON_TYPE_IDS.water,
87
- accuracy: 85,
88
- maxPP: 5,
89
- priority: 0,
90
- effects: [
91
- { kind: "damage", basePower: 80 },
92
- { kind: "modify_stats", offenseDelta: -15 },
93
- ],
94
- },
95
- // 2) Golpe estable fuerte agua
96
- {
97
- id: "surf",
98
- name: "Surf",
99
- typeId: POKEMON_TYPE_IDS.water,
100
- accuracy: 100,
101
- maxPP: 15,
102
- priority: 0,
103
- effects: [{ kind: "damage", basePower: 60 }],
104
- },
105
- // 3) Daño bajo + escaldado
106
- {
107
- id: "scald",
108
- name: "Escaldar",
109
- typeId: POKEMON_TYPE_IDS.water,
110
- accuracy: 100,
111
- maxPP: 20,
112
- priority: 0,
113
- effects: [
114
- { kind: "damage", basePower: 40 },
115
- { kind: "apply_status", statusId: "scalded" },
116
- ],
117
- },
118
- // 4) Curación + limpiar estados
119
- {
120
- id: "aqua_purify",
121
- name: "Aguas Purificadoras",
122
- typeId: POKEMON_TYPE_IDS.water,
123
- accuracy: 100,
124
- maxPP: 10,
125
- priority: 0,
126
- effects: [
127
- { kind: "heal", target: "self", amount: 22 },
128
- {
129
- kind: "clear_status",
130
- target: "self",
131
- kinds: ["soft"],
132
- },
133
- ],
134
- },
135
- // 5) Golpe medio estable
136
- {
137
- id: "wave_crash",
138
- name: "Oleada Feroz",
139
- typeId: POKEMON_TYPE_IDS.water,
140
- accuracy: 100,
141
- maxPP: 20,
142
- priority: 0,
143
- effects: [{ kind: "damage", basePower: 50 }],
144
- },
145
- // 6) Curación simple
146
- {
147
- id: "healing_rain",
148
- name: "Lluvia Curativa",
149
- typeId: POKEMON_TYPE_IDS.water,
150
- accuracy: 100,
151
- maxPP: 15,
152
- priority: 0,
153
- effects: [{ kind: "heal", target: "self", amount: 18 }],
154
- },
155
- // =====================================================
156
- // PLANTA
157
- // =====================================================
158
- // 1) Nuke planta
159
- {
160
- id: "leaf_storm",
161
- name: "Tormenta de Hojas",
162
- typeId: POKEMON_TYPE_IDS.grass,
163
- accuracy: 90,
164
- maxPP: 5,
165
- priority: 0,
166
- effects: [
167
- { kind: "damage", basePower: 80 },
168
- { kind: "modify_stats", offenseDelta: -20 },
169
- ],
170
- },
171
- // 2) Golpe estable fuerte planta
172
- {
173
- id: "energy_ball",
174
- name: "Energibola",
175
- typeId: POKEMON_TYPE_IDS.grass,
176
- accuracy: 100,
177
- maxPP: 15,
178
- priority: 0,
179
- effects: [{ kind: "damage", basePower: 60 }],
180
- },
181
- // 3) Daño bajo + enredado
182
- {
183
- id: "leech_seed",
184
- name: "Drenadoras",
185
- typeId: POKEMON_TYPE_IDS.grass,
186
- accuracy: 100,
187
- maxPP: 20,
188
- priority: 0,
189
- effects: [
190
- { kind: "damage", basePower: 40 },
191
- { kind: "apply_status", statusId: "entangled" },
192
- ],
193
- },
194
- // 4) Curación + limpiar estados
195
- {
196
- id: "nature_purify",
197
- name: "Purificación Natural",
198
- typeId: POKEMON_TYPE_IDS.grass,
199
- accuracy: 100,
200
- maxPP: 10,
201
- priority: 0,
202
- effects: [
203
- { kind: "heal", target: "self", amount: 22 },
204
- {
205
- kind: "clear_status",
206
- target: "self",
207
- kinds: ["soft"],
208
- },
209
- ],
210
- },
211
- // 5) Golpe medio estable
212
- {
213
- id: "power_whip",
214
- name: "Látigo Poderoso",
215
- typeId: POKEMON_TYPE_IDS.grass,
216
- accuracy: 100,
217
- maxPP: 20,
218
- priority: 0,
219
- effects: [{ kind: "damage", basePower: 50 }],
220
- },
221
- // 6) Curación simple
222
- {
223
- id: "regrowth",
224
- name: "Rebrote",
225
- typeId: POKEMON_TYPE_IDS.grass,
226
- accuracy: 100,
227
- maxPP: 15,
228
- priority: 0,
229
- effects: [{ kind: "heal", target: "self", amount: 18 }],
230
- },
231
- // =====================================================
232
- // PSÍQUICO
233
- // =====================================================
234
- // 1) Nuke psíquico
235
- {
236
- id: "psycho_boost",
237
- name: "Psicoimpulso",
238
- typeId: POKEMON_TYPE_IDS.psychic,
239
- accuracy: 90,
240
- maxPP: 5,
241
- priority: 0,
242
- effects: [
243
- { kind: "damage", basePower: 80 },
244
- { kind: "modify_stats", offenseDelta: -20 },
245
- ],
246
- },
247
- // 2) Golpe estable fuerte psíquico
248
- {
249
- id: "psychic",
250
- name: "Psíquico",
251
- typeId: POKEMON_TYPE_IDS.psychic,
252
- accuracy: 100,
253
- maxPP: 15,
254
- priority: 0,
255
- effects: [{ kind: "damage", basePower: 60 }],
256
- },
257
- // 3) Daño bajo + hard CC
258
- {
259
- id: "mind_spike",
260
- name: "Puñal Mental",
261
- typeId: POKEMON_TYPE_IDS.psychic,
262
- accuracy: 100,
263
- maxPP: 15,
264
- priority: 0,
265
- effects: [
266
- { kind: "damage", basePower: 40 },
267
- { kind: "apply_status", statusId: "mind_break" },
268
- ],
269
- },
270
- // 4) Curación + limpiar estados
271
- {
272
- id: "aura_cleanse",
273
- name: "Limpieza Áurica",
274
- typeId: POKEMON_TYPE_IDS.psychic,
275
- accuracy: 100,
276
- maxPP: 10,
277
- priority: 0,
278
- effects: [
279
- { kind: "heal", target: "self", amount: 22 },
280
- {
281
- kind: "clear_status",
282
- target: "self",
283
- kinds: ["soft"],
284
- },
285
- ],
286
- },
287
- // 5) Golpe medio estable
288
- {
289
- id: "psyshock",
290
- name: "Psicocarga",
291
- typeId: POKEMON_TYPE_IDS.psychic,
292
- accuracy: 100,
293
- maxPP: 20,
294
- priority: 0,
295
- effects: [{ kind: "damage", basePower: 50 }],
296
- },
297
- // 6) Curación simple
298
- {
299
- id: "healing_mind",
300
- name: "Mente Serena",
301
- typeId: POKEMON_TYPE_IDS.psychic,
302
- accuracy: 100,
303
- maxPP: 15,
304
- priority: 0,
305
- effects: [{ kind: "heal", target: "self", amount: 18 }],
306
- },
307
- // =====================================================
308
- // ROCA
309
- // =====================================================
310
- // 1) Nuke roca
311
- {
312
- id: "rock_wrecker",
313
- name: "Destroza Rocas",
314
- typeId: POKEMON_TYPE_IDS.rock,
315
- accuracy: 85,
316
- maxPP: 5,
317
- priority: 0,
318
- effects: [
319
- { kind: "damage", basePower: 80 },
320
- { kind: "modify_stats", offenseDelta: -20 },
321
- ],
322
- },
323
- // 2) Golpe estable fuerte roca
324
- {
325
- id: "stone_edge",
326
- name: "Roca Afilada",
327
- typeId: POKEMON_TYPE_IDS.rock,
328
- accuracy: 90,
329
- maxPP: 10,
330
- priority: 0,
331
- effects: [{ kind: "damage", basePower: 60 }],
332
- },
333
- // 3) Daño medio + petrificado
334
- {
335
- id: "rock_slide",
336
- name: "Avalancha",
337
- typeId: POKEMON_TYPE_IDS.rock,
338
- accuracy: 100,
339
- maxPP: 15,
340
- priority: 0,
341
- effects: [
342
- { kind: "damage", basePower: 50 },
343
- { kind: "apply_status", statusId: "petrified" },
344
- ],
345
- },
346
- // 4) Curación + limpiar estados
347
- {
348
- id: "sand_cleanse",
349
- name: "Purga de Arena",
350
- typeId: POKEMON_TYPE_IDS.rock,
351
- accuracy: 100,
352
- maxPP: 10,
353
- priority: 0,
354
- effects: [
355
- { kind: "heal", target: "self", amount: 22 },
356
- {
357
- kind: "clear_status",
358
- target: "self",
359
- kinds: ["soft"],
360
- },
361
- ],
362
- },
363
- // 5) Golpe medio estable
364
- {
365
- id: "power_gem",
366
- name: "Joya de Luz",
367
- typeId: POKEMON_TYPE_IDS.rock,
368
- accuracy: 100,
369
- maxPP: 20,
370
- priority: 0,
371
- effects: [{ kind: "damage", basePower: 50 }],
372
- },
373
- // 6) Curación simple
374
- {
375
- id: "healing_mineral",
376
- name: "Mineral Curativo",
377
- typeId: POKEMON_TYPE_IDS.rock,
378
- accuracy: 100,
379
- maxPP: 15,
380
- priority: 0,
381
- effects: [{ kind: "heal", target: "self", amount: 18 }],
382
- },
383
- // =====================================================
384
- // ELÉCTRICO
385
- // =====================================================
386
- // 1) Nuke eléctrico
387
- {
388
- id: "bolt_strike",
389
- name: "Impacto Voltio",
390
- typeId: POKEMON_TYPE_IDS.electric,
391
- accuracy: 85,
392
- maxPP: 5,
393
- priority: 0,
394
- effects: [
395
- { kind: "damage", basePower: 80 },
396
- { kind: "modify_stats", offenseDelta: -15 },
397
- ],
398
- },
399
- // 2) Golpe estable fuerte eléctrico
400
- {
401
- id: "thunderbolt",
402
- name: "Rayo",
403
- typeId: POKEMON_TYPE_IDS.electric,
404
- accuracy: 100,
405
- maxPP: 15,
406
- priority: 0,
407
- effects: [{ kind: "damage", basePower: 60 }],
408
- },
409
- // 3) Daño bajo + shocked
410
- {
411
- id: "thunder_wave",
412
- name: "Onda Trueno",
413
- typeId: POKEMON_TYPE_IDS.electric,
414
- accuracy: 100,
415
- maxPP: 20,
416
- priority: 0,
417
- effects: [
418
- { kind: "damage", basePower: 40 },
419
- { kind: "apply_status", statusId: "shocked" },
420
- ],
421
- },
422
- // 4) Curación + limpiar estados
423
- {
424
- id: "static_field",
425
- name: "Campo Estático",
426
- typeId: POKEMON_TYPE_IDS.electric,
427
- accuracy: 100,
428
- maxPP: 10,
429
- priority: 0,
430
- effects: [
431
- { kind: "heal", target: "self", amount: 22 },
432
- {
433
- kind: "clear_status",
434
- target: "self",
435
- kinds: ["soft"],
436
- },
437
- ],
438
- },
439
- // 5) Golpe medio estable
440
- {
441
- id: "wild_charge",
442
- name: "Carga Salvaje",
443
- typeId: POKEMON_TYPE_IDS.electric,
444
- accuracy: 100,
445
- maxPP: 20,
446
- priority: 0,
447
- effects: [{ kind: "damage", basePower: 50 }],
448
- },
449
- // 6) Curación simple
450
- {
451
- id: "healing_spark",
452
- name: "Chispa Sanadora",
453
- typeId: POKEMON_TYPE_IDS.electric,
454
- accuracy: 100,
455
- maxPP: 15,
456
- priority: 0,
457
- effects: [{ kind: "heal", target: "self", amount: 18 }],
458
- },
459
- ];
@@ -1,91 +0,0 @@
1
- // pokemon-io-core/src/skins/pokemon/pokemonSkin.ts
2
- import { POKEMON_FIGHTERS, POKEMON_ITEMS, POKEMON_MOVES, POKEMON_STATUSES, POKEMON_TYPES, POKEMON_TYPE_MATRIX, } from "./index";
3
- // --- helpers ---
4
- const findPokemonById = (id) => {
5
- const lower = id.toLowerCase();
6
- return POKEMON_FIGHTERS.find((f) => f.id.toLowerCase() === lower) ?? null;
7
- };
8
- const findMoveById = (id) => {
9
- return POKEMON_MOVES.find((m) => m.id === id) ?? null;
10
- };
11
- const findItemById = (id) => {
12
- return POKEMON_ITEMS.find((i) => i.id === id) ?? null;
13
- };
14
- const FILLER_MOVE_ID = "tackle";
15
- const buildMovesFromLoadout = (fighter, loadout) => {
16
- const selectedMoveIds = loadout.moveIds ?? [];
17
- const selectedMoves = selectedMoveIds
18
- .map((id) => findMoveById(id))
19
- .filter((m) => m !== null);
20
- if (selectedMoves.length >= 4) {
21
- return selectedMoves.slice(0, 4);
22
- }
23
- const result = [...selectedMoves];
24
- const recommendedIds = fighter.recommendedMoves ?? [];
25
- for (const recId of recommendedIds) {
26
- if (result.length >= 4)
27
- break;
28
- const move = findMoveById(recId);
29
- if (move && !result.some((m) => m.id === move.id)) {
30
- result.push(move);
31
- }
32
- }
33
- const filler = findMoveById(FILLER_MOVE_ID);
34
- while (result.length < 4 && filler) {
35
- result.push(filler);
36
- }
37
- if (result.length === 0 && filler) {
38
- result.push(filler);
39
- }
40
- return result.slice(0, 4);
41
- };
42
- const buildItemsFromLoadout = (loadout) => {
43
- const selectedItemIds = loadout.itemIds ?? [];
44
- const selectedItems = selectedItemIds
45
- .map((id) => findItemById(id))
46
- .filter((i) => i !== null);
47
- return selectedItems;
48
- };
49
- export class PokemonSkin {
50
- id = "pokemon";
51
- getTypes() {
52
- return POKEMON_TYPES;
53
- }
54
- getTypeEffectiveness() {
55
- return POKEMON_TYPE_MATRIX;
56
- }
57
- getMoves() {
58
- return POKEMON_MOVES;
59
- }
60
- getItems() {
61
- return POKEMON_ITEMS;
62
- }
63
- getAmulets() {
64
- return []; // más adelante
65
- }
66
- getStatuses() {
67
- return POKEMON_STATUSES; // más adelante
68
- }
69
- buildPlayerConfig(loadout) {
70
- if (!loadout.fighterId) {
71
- throw new Error("fighterId is required in FighterLoadout");
72
- }
73
- console.log("buildPlayerConfig", loadout.fighterId);
74
- const fighter = findPokemonById(loadout.fighterId);
75
- if (!fighter) {
76
- throw new Error(`Unknown fighterId for Pokemon skin: ${loadout.fighterId}`);
77
- }
78
- const moves = buildMovesFromLoadout(fighter, loadout);
79
- const items = buildItemsFromLoadout(loadout);
80
- return {
81
- fighter,
82
- maxHp: fighter.baseStats.defense + fighter.baseStats.offense,
83
- moves,
84
- items,
85
- amulet: null,
86
- };
87
- }
88
- }
89
- export const createPokemonSkin = () => {
90
- return new PokemonSkin();
91
- };
@@ -1,85 +0,0 @@
1
- export const POKEMON_STATUSES = [
2
- // FUEGO – Quemadura
3
- {
4
- id: "burn",
5
- name: "Quemado",
6
- kind: "soft",
7
- minDurationTurns: 3,
8
- maxDurationTurns: 5,
9
- effectsPerStack: [
10
- // DoT de fuego
11
- {
12
- kind: "damage",
13
- // el motor lo interpreta como daño plano por turno
14
- flatAmount: 6,
15
- },
16
- ],
17
- },
18
- // AGUA – Escaldado / Empapado
19
- {
20
- id: "scalded",
21
- name: "Escaldado",
22
- kind: "soft",
23
- minDurationTurns: 3,
24
- maxDurationTurns: 5,
25
- effectsPerStack: [
26
- {
27
- kind: "damage",
28
- flatAmount: 5,
29
- },
30
- ],
31
- },
32
- // PLANTA – Enredado
33
- {
34
- id: "entangled",
35
- name: "Enredado",
36
- kind: "soft",
37
- minDurationTurns: 3,
38
- maxDurationTurns: 5,
39
- effectsPerStack: [
40
- {
41
- kind: "damage",
42
- flatAmount: 4,
43
- },
44
- ],
45
- },
46
- // PSIQUICO – Bloqueo mental (hard CC)
47
- {
48
- id: "mind_break",
49
- name: "Bloqueo Mental",
50
- kind: "hard_cc",
51
- minDurationTurns: 1,
52
- maxDurationTurns: 2,
53
- effectsPerStack: [
54
- // El hard_cc ya lo interpreta el motor, no hace falta daño
55
- ],
56
- },
57
- // ROCA – Petrificado
58
- {
59
- id: "petrified",
60
- name: "Petrificado",
61
- kind: "soft",
62
- minDurationTurns: 2,
63
- maxDurationTurns: 4,
64
- effectsPerStack: [
65
- {
66
- kind: "damage",
67
- flatAmount: 5,
68
- },
69
- ],
70
- },
71
- // ELÉCTRICO – Electrocutado
72
- {
73
- id: "shocked",
74
- name: "Electrocutado",
75
- kind: "soft",
76
- minDurationTurns: 2,
77
- maxDurationTurns: 4,
78
- effectsPerStack: [
79
- {
80
- kind: "damage",
81
- flatAmount: 5,
82
- },
83
- ],
84
- },
85
- ];