pokemon-io-core 0.0.18 → 0.0.20

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,5 +6,6 @@ export interface ItemDefinition {
6
6
  name: string;
7
7
  category: ItemCategory;
8
8
  maxUses: number;
9
+ image: string;
9
10
  effects: EffectDefinition[];
10
11
  }
@@ -1,3 +1,4 @@
1
+ import { pokemonImages } from "./img/pokemons";
1
2
  import { POKEMON_TYPE_IDS } from "./types";
2
3
  const makeStats = (offense, defense, speed, crit) => ({
3
4
  offense,
@@ -10,7 +11,7 @@ export const POKEMON_FIGHTERS = [
10
11
  id: "pikachu",
11
12
  name: "Pikachu",
12
13
  description: "Rápido y agresivo, castiga con críticos frecuentes.",
13
- img: '/pikachu.png',
14
+ img: pokemonImages.pikachu,
14
15
  classId: POKEMON_TYPE_IDS.electric,
15
16
  baseStats: makeStats(55, 40, 90, 15),
16
17
  recommendedMoves: ["tackle", "thunder_shock"]
@@ -19,7 +20,7 @@ export const POKEMON_FIGHTERS = [
19
20
  id: "charizard",
20
21
  name: "Charizard",
21
22
  description: "Burst de fuego muy alto, algo frágil.",
22
- img: '/charizard.png',
23
+ img: pokemonImages.charizard,
23
24
  classId: POKEMON_TYPE_IDS.fire,
24
25
  baseStats: makeStats(84, 78, 100, 10),
25
26
  recommendedMoves: ["tackle", "ember"]
@@ -28,7 +29,7 @@ export const POKEMON_FIGHTERS = [
28
29
  id: "blastoise",
29
30
  name: "Blastoise",
30
31
  description: "Tanque defensivo con presión constante de agua.",
31
- img: '/blastoise.png',
32
+ img: pokemonImages.blastoise,
32
33
  classId: POKEMON_TYPE_IDS.water,
33
34
  baseStats: makeStats(83, 100, 78, 8),
34
35
  recommendedMoves: ["tackle", "water_gun"]
@@ -37,7 +38,7 @@ export const POKEMON_FIGHTERS = [
37
38
  id: "venusaur",
38
39
  name: "Venusaur",
39
40
  description: "Juego de desgaste con grandes golpes de hierba.",
40
- img: '/venusaur.png',
41
+ img: pokemonImages.venusaur,
41
42
  classId: POKEMON_TYPE_IDS.grass,
42
43
  baseStats: makeStats(82, 83, 80, 8),
43
44
  recommendedMoves: ["tackle", "vine_whip"]
@@ -46,7 +47,7 @@ export const POKEMON_FIGHTERS = [
46
47
  id: "mew",
47
48
  name: "Mew",
48
49
  description: "Juego de desgaste con grandes golpes de hierba.",
49
- img: '/mew.png',
50
+ img: pokemonImages.mew,
50
51
  classId: POKEMON_TYPE_IDS.psychic,
51
52
  baseStats: makeStats(82, 83, 80, 8),
52
53
  recommendedMoves: ["tackle", "vine_whip"]
@@ -55,7 +56,7 @@ export const POKEMON_FIGHTERS = [
55
56
  id: "groudon",
56
57
  name: "Groudon",
57
58
  description: "Juego de desgaste con grandes golpes de hierba.",
58
- img: '/groudon.png',
59
+ img: pokemonImages.groudon,
59
60
  classId: POKEMON_TYPE_IDS.rock,
60
61
  baseStats: makeStats(82, 83, 80, 8),
61
62
  recommendedMoves: ["tackle", "vine_whip"]
@@ -0,0 +1,12 @@
1
+ export declare const itemsImages: {
2
+ readonly antidote: string;
3
+ readonly bigMushroom: string;
4
+ readonly calcium: string;
5
+ readonly carbos: string;
6
+ readonly fancyApple: string;
7
+ readonly fireStone: string;
8
+ readonly hyperPotion: string;
9
+ readonly poison: string;
10
+ readonly revivalHerb: string;
11
+ readonly shoalSalt: string;
12
+ };
@@ -0,0 +1,22 @@
1
+ import antidote from "./antidote.png";
2
+ import bigMushroom from "./big-mushroom.png";
3
+ import calcium from "./calcium.png";
4
+ import carbos from "./carbos.png";
5
+ import fancyApple from "./fancy-apple.png";
6
+ import fireStone from "./fire-stone.png";
7
+ import hyperPotion from "./hyper-potion.png";
8
+ import poison from "./poison.png";
9
+ import revivalHerb from "./revival-herb.png";
10
+ import shoalSalt from "./shoal-salt.png";
11
+ export const itemsImages = {
12
+ antidote,
13
+ bigMushroom,
14
+ calcium,
15
+ carbos,
16
+ fancyApple,
17
+ fireStone,
18
+ hyperPotion,
19
+ poison,
20
+ revivalHerb,
21
+ shoalSalt,
22
+ };
@@ -0,0 +1,11 @@
1
+ export declare const pokemonImages: {
2
+ readonly blastoise: string;
3
+ readonly bulbasour: string;
4
+ readonly charizard: string;
5
+ readonly charmander: string;
6
+ readonly groudon: string;
7
+ readonly kyogre: string;
8
+ readonly mew: string;
9
+ readonly pikachu: string;
10
+ readonly venusaur: string;
11
+ };
@@ -0,0 +1,20 @@
1
+ import blastoise from "./blastoise.png";
2
+ import bulbasour from "./bulbasaur.png";
3
+ import charizard from "./charizard.png";
4
+ import charmander from "./charmander.png";
5
+ import groudon from "./groudon.png";
6
+ import kyogre from "./kyogre.webp";
7
+ import mew from "./mew.png";
8
+ import pikachu from "./pikachu.png";
9
+ import venusaur from "./venusaur.png";
10
+ export const pokemonImages = {
11
+ blastoise,
12
+ bulbasour,
13
+ charizard,
14
+ charmander,
15
+ groudon,
16
+ kyogre,
17
+ mew,
18
+ pikachu,
19
+ venusaur,
20
+ };
@@ -4,3 +4,5 @@ export * from "./fighters.js";
4
4
  export * from "./pokemonSkin.js";
5
5
  export * from "./items.js";
6
6
  export * from "./statuses.js";
7
+ export * from "./img/items/index.js";
8
+ export * from "./img/pokemons/index.js";
@@ -4,3 +4,5 @@ export * from "./fighters.js";
4
4
  export * from "./pokemonSkin.js";
5
5
  export * from "./items.js";
6
6
  export * from "./statuses.js";
7
+ export * from "./img/items/index.js";
8
+ export * from "./img/pokemons/index.js";
@@ -1,17 +1,44 @@
1
+ import { itemsImages } from "./img/items";
1
2
  export const POKEMON_ITEMS = [
2
3
  {
3
4
  id: "potion",
4
5
  name: "Poción",
5
6
  category: "heal_shield",
6
7
  maxUses: 2,
7
- effects: [{ kind: "heal", amount: 30 }]
8
+ effects: [{ kind: "heal", amount: 30 }],
9
+ image: itemsImages.antidote,
8
10
  },
9
11
  {
10
12
  id: "super_potion",
11
13
  name: "Super Poción",
12
14
  category: "heal_shield",
13
15
  maxUses: 1,
14
- effects: [{ kind: "heal", amount: 60 }]
16
+ effects: [{ kind: "heal", amount: 60 }],
17
+ image: itemsImages.hyperPotion,
18
+ },
19
+ {
20
+ id: "apple",
21
+ name: "Manzana",
22
+ category: "heal_shield",
23
+ maxUses: 3,
24
+ effects: [{ kind: "heal", amount: 60 }],
25
+ image: itemsImages.fancyApple,
26
+ },
27
+ {
28
+ id: "mushroom",
29
+ name: "Seta",
30
+ category: "heal_shield",
31
+ maxUses: 3,
32
+ effects: [{ kind: "heal", amount: 60 }],
33
+ image: itemsImages.bigMushroom,
34
+ },
35
+ {
36
+ id: "yellow-dust",
37
+ name: "Cristal amarillo",
38
+ category: "heal_shield",
39
+ maxUses: 3,
40
+ effects: [{ kind: "heal", amount: 60 }],
41
+ image: itemsImages.fireStone,
15
42
  },
16
43
  {
17
44
  id: "burn_bomb",
@@ -20,7 +47,8 @@ export const POKEMON_ITEMS = [
20
47
  maxUses: 1,
21
48
  effects: [
22
49
  { kind: "damage", amount: 20 },
23
- { kind: "apply_status", statusId: "burn" }
24
- ]
25
- }
50
+ { kind: "apply_status", statusId: "burn" },
51
+ ],
52
+ image: itemsImages.hyperPotion,
53
+ },
26
54
  ];
@@ -4,7 +4,7 @@ const MAX_HP_DEFAULT = 100;
4
4
  // --- helpers ---
5
5
  const findPokemonById = (id) => {
6
6
  const lower = id.toLowerCase();
7
- return (POKEMON_FIGHTERS.find((f) => f.id.toLowerCase() === lower || f.name.toLowerCase() === lower) ?? null);
7
+ return (POKEMON_FIGHTERS.find((f) => f.id.toLowerCase() === lower) ?? null);
8
8
  };
9
9
  const findMoveById = (id) => {
10
10
  return POKEMON_MOVES.find((m) => m.id === id) ?? null;
@@ -76,6 +76,7 @@ export class PokemonSkin {
76
76
  if (!loadout.fighterId) {
77
77
  throw new Error("fighterId is required in FighterLoadout");
78
78
  }
79
+ console.log("buildPlayerConfig", loadout.fighterId);
79
80
  const fighter = findPokemonById(loadout.fighterId);
80
81
  if (!fighter) {
81
82
  throw new Error(`Unknown fighterId for Pokemon skin: ${loadout.fighterId}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pokemon-io-core",
3
- "version": "0.0.18",
3
+ "version": "0.0.20",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",