pokemon-io-core 0.0.128 → 0.0.130

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.
@@ -21,20 +21,52 @@ export const applyEndOfTurnStatuses = (state) => {
21
21
  const def = state.runtime.statusesById[st.statusId];
22
22
  if (!def)
23
23
  continue;
24
+ const stacksMultiplier = st.stacks;
24
25
  let damageFromStatus = 0;
26
+ let healFromStatus = 0;
27
+ const statChanges = [];
28
+ // ✅ Procesar TODOS los efectos del estado
25
29
  def.effectsPerStack.forEach((eff) => {
26
- if (eff.kind === "damage") {
27
- const stacksMultiplier = st.stacks;
28
- const base = typeof eff.flatAmount === "number"
29
- ? eff.flatAmount
30
- : typeof eff.basePower === "number"
31
- ? eff.basePower
32
- : 10;
33
- damageFromStatus += base * stacksMultiplier;
30
+ switch (eff.kind) {
31
+ case "damage":
32
+ const base = typeof eff.flatAmount === "number"
33
+ ? eff.flatAmount
34
+ : typeof eff.basePower === "number"
35
+ ? eff.basePower
36
+ : 10;
37
+ damageFromStatus += base * stacksMultiplier;
38
+ break;
39
+ case "heal":
40
+ const healAmount = typeof eff.amount === "number" ? eff.amount : 10;
41
+ healFromStatus += healAmount * stacksMultiplier;
42
+ break;
43
+ case "modify_stats":
44
+ // Aplicar cambios a stat stages
45
+ if (eff.offenseDelta) {
46
+ statChanges.push({
47
+ stat: "offense",
48
+ delta: eff.offenseDelta * stacksMultiplier,
49
+ });
50
+ }
51
+ if (eff.defenseDelta) {
52
+ statChanges.push({
53
+ stat: "defense",
54
+ delta: eff.defenseDelta * stacksMultiplier,
55
+ });
56
+ }
57
+ if (eff.speedDelta) {
58
+ statChanges.push({
59
+ stat: "speed",
60
+ delta: eff.speedDelta * stacksMultiplier,
61
+ });
62
+ }
63
+ break;
64
+ default:
65
+ break;
34
66
  }
35
67
  });
68
+ // ✅ Aplicar daño si hay
36
69
  if (damageFromStatus > 0) {
37
- // Emit status tick event for narration
38
70
  events.push({
39
71
  ...createBaseEvent(state.turnNumber, "status_tick", `${updated.fighterId} sufre por ${st.statusId}`),
40
72
  targetId: updated.fighterId,
@@ -50,7 +82,51 @@ export const applyEndOfTurnStatuses = (state) => {
50
82
  break;
51
83
  }
52
84
  }
53
- // solo decrementamos si sigue vivo
85
+ // Aplicar curación si hay
86
+ if (healFromStatus > 0) {
87
+ const newHp = Math.min(updated.maxHp, updated.currentHp + healFromStatus);
88
+ const actualHeal = newHp - updated.currentHp;
89
+ if (actualHeal > 0) {
90
+ events.push({
91
+ ...createBaseEvent(state.turnNumber, "status_tick", `${updated.fighterId} se beneficia de ${st.statusId}`),
92
+ targetId: updated.fighterId,
93
+ statusId: st.statusId,
94
+ stacks: st.stacks,
95
+ });
96
+ events.push({
97
+ ...createBaseEvent(state.turnNumber, "heal", `${updated.fighterId} recupera ${actualHeal} HP por ${st.statusId}`),
98
+ actorId: updated.fighterId,
99
+ targetId: updated.fighterId,
100
+ amount: actualHeal,
101
+ });
102
+ updated = { ...updated, currentHp: newHp };
103
+ }
104
+ }
105
+ // ✅ Aplicar cambios de stats si hay
106
+ if (statChanges.length > 0) {
107
+ events.push({
108
+ ...createBaseEvent(state.turnNumber, "status_tick", `${updated.fighterId} sigue ${st.statusId}`),
109
+ targetId: updated.fighterId,
110
+ statusId: st.statusId,
111
+ stacks: st.stacks,
112
+ });
113
+ const newStatStages = { ...updated.statStages };
114
+ const changes = {};
115
+ statChanges.forEach(({ stat, delta }) => {
116
+ const currentStage = newStatStages[stat] || 0;
117
+ const newStage = Math.max(-6, Math.min(6, currentStage + delta));
118
+ newStatStages[stat] = newStage;
119
+ changes[stat] = delta;
120
+ });
121
+ events.push({
122
+ ...createBaseEvent(state.turnNumber, "stats_changed", `Stats de ${updated.fighterId} cambian por ${st.statusId}`),
123
+ targetId: updated.fighterId,
124
+ changes: changes,
125
+ source: "status",
126
+ });
127
+ updated = { ...updated, statStages: newStatStages };
128
+ }
129
+ // ✅ Decrementar duración y manejar expiración
54
130
  const remaining = st.remainingTurns - 1;
55
131
  if (remaining > 0) {
56
132
  let nextStacks = st.stacks;
@@ -49,6 +49,9 @@ export declare const TRIBE_FIGHTER_IDS: {
49
49
  readonly PORTERO_MISTERIOSO: import("../../index.js").FighterId;
50
50
  readonly ED_GEIN: import("../../index.js").FighterId;
51
51
  readonly JOSE_BRETON: import("../../index.js").FighterId;
52
+ readonly RUPER: import("../../index.js").FighterId;
53
+ readonly JESUCRISTO: import("../../index.js").FighterId;
54
+ readonly PEDRO_SANCHEZ: import("../../index.js").FighterId;
52
55
  };
53
56
  export declare const TRIBE_MOVE_IDS: {
54
57
  readonly TORTAZO: import("../../index.js").MoveId;
@@ -79,6 +82,8 @@ export declare const TRIBE_MOVE_IDS: {
79
82
  readonly MANCUERNAZO_DEPORTISTA: import("../../index.js").MoveId;
80
83
  readonly CHARLA_BUENISTA: import("../../index.js").MoveId;
81
84
  readonly GUITARRITA: import("../../index.js").MoveId;
85
+ readonly SIESTA_INFINITA: import("../../index.js").MoveId;
86
+ readonly POTA_ACIDA: import("../../index.js").MoveId;
82
87
  };
83
88
  export declare const TRIBE_STATUS_IDS: {
84
89
  readonly MEDITAR: import("../../index.js").StatusId;
@@ -50,6 +50,9 @@ export const TRIBE_FIGHTER_IDS = {
50
50
  PORTERO_MISTERIOSO: fighterId("portero_misterioso"),
51
51
  ED_GEIN: fighterId("ed_gein"),
52
52
  JOSE_BRETON: fighterId("jose_breton"),
53
+ RUPER: fighterId("ruper"),
54
+ JESUCRISTO: fighterId("jesucristo"),
55
+ PEDRO_SANCHEZ: fighterId("pedro_sanchez"),
53
56
  };
54
57
  export const TRIBE_MOVE_IDS = {
55
58
  TORTAZO: moveId("tortazo"),
@@ -80,6 +83,8 @@ export const TRIBE_MOVE_IDS = {
80
83
  MANCUERNAZO_DEPORTISTA: moveId("mancuernazo"),
81
84
  CHARLA_BUENISTA: moveId("charla_buenista"),
82
85
  GUITARRITA: moveId("guitarrita"),
86
+ SIESTA_INFINITA: moveId("siesta_infinita"),
87
+ POTA_ACIDA: moveId("pota_acida"),
83
88
  };
84
89
  export const TRIBE_STATUS_IDS = {
85
90
  MEDITAR: statusId("meditar"),
@@ -311,5 +311,32 @@ export const TRIBE_FIGHTERS = [
311
311
  classIds: [TRIBE_TYPE_IDS.LOCO],
312
312
  baseStats: makeStats(75, 75, 75, 5),
313
313
  recommendedMoves: [],
314
+ },
315
+ {
316
+ id: TRIBE_FIGHTER_IDS.RUPER,
317
+ name: "Ruper",
318
+ description: "Cree que se hará rico mañana. Rápido hablando, frágil si le preguntas qué hace.",
319
+ img: "ruper",
320
+ classIds: [TRIBE_TYPE_IDS.FIESTERO, TRIBE_TYPE_IDS.HIPPIE],
321
+ baseStats: makeStats(75, 75, 75, 5),
322
+ recommendedMoves: [],
323
+ },
324
+ {
325
+ id: TRIBE_FIGHTER_IDS.JESUCRISTO,
326
+ name: "Jesus Cristo",
327
+ description: "Cree que se hará rico mañana. Rápido hablando, frágil si le preguntas qué hace.",
328
+ img: "jesucristo",
329
+ classIds: [TRIBE_TYPE_IDS.MISTERIOSO, TRIBE_TYPE_IDS.FORMAL],
330
+ baseStats: makeStats(75, 75, 75, 5),
331
+ recommendedMoves: [],
332
+ },
333
+ {
334
+ id: TRIBE_FIGHTER_IDS.PEDRO_SANCHEZ,
335
+ name: "Pedro Sanchez",
336
+ description: "Cree que se hará rico mañana. Rápido hablando, frágil si le preguntas qué hace.",
337
+ img: "pedro_sanchez",
338
+ classIds: [TRIBE_TYPE_IDS.MISTERIOSO],
339
+ baseStats: makeStats(75, 75, 75, 5),
340
+ recommendedMoves: [],
314
341
  }
315
342
  ];
@@ -11,7 +11,7 @@ export const TRIBE_MOVES = [
11
11
  { kind: "damage", basePower: 30 },
12
12
  ],
13
13
  narration: [
14
- "{actor} le da un tortazo a {opponent} con la mano abierta."
14
+ "{actor} le da un tortazo a {victim} con la mano abierta."
15
15
  ]
16
16
  },
17
17
  {
@@ -26,7 +26,7 @@ export const TRIBE_MOVES = [
26
26
  { kind: "damage", flatAmount: 10, target: "self" },
27
27
  ],
28
28
  narration: [
29
- "{actor} le da un puñetazo a {opponent} en los dientes.",
29
+ "{actor} le da un puñetazo a {victim} en los dientes.",
30
30
  "Ambos se hacen daño..."
31
31
  ]
32
32
  },
@@ -169,6 +169,11 @@ export const TRIBE_MOVES = [
169
169
  { kind: "damage", basePower: 20 },
170
170
  { kind: "heal", amount: 20 },
171
171
  { kind: 'apply_status', statusId: TRIBE_STATUS_IDS.RESACA, target: 'self', chance: 0.5 }
172
+ ],
173
+ narration: [
174
+ "{actor}: Maricón el que deje algo...",
175
+ "{actor} y {victim} se terminan la copa de un trago",
176
+ "No les afecta por igual..."
172
177
  ]
173
178
  },
174
179
  {
@@ -372,4 +377,41 @@ export const TRIBE_MOVES = [
372
377
  "{actor} desafina bastante y daña los oídos de {victim}"
373
378
  ]
374
379
  },
380
+ {
381
+ id: TRIBE_MOVE_IDS.SIESTA_INFINITA,
382
+ name: "Siesta infinita",
383
+ typeId: TRIBE_TYPE_IDS.FORMAL,
384
+ accuracy: 100,
385
+ maxPP: 3,
386
+ priority: 0,
387
+ onlyForFighterIds: [TRIBE_FIGHTER_IDS.RUPER],
388
+ effects: [
389
+ { kind: "heal", amount: 40 },
390
+ { kind: 'modify_stats', offenseDelta: -1, speedDelta: -1, target: 'self' },
391
+ ],
392
+ narration: [
393
+ "{actor}: Me voy a dormir...",
394
+ "zzz...",
395
+ "zzz...",
396
+ "zzz...",
397
+ "3 años después {actor} se despierta renovado"
398
+ ]
399
+ },
400
+ {
401
+ id: TRIBE_MOVE_IDS.POTA_ACIDA,
402
+ name: "Pota ácida",
403
+ typeId: TRIBE_TYPE_IDS.FIESTERO,
404
+ accuracy: 100,
405
+ maxPP: 3,
406
+ priority: 0,
407
+ onlyForFighterIds: [TRIBE_FIGHTER_IDS.RUPER],
408
+ effects: [
409
+ { kind: "damage", basePower: 40 },
410
+ { kind: 'modify_stats', offenseDelta: -1, target: 'enemy' }
411
+ ],
412
+ narration: [
413
+ "Algo ha sentado mal a {actor}",
414
+ "{actor} le vomita en la cara a {victim}"
415
+ ]
416
+ },
375
417
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pokemon-io-core",
3
- "version": "0.0.128",
3
+ "version": "0.0.130",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",