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
package/dist/core/fighters.d.ts
CHANGED
|
@@ -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
|
-
|
|
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,
|
|
@@ -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
|
-
|
|
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.
|
|
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.
|
|
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":
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
3
|
+
"version": "0.0.113",
|
|
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": "
|
|
55
|
+
"prepublishOnly": "npm run build",
|
|
56
56
|
"publish": "npm publish --access public"
|
|
57
57
|
},
|
|
58
58
|
"keywords": [],
|
package/dist/api/battle.d.ts
DELETED
|
@@ -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
|
-
}
|
package/dist/api/room.d.ts
DELETED
|
@@ -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
|
-
}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { BattleView } from "./battle.js";
|
|
2
|
-
import { RoomView } from "./room.js";
|
|
3
|
-
import { EmoteId } from "../core/emotes.js";
|
|
4
|
-
export interface ClientToServerEvents {
|
|
5
|
-
"room:create": (payload: {
|
|
6
|
-
nickname: string;
|
|
7
|
-
roomName: string;
|
|
8
|
-
password?: string | null;
|
|
9
|
-
}) => void;
|
|
10
|
-
"room:join": (payload: {
|
|
11
|
-
roomId: string;
|
|
12
|
-
nickname: string;
|
|
13
|
-
password?: string | null;
|
|
14
|
-
}) => void;
|
|
15
|
-
"room:leave": (payload: {
|
|
16
|
-
roomId: string;
|
|
17
|
-
}) => void;
|
|
18
|
-
"room:reconnect": (payload: {
|
|
19
|
-
roomId: string;
|
|
20
|
-
oldPlayerId: string;
|
|
21
|
-
}) => void;
|
|
22
|
-
"room:setLoadout": (payload: {
|
|
23
|
-
roomId: string;
|
|
24
|
-
fighters: {
|
|
25
|
-
fighterId: string;
|
|
26
|
-
moveIds: string[];
|
|
27
|
-
}[];
|
|
28
|
-
itemIds: string[];
|
|
29
|
-
amuletId?: string | null;
|
|
30
|
-
}) => void;
|
|
31
|
-
"room:startBattleRequest": (payload: {
|
|
32
|
-
roomId: string;
|
|
33
|
-
}) => void;
|
|
34
|
-
"room:setConfig": (payload: {
|
|
35
|
-
roomId: string;
|
|
36
|
-
skinId: string;
|
|
37
|
-
stageId: string;
|
|
38
|
-
fightersPerPlayer: number;
|
|
39
|
-
}) => void;
|
|
40
|
-
"room:list": () => void;
|
|
41
|
-
"battle:useMove": (payload: {
|
|
42
|
-
roomId: string;
|
|
43
|
-
moveIndex: number;
|
|
44
|
-
}) => void;
|
|
45
|
-
"battle:useItem": (payload: {
|
|
46
|
-
roomId: string;
|
|
47
|
-
itemIndex: number;
|
|
48
|
-
}) => void;
|
|
49
|
-
"battle:switchFighter": (payload: {
|
|
50
|
-
roomId: string;
|
|
51
|
-
newIndex: number;
|
|
52
|
-
}) => void;
|
|
53
|
-
"battle:chooseForcedSwitch": (payload: {
|
|
54
|
-
roomId: string;
|
|
55
|
-
newIndex: number;
|
|
56
|
-
}) => void;
|
|
57
|
-
"battle:rematchSameLoadout": (payload: {
|
|
58
|
-
roomId: string;
|
|
59
|
-
}) => void;
|
|
60
|
-
"battle:rematchChangeLoadout": (payload: {
|
|
61
|
-
roomId: string;
|
|
62
|
-
}) => void;
|
|
63
|
-
"battle:sendEmote": (payload: {
|
|
64
|
-
roomId: string;
|
|
65
|
-
emoteId: EmoteId;
|
|
66
|
-
}) => void;
|
|
67
|
-
"battle:acknowledgeRandomEvent": (payload: {
|
|
68
|
-
roomId: string;
|
|
69
|
-
}) => void;
|
|
70
|
-
ping: () => void;
|
|
71
|
-
}
|
|
72
|
-
export interface ServerToClientEvents {
|
|
73
|
-
"connection:state": (payload: {
|
|
74
|
-
isConnected: boolean;
|
|
75
|
-
socketId: string | null;
|
|
76
|
-
}) => void;
|
|
77
|
-
"room:list": (payload: RoomView[]) => void;
|
|
78
|
-
"room:state": (payload: RoomView) => void;
|
|
79
|
-
"room:error": (payload: {
|
|
80
|
-
code: string;
|
|
81
|
-
message: string;
|
|
82
|
-
}) => void;
|
|
83
|
-
"battle:state": (payload: BattleView) => void;
|
|
84
|
-
"battle:emote": (payload: {
|
|
85
|
-
playerId: string;
|
|
86
|
-
emoteId: EmoteId;
|
|
87
|
-
timestamp: number;
|
|
88
|
-
}) => void;
|
|
89
|
-
"battle:randomEventTriggered": (payload: {
|
|
90
|
-
eventId: string;
|
|
91
|
-
eventName: string;
|
|
92
|
-
eventDescription: string;
|
|
93
|
-
imageUrl?: string;
|
|
94
|
-
}) => void;
|
|
95
|
-
pong: (msg: string) => void;
|
|
96
|
-
}
|