pokemon-io-core 0.0.80 → 0.0.81
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/engine.js +9 -2
- package/dist/core/events.d.ts +6 -0
- package/package.json +1 -1
package/dist/core/engine.js
CHANGED
|
@@ -537,8 +537,15 @@ const resolveSwitchFighter = (state, playerKey, action) => {
|
|
|
537
537
|
}
|
|
538
538
|
const fromFighter = selfPlayer.fighterTeam[fromIndex];
|
|
539
539
|
events.push({
|
|
540
|
-
...createBaseEvent(state.turnNumber, "
|
|
541
|
-
|
|
540
|
+
...createBaseEvent(state.turnNumber, "fighter_switched", `El entrenador retira a ${fromFighter.fighterId} y manda a ${target.fighterId}`),
|
|
541
|
+
fromFighterId: fromFighter.fighterId,
|
|
542
|
+
toFighterId: target.fighterId,
|
|
543
|
+
toHp: target.currentHp,
|
|
544
|
+
toStatuses: (target.statuses ?? []).map((st) => ({
|
|
545
|
+
statusId: st.statusId,
|
|
546
|
+
stacks: st.stacks,
|
|
547
|
+
remainingTurns: st.remainingTurns,
|
|
548
|
+
})),
|
|
542
549
|
});
|
|
543
550
|
// actualizar activeIndex
|
|
544
551
|
if (playerKey === "player1") {
|
package/dist/core/events.d.ts
CHANGED
|
@@ -55,6 +55,12 @@ export interface FighterSwitchedEvent extends BaseBattleEvent {
|
|
|
55
55
|
kind: "fighter_switched";
|
|
56
56
|
fromFighterId: FighterId;
|
|
57
57
|
toFighterId: FighterId;
|
|
58
|
+
toHp: number;
|
|
59
|
+
toStatuses: {
|
|
60
|
+
statusId: string;
|
|
61
|
+
stacks: 1 | 2;
|
|
62
|
+
remainingTurns: number;
|
|
63
|
+
}[];
|
|
58
64
|
}
|
|
59
65
|
export interface StatusExpiredEvent extends BaseBattleEvent {
|
|
60
66
|
kind: "status_expired";
|