pokemon-io-core 0.0.110 → 0.0.111

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.
@@ -158,14 +158,9 @@ export const resolveDamageMove = (state, playerKey, action) => {
158
158
  effectiveness,
159
159
  defenderBeforeHp: opponent.currentHp,
160
160
  });
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);
161
+ // Events are pushed in order:
162
+ // 1. Move Hit (summary: critical/effective)
163
+ // 2. Effects (damage, recoil, status...)
169
164
  events.push({
170
165
  ...createBaseEvent(state.turnNumber, "move_hit", `${self.fighterId} acierta ${move.name}`),
171
166
  actorId: self.fighterId,
@@ -174,6 +169,14 @@ export const resolveDamageMove = (state, playerKey, action) => {
174
169
  isCritical,
175
170
  effectiveness,
176
171
  });
172
+ dbg("MOVE_EFFECTS", {
173
+ moveId: move.id,
174
+ moveName: move.name,
175
+ effects: move.effects,
176
+ });
177
+ // Apply Effects
178
+ const { actor: finalSelf, target: finalOpp, events: extraEvents, } = applyEffectsOnTarget(state, updatedSelf, updatedOpponent, move.typeId, isCritical, move.effects);
179
+ events.push(...extraEvents);
177
180
  let newState = updateFightersInState(state, playerKey, finalSelf, finalOpp);
178
181
  // --- FORCED SWITCH (Roar) ---
179
182
  const hasForceSwitch = move.effects.some((e) => e.kind === "force_switch");
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.111",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",