pokemon-io-core 0.0.43 → 0.0.45
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/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/{core → engine}/engine.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/skins/CombatSkin.d.ts +1 -1
- package/dist/skins/index.d.ts +2 -2
- package/dist/skins/index.js +2 -2
- package/dist/skins/pokemon/index.d.ts +3 -3
- package/dist/skins/pokemon/index.js +3 -3
- package/dist/skins/pokemon/pokemonSkin.js +4 -5
- package/package.json +1 -1
- package/dist/api/battle.d.ts +0 -26
- package/dist/api/index.d.ts +0 -2
- package/dist/api/index.js +0 -2
- package/dist/api/room.d.ts +0 -21
- package/dist/api/room.js +0 -2
- package/dist/api/socketTypes.d.ts +0 -46
- package/dist/api/socketTypes.js +0 -1
- package/dist/core/actions.d.ts +0 -21
- package/dist/core/actions.js +0 -1
- package/dist/core/amulets.d.ts +0 -18
- package/dist/core/amulets.js +0 -1
- package/dist/core/events.d.ts +0 -67
- package/dist/core/events.js +0 -1
- package/dist/core/fighters.d.ts +0 -13
- package/dist/core/fighters.js +0 -1
- package/dist/core/ids.d.ts +0 -6
- package/dist/core/ids.js +0 -1
- package/dist/core/items.d.ts +0 -12
- package/dist/core/items.js +0 -1
- package/dist/core/moves.d.ts +0 -73
- package/dist/core/moves.js +0 -2
- package/dist/core/status.d.ts +0 -11
- package/dist/core/status.js +0 -1
- package/dist/core/types.d.ts +0 -14
- package/dist/core/types.js +0 -1
- package/dist/engine/index.d.ts +0 -1
- package/dist/engine/index.js +0 -1
- package/dist/engine/pokemonBattleService.d.ts +0 -6
- package/dist/engine/pokemonBattleService.js +0 -32
- package/dist/modules/auth/auth.schemas.d.ts +0 -24
- package/dist/modules/auth/auth.schemas.js +0 -26
- package/dist/modules/auth/index.d.ts +0 -1
- package/dist/modules/auth/index.js +0 -1
- package/dist/modules/enfrentamiento/enfrentamiento.enum.d.ts +0 -13
- package/dist/modules/enfrentamiento/enfrentamiento.enum.js +0 -15
- package/dist/modules/enfrentamiento/enfrentamiento.schemas.d.ts +0 -22
- package/dist/modules/enfrentamiento/enfrentamiento.schemas.js +0 -17
- package/dist/modules/enfrentamiento/enfrentamiento.types.d.ts +0 -19
- package/dist/modules/enfrentamiento/enfrentamiento.types.js +0 -1
- package/dist/modules/enfrentamiento/index.d.ts +0 -3
- package/dist/modules/enfrentamiento/index.js +0 -3
- package/dist/modules/equipos/equipos.enum.d.ts +0 -5
- package/dist/modules/equipos/equipos.enum.js +0 -6
- package/dist/modules/equipos/equipos.schemas.d.ts +0 -20
- package/dist/modules/equipos/equipos.schemas.js +0 -20
- package/dist/modules/equipos/equipos.types.d.ts +0 -14
- package/dist/modules/equipos/equipos.types.js +0 -1
- package/dist/modules/equipos/index.d.ts +0 -3
- package/dist/modules/equipos/index.js +0 -3
- package/dist/modules/liga/index.d.ts +0 -3
- package/dist/modules/liga/index.js +0 -3
- package/dist/modules/liga/liga.enum.d.ts +0 -14
- package/dist/modules/liga/liga.enum.js +0 -17
- package/dist/modules/liga/liga.schemas.d.ts +0 -59
- package/dist/modules/liga/liga.schemas.js +0 -41
- package/dist/modules/liga/liga.types.d.ts +0 -25
- package/dist/modules/liga/liga.types.js +0 -1
- package/dist/modules/user/index.d.ts +0 -2
- package/dist/modules/user/index.js +0 -2
- package/dist/modules/user/user.schemas.d.ts +0 -15
- package/dist/modules/user/user.schemas.js +0 -15
- package/dist/modules/user/user.types.d.ts +0 -16
- package/dist/modules/user/user.types.js +0 -1
- package/dist/shared/enums.d.ts +0 -0
- package/dist/shared/enums.js +0 -1
- package/dist/skins/pokemon/fighters.d.ts +0 -2
- package/dist/skins/pokemon/img/items/index.d.ts +0 -12
- package/dist/skins/pokemon/img/items/index.js +0 -22
- package/dist/skins/pokemon/img/pokemons/index.d.ts +0 -11
- package/dist/skins/pokemon/img/pokemons/index.js +0 -20
- 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 -13
- package/dist/skins/pokemon/statuses.d.ts +0 -2
- package/dist/skins/pokemon/types.d.ts +0 -13
- package/dist/utils/logger.d.ts +0 -9
- package/dist/utils/logger.js +0 -15
- /package/dist/{core → engine}/engine.js +0 -0
package/dist/core/index.d.ts
CHANGED
package/dist/core/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type BattleState, type FighterDefinition, type MoveDefinition, type ItemDefinition, type AmuletDefinition, type StatusDefinition, type TypeDefinition, type TypeEffectivenessMatrix, type BattleActions, type BattleEvent, type MoveId, type ItemId, type StatusId, type TypeId } from "
|
|
1
|
+
import { type BattleState, type FighterDefinition, type MoveDefinition, type ItemDefinition, type AmuletDefinition, type StatusDefinition, type TypeDefinition, type TypeEffectivenessMatrix, type BattleActions, type BattleEvent, type MoveId, type ItemId, type StatusId, type TypeId } from "../core";
|
|
2
2
|
interface BattleRules {
|
|
3
3
|
baseCritChance: number;
|
|
4
4
|
critPerStat: number;
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TypeDefinition, TypeEffectivenessMatrix, MoveDefinition, ItemDefinition, AmuletDefinition, StatusDefinition } from "../core";
|
|
2
|
-
import type { PlayerBattleConfig } from "../
|
|
2
|
+
import type { PlayerBattleConfig } from "../engine/engine";
|
|
3
3
|
export interface FighterLoadout {
|
|
4
4
|
fighterId: string | null;
|
|
5
5
|
itemIds: string[];
|
package/dist/skins/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
1
|
+
export * from "./pokemon";
|
|
2
|
+
export * from "./CombatSkin.js";
|
package/dist/skins/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
1
|
+
export * from "./pokemon";
|
|
2
|
+
export * from "./CombatSkin.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from "./types.js";
|
|
2
|
-
export * from "./moves.js";
|
|
3
1
|
export * from "./fighters.js";
|
|
4
|
-
export * from "./pokemonSkin.js";
|
|
5
2
|
export * from "./items.js";
|
|
3
|
+
export * from "./moves.js";
|
|
4
|
+
export * from "./pokemonSkin.js";
|
|
6
5
|
export * from "./statuses.js";
|
|
6
|
+
export * from "./types.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from "./types.js";
|
|
2
|
-
export * from "./moves.js";
|
|
3
1
|
export * from "./fighters.js";
|
|
4
|
-
export * from "./pokemonSkin.js";
|
|
5
2
|
export * from "./items.js";
|
|
3
|
+
export * from "./moves.js";
|
|
4
|
+
export * from "./pokemonSkin.js";
|
|
6
5
|
export * from "./statuses.js";
|
|
6
|
+
export * from "./types.js";
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
// pokemon-io-core/src/skins/pokemon/pokemonSkin.ts
|
|
2
|
-
import {
|
|
3
|
-
const MAX_HP_DEFAULT = 100;
|
|
2
|
+
import { POKEMON_FIGHTERS, POKEMON_ITEMS, POKEMON_MOVES, POKEMON_STATUSES, POKEMON_TYPES, POKEMON_TYPE_MATRIX, } from "./index";
|
|
4
3
|
// --- helpers ---
|
|
5
4
|
const findPokemonById = (id) => {
|
|
6
5
|
const lower = id.toLowerCase();
|
|
7
|
-
return
|
|
6
|
+
return POKEMON_FIGHTERS.find((f) => f.id.toLowerCase() === lower) ?? null;
|
|
8
7
|
};
|
|
9
8
|
const findMoveById = (id) => {
|
|
10
9
|
return POKEMON_MOVES.find((m) => m.id === id) ?? null;
|
|
@@ -85,10 +84,10 @@ export class PokemonSkin {
|
|
|
85
84
|
const items = buildItemsFromLoadout(loadout);
|
|
86
85
|
return {
|
|
87
86
|
fighter,
|
|
88
|
-
maxHp:
|
|
87
|
+
maxHp: fighter.baseStats.defense + fighter.baseStats.offense,
|
|
89
88
|
moves,
|
|
90
89
|
items,
|
|
91
|
-
amulet: null
|
|
90
|
+
amulet: null,
|
|
92
91
|
};
|
|
93
92
|
}
|
|
94
93
|
}
|
package/package.json
CHANGED
package/dist/api/battle.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { BattleEvent, StatusId } from "../core";
|
|
2
|
-
export interface BattlePlayerStatusView {
|
|
3
|
-
statusId: StatusId;
|
|
4
|
-
stacks: 1 | 2;
|
|
5
|
-
remainingTurns: number;
|
|
6
|
-
}
|
|
7
|
-
export interface BattlePlayerView {
|
|
8
|
-
playerId: string;
|
|
9
|
-
nickname: string;
|
|
10
|
-
hp: number;
|
|
11
|
-
statuses: BattlePlayerStatusView[];
|
|
12
|
-
}
|
|
13
|
-
export type BattleStatus = "ongoing" | "finished";
|
|
14
|
-
export interface BattleView {
|
|
15
|
-
roomId: string;
|
|
16
|
-
status: BattleStatus;
|
|
17
|
-
winnerId: string | null;
|
|
18
|
-
currentTurnPlayerId: string | null;
|
|
19
|
-
startedAt: string;
|
|
20
|
-
players: BattlePlayerView[];
|
|
21
|
-
events: BattleEvent[];
|
|
22
|
-
turnStartHpByPlayerId: {
|
|
23
|
-
[playerId: string]: number;
|
|
24
|
-
};
|
|
25
|
-
turnNumber: number;
|
|
26
|
-
}
|
package/dist/api/index.d.ts
DELETED
package/dist/api/index.js
DELETED
package/dist/api/room.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export interface PlayerLoadoutView {
|
|
2
|
-
fighterId: string | null;
|
|
3
|
-
moveIds: string[];
|
|
4
|
-
itemIds: string[];
|
|
5
|
-
amuletId: string | null;
|
|
6
|
-
}
|
|
7
|
-
export interface PlayerView {
|
|
8
|
-
id: string;
|
|
9
|
-
nickname: string;
|
|
10
|
-
isOwner: boolean;
|
|
11
|
-
isSelf: boolean;
|
|
12
|
-
isReady: boolean;
|
|
13
|
-
loadout: PlayerLoadoutView | null;
|
|
14
|
-
}
|
|
15
|
-
export type RoomStatusView = "waiting" | "in_battle" | "finished";
|
|
16
|
-
export interface RoomView {
|
|
17
|
-
id: string;
|
|
18
|
-
ownerId: string;
|
|
19
|
-
status: RoomStatusView;
|
|
20
|
-
players: PlayerView[];
|
|
21
|
-
}
|
package/dist/api/room.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { BattleView } from "./battle";
|
|
2
|
-
import { RoomView } from "./room";
|
|
3
|
-
export interface ClientToServerEvents {
|
|
4
|
-
"room:create": (payload: {
|
|
5
|
-
nickname: string;
|
|
6
|
-
}) => void;
|
|
7
|
-
"room:join": (payload: {
|
|
8
|
-
roomId: string;
|
|
9
|
-
nickname: string;
|
|
10
|
-
}) => void;
|
|
11
|
-
"room:leave": (payload: {
|
|
12
|
-
roomId: string;
|
|
13
|
-
}) => void;
|
|
14
|
-
"room:setLoadout": (payload: {
|
|
15
|
-
roomId: string;
|
|
16
|
-
fighterId: string;
|
|
17
|
-
moveIds: string[];
|
|
18
|
-
itemIds: string[];
|
|
19
|
-
amuletId?: string | null;
|
|
20
|
-
}) => void;
|
|
21
|
-
"room:startBattleRequest": (payload: {
|
|
22
|
-
roomId: string;
|
|
23
|
-
}) => void;
|
|
24
|
-
"battle:useMove": (payload: {
|
|
25
|
-
roomId: string;
|
|
26
|
-
moveIndex: number;
|
|
27
|
-
}) => void;
|
|
28
|
-
"battle:useItem": (payload: {
|
|
29
|
-
roomId: string;
|
|
30
|
-
itemIndex: number;
|
|
31
|
-
}) => void;
|
|
32
|
-
"ping": () => void;
|
|
33
|
-
}
|
|
34
|
-
export interface ServerToClientEvents {
|
|
35
|
-
"connection:state": (payload: {
|
|
36
|
-
isConnected: boolean;
|
|
37
|
-
socketId: string | null;
|
|
38
|
-
}) => void;
|
|
39
|
-
"room:state": (payload: RoomView) => void;
|
|
40
|
-
"room:error": (payload: {
|
|
41
|
-
code: string;
|
|
42
|
-
message: string;
|
|
43
|
-
}) => void;
|
|
44
|
-
"battle:state": (payload: BattleView) => void;
|
|
45
|
-
"pong": (msg: string) => void;
|
|
46
|
-
}
|
package/dist/api/socketTypes.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/core/actions.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export type ActionKind = "use_move" | "use_item" | "switch_fighter" | "no_action";
|
|
2
|
-
export interface UseMoveAction {
|
|
3
|
-
kind: "use_move";
|
|
4
|
-
moveIndex: number;
|
|
5
|
-
}
|
|
6
|
-
export interface UseItemAction {
|
|
7
|
-
kind: "use_item";
|
|
8
|
-
itemIndex: number;
|
|
9
|
-
}
|
|
10
|
-
export interface SwitchFighterAction {
|
|
11
|
-
kind: "switch_fighter";
|
|
12
|
-
targetIndex: number;
|
|
13
|
-
}
|
|
14
|
-
export interface NoAction {
|
|
15
|
-
kind: "no_action";
|
|
16
|
-
}
|
|
17
|
-
export type PlayerAction = UseMoveAction | UseItemAction | SwitchFighterAction | NoAction;
|
|
18
|
-
export interface BattleActions {
|
|
19
|
-
player1: PlayerAction;
|
|
20
|
-
player2: PlayerAction;
|
|
21
|
-
}
|
package/dist/core/actions.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/core/amulets.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { AmuletId, TypeId, StatusId } from "./ids";
|
|
2
|
-
import type { EffectDefinition } from "./moves";
|
|
3
|
-
export type PassiveTriggerKind = "always" | "on_hit" | "on_damage_taken" | "on_below_hp_threshold";
|
|
4
|
-
export interface PassiveTriggerCondition {
|
|
5
|
-
kind: PassiveTriggerKind;
|
|
6
|
-
hpThresholdPercent?: number;
|
|
7
|
-
}
|
|
8
|
-
export interface PassiveEffectDefinition {
|
|
9
|
-
trigger: PassiveTriggerCondition;
|
|
10
|
-
effects: EffectDefinition[];
|
|
11
|
-
appliedStatusId?: StatusId;
|
|
12
|
-
}
|
|
13
|
-
export interface AmuletDefinition {
|
|
14
|
-
id: AmuletId;
|
|
15
|
-
name: string;
|
|
16
|
-
classId: TypeId | null;
|
|
17
|
-
passiveEffects: PassiveEffectDefinition[];
|
|
18
|
-
}
|
package/dist/core/amulets.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/core/events.d.ts
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import type { FighterId, MoveId, ItemId, StatusId } from "./ids";
|
|
2
|
-
export type BattleEventKind = "turn_start" | "action_declared" | "action_skipped_hard_cc" | "move_miss" | "move_hit" | "item_used" | "status_cleared" | "damage" | "heal" | "shield_applied" | "status_applied" | "status_refreshed" | "status_expired" | "fighter_fainted" | "turn_end" | "battle_end";
|
|
3
|
-
export interface BaseBattleEvent {
|
|
4
|
-
id: string;
|
|
5
|
-
turnNumber: number;
|
|
6
|
-
kind: BattleEventKind;
|
|
7
|
-
message: string;
|
|
8
|
-
timestamp: number;
|
|
9
|
-
}
|
|
10
|
-
export interface ActionDeclaredEvent extends BaseBattleEvent {
|
|
11
|
-
kind: "action_declared";
|
|
12
|
-
actorId: FighterId;
|
|
13
|
-
}
|
|
14
|
-
export interface MoveMissEvent extends BaseBattleEvent {
|
|
15
|
-
kind: "move_miss";
|
|
16
|
-
actorId: FighterId;
|
|
17
|
-
moveId: MoveId;
|
|
18
|
-
targetId: FighterId;
|
|
19
|
-
}
|
|
20
|
-
export interface MoveHitEvent extends BaseBattleEvent {
|
|
21
|
-
kind: "move_hit";
|
|
22
|
-
actorId: FighterId;
|
|
23
|
-
moveId: MoveId;
|
|
24
|
-
targetId: FighterId;
|
|
25
|
-
isCritical: boolean;
|
|
26
|
-
effectiveness: number;
|
|
27
|
-
}
|
|
28
|
-
export interface ItemUsedEvent extends BaseBattleEvent {
|
|
29
|
-
kind: "item_used";
|
|
30
|
-
actorId: FighterId;
|
|
31
|
-
itemId: ItemId;
|
|
32
|
-
targetId: FighterId;
|
|
33
|
-
}
|
|
34
|
-
export interface DamageEvent extends BaseBattleEvent {
|
|
35
|
-
kind: "damage";
|
|
36
|
-
actorId: FighterId;
|
|
37
|
-
targetId: FighterId;
|
|
38
|
-
amount: number;
|
|
39
|
-
isCritical: boolean;
|
|
40
|
-
}
|
|
41
|
-
export interface HealEvent extends BaseBattleEvent {
|
|
42
|
-
kind: "heal";
|
|
43
|
-
actorId: FighterId;
|
|
44
|
-
targetId: FighterId;
|
|
45
|
-
amount: number;
|
|
46
|
-
}
|
|
47
|
-
export interface StatusAppliedEvent extends BaseBattleEvent {
|
|
48
|
-
kind: "status_applied";
|
|
49
|
-
targetId: FighterId;
|
|
50
|
-
statusId: StatusId;
|
|
51
|
-
stacks: 1 | 2;
|
|
52
|
-
durationTurns: number;
|
|
53
|
-
}
|
|
54
|
-
export interface StatusExpiredEvent extends BaseBattleEvent {
|
|
55
|
-
kind: "status_expired";
|
|
56
|
-
targetId: FighterId;
|
|
57
|
-
statusId: StatusId;
|
|
58
|
-
}
|
|
59
|
-
export interface FighterFaintedEvent extends BaseBattleEvent {
|
|
60
|
-
kind: "fighter_fainted";
|
|
61
|
-
fighterId: FighterId;
|
|
62
|
-
}
|
|
63
|
-
export interface BattleEndEvent extends BaseBattleEvent {
|
|
64
|
-
kind: "battle_end";
|
|
65
|
-
winner: "player1" | "player2" | "draw";
|
|
66
|
-
}
|
|
67
|
-
export type BattleEvent = ActionDeclaredEvent | MoveMissEvent | MoveHitEvent | ItemUsedEvent | DamageEvent | HealEvent | StatusAppliedEvent | StatusExpiredEvent | FighterFaintedEvent | BattleEndEvent | BaseBattleEvent;
|
package/dist/core/events.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/core/fighters.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { FighterId, TypeId, MoveId, ItemId, AmuletId } from "./ids";
|
|
2
|
-
import type { FighterStats } from "./types";
|
|
3
|
-
export interface FighterDefinition {
|
|
4
|
-
id: FighterId;
|
|
5
|
-
name: string;
|
|
6
|
-
description?: string;
|
|
7
|
-
img?: string;
|
|
8
|
-
classId: TypeId;
|
|
9
|
-
baseStats: FighterStats;
|
|
10
|
-
recommendedMoves?: MoveId[];
|
|
11
|
-
recommendedItems?: ItemId[];
|
|
12
|
-
recommendedAmuletId?: AmuletId;
|
|
13
|
-
}
|
package/dist/core/fighters.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/core/ids.d.ts
DELETED
package/dist/core/ids.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/core/items.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ItemId } from "./ids";
|
|
2
|
-
import type { EffectDefinition, TargetKind } from "./moves";
|
|
3
|
-
export type ItemCategory = "damage" | "heal_shield" | "status_buff";
|
|
4
|
-
export interface ItemDefinition {
|
|
5
|
-
id: ItemId;
|
|
6
|
-
name: string;
|
|
7
|
-
category: ItemCategory;
|
|
8
|
-
target: TargetKind;
|
|
9
|
-
maxUses: number;
|
|
10
|
-
image: string;
|
|
11
|
-
effects: EffectDefinition[];
|
|
12
|
-
}
|
package/dist/core/items.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/core/moves.d.ts
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import type { MoveId, StatusId, TypeId } from "./ids";
|
|
2
|
-
export type EffectTarget = "self" | "enemy";
|
|
3
|
-
export type EffectKind = "damage" | "heal" | "shield" | "modify_stats" | "apply_status" | "clear_status" | "modify_hit_chance" | "modify_crit_chance" | "modify_priority" | "modify_effective_speed";
|
|
4
|
-
export type TargetKind = EffectTarget;
|
|
5
|
-
interface BaseEffect {
|
|
6
|
-
target?: EffectTarget;
|
|
7
|
-
}
|
|
8
|
-
export interface DamageEffect extends BaseEffect {
|
|
9
|
-
kind: "damage";
|
|
10
|
-
/**
|
|
11
|
-
* Daño “de fórmula” (stats + tipo + crit…).
|
|
12
|
-
* Si no se define, NO se llama a computeDamage.
|
|
13
|
-
*/
|
|
14
|
-
basePower?: number;
|
|
15
|
-
/**
|
|
16
|
-
* Daño plano adicional.
|
|
17
|
-
* Se suma al daño de fórmula o se usa solo si no hay basePower.
|
|
18
|
-
*/
|
|
19
|
-
flatAmount?: number;
|
|
20
|
-
}
|
|
21
|
-
export interface HealEffect extends BaseEffect {
|
|
22
|
-
kind: "heal";
|
|
23
|
-
amount: number;
|
|
24
|
-
}
|
|
25
|
-
export interface ShieldEffect extends BaseEffect {
|
|
26
|
-
kind: "shield";
|
|
27
|
-
amount: number;
|
|
28
|
-
durationTurns: number;
|
|
29
|
-
}
|
|
30
|
-
export interface ModifyStatsEffect extends BaseEffect {
|
|
31
|
-
kind: "modify_stats";
|
|
32
|
-
offenseDelta?: number;
|
|
33
|
-
defenseDelta?: number;
|
|
34
|
-
speedDelta?: number;
|
|
35
|
-
critDelta?: number;
|
|
36
|
-
}
|
|
37
|
-
export interface ApplyStatusEffect extends BaseEffect {
|
|
38
|
-
kind: "apply_status";
|
|
39
|
-
statusId: StatusId;
|
|
40
|
-
}
|
|
41
|
-
export interface ClearStatusEffect extends BaseEffect {
|
|
42
|
-
kind: "clear_status";
|
|
43
|
-
statusIds?: StatusId[];
|
|
44
|
-
kinds?: ("hard_cc" | "soft")[];
|
|
45
|
-
clearAll?: boolean;
|
|
46
|
-
}
|
|
47
|
-
export interface ModifyHitChanceEffect extends BaseEffect {
|
|
48
|
-
kind: "modify_hit_chance";
|
|
49
|
-
delta: number;
|
|
50
|
-
}
|
|
51
|
-
export interface ModifyCritChanceEffect extends BaseEffect {
|
|
52
|
-
kind: "modify_crit_chance";
|
|
53
|
-
delta: number;
|
|
54
|
-
}
|
|
55
|
-
export interface ModifyPriorityEffect extends BaseEffect {
|
|
56
|
-
kind: "modify_priority";
|
|
57
|
-
delta: number;
|
|
58
|
-
}
|
|
59
|
-
export interface ModifyEffectiveSpeedEffect extends BaseEffect {
|
|
60
|
-
kind: "modify_effective_speed";
|
|
61
|
-
multiplier: number;
|
|
62
|
-
}
|
|
63
|
-
export type EffectDefinition = DamageEffect | HealEffect | ShieldEffect | ModifyStatsEffect | ApplyStatusEffect | ClearStatusEffect | ModifyHitChanceEffect | ModifyCritChanceEffect | ModifyPriorityEffect | ModifyEffectiveSpeedEffect;
|
|
64
|
-
export interface MoveDefinition {
|
|
65
|
-
id: MoveId;
|
|
66
|
-
name: string;
|
|
67
|
-
typeId: TypeId;
|
|
68
|
-
accuracy?: number;
|
|
69
|
-
maxPP: number;
|
|
70
|
-
priority?: number;
|
|
71
|
-
effects: EffectDefinition[];
|
|
72
|
-
}
|
|
73
|
-
export {};
|
package/dist/core/moves.js
DELETED
package/dist/core/status.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { StatusId } from "./ids";
|
|
2
|
-
import type { EffectDefinition } from "./moves";
|
|
3
|
-
export type StatusKind = "hard_cc" | "soft";
|
|
4
|
-
export interface StatusDefinition {
|
|
5
|
-
id: StatusId;
|
|
6
|
-
name: string;
|
|
7
|
-
kind: StatusKind;
|
|
8
|
-
minDurationTurns: number;
|
|
9
|
-
maxDurationTurns: number;
|
|
10
|
-
effectsPerStack: EffectDefinition[];
|
|
11
|
-
}
|
package/dist/core/status.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/core/types.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { TypeId } from "./ids";
|
|
2
|
-
export type Effectiveness = 0 | 0.75 | 1 | 1.25;
|
|
3
|
-
export interface TypeDefinition {
|
|
4
|
-
id: TypeId;
|
|
5
|
-
displayName: string;
|
|
6
|
-
color?: string;
|
|
7
|
-
}
|
|
8
|
-
export type TypeEffectivenessMatrix = Record<TypeId, Record<TypeId, Effectiveness>>;
|
|
9
|
-
export interface FighterStats {
|
|
10
|
-
offense: number;
|
|
11
|
-
defense: number;
|
|
12
|
-
speed: number;
|
|
13
|
-
crit: number;
|
|
14
|
-
}
|
package/dist/core/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/engine/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./pokemonBattleService.js";
|
package/dist/engine/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./pokemonBattleService.js";
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { BattleActions, BattleState } from "../core";
|
|
2
|
-
export declare const createPokemonBattle: (fighter1Id: string, fighter2Id: string) => BattleState;
|
|
3
|
-
export declare const runPokemonTurn: (state: BattleState, actions: BattleActions) => {
|
|
4
|
-
newState: BattleState;
|
|
5
|
-
events: import("..").BattleEvent[];
|
|
6
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { POKEMON_FIGHTERS, POKEMON_MOVES, POKEMON_TYPE_MATRIX, POKEMON_TYPES } from "../skins/pokemon";
|
|
2
|
-
import { createInitialBattleState, resolveTurn } from "../core/engine";
|
|
3
|
-
const findPokemon = (id) => POKEMON_FIGHTERS.find((p) => p.id === id);
|
|
4
|
-
const findMove = (id) => POKEMON_MOVES.find((m) => m.id === id);
|
|
5
|
-
export const createPokemonBattle = (fighter1Id, fighter2Id) => {
|
|
6
|
-
const f1 = findPokemon(fighter1Id);
|
|
7
|
-
const f2 = findPokemon(fighter2Id);
|
|
8
|
-
const config = {
|
|
9
|
-
types: POKEMON_TYPES,
|
|
10
|
-
typeEffectiveness: POKEMON_TYPE_MATRIX,
|
|
11
|
-
moves: POKEMON_MOVES,
|
|
12
|
-
items: [], // MVP: sin items
|
|
13
|
-
amulets: [],
|
|
14
|
-
statuses: [],
|
|
15
|
-
player1: {
|
|
16
|
-
fighter: f1,
|
|
17
|
-
maxHp: 100,
|
|
18
|
-
moves: POKEMON_MOVES.filter((m) => (f1.recommendedMoves ?? []).includes(m.id)),
|
|
19
|
-
items: [],
|
|
20
|
-
amulet: null
|
|
21
|
-
},
|
|
22
|
-
player2: {
|
|
23
|
-
fighter: f2,
|
|
24
|
-
maxHp: 100,
|
|
25
|
-
moves: POKEMON_MOVES.filter((m) => (f2.recommendedMoves ?? []).includes(m.id)),
|
|
26
|
-
items: [],
|
|
27
|
-
amulet: null
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
return createInitialBattleState(config);
|
|
31
|
-
};
|
|
32
|
-
export const runPokemonTurn = (state, actions) => resolveTurn(state, actions);
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const RegisterSchema: z.ZodObject<{
|
|
3
|
-
email: z.ZodEmail;
|
|
4
|
-
nombre: z.ZodOptional<z.ZodString>;
|
|
5
|
-
username: z.ZodString;
|
|
6
|
-
password: z.ZodString;
|
|
7
|
-
confirmPassword: z.ZodString;
|
|
8
|
-
movil: z.ZodString;
|
|
9
|
-
}, z.core.$strip>;
|
|
10
|
-
export type RegisterBody = z.infer<typeof RegisterSchema>;
|
|
11
|
-
export declare const VerifyEmailSchema: z.ZodObject<{
|
|
12
|
-
email: z.ZodEmail;
|
|
13
|
-
code: z.ZodString;
|
|
14
|
-
}, z.core.$strip>;
|
|
15
|
-
export type VerifyEmailBody = z.infer<typeof VerifyEmailSchema>;
|
|
16
|
-
export declare const ResendCodeSchema: z.ZodObject<{
|
|
17
|
-
email: z.ZodEmail;
|
|
18
|
-
}, z.core.$strip>;
|
|
19
|
-
export type ResendCodeBody = z.infer<typeof ResendCodeSchema>;
|
|
20
|
-
export declare const LoginSchema: z.ZodObject<{
|
|
21
|
-
email: z.ZodEmail;
|
|
22
|
-
password: z.ZodString;
|
|
23
|
-
}, z.core.$strip>;
|
|
24
|
-
export type LoginBody = z.infer<typeof LoginSchema>;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export const RegisterSchema = z.object({
|
|
3
|
-
email: z.email("Introduce un correo válido"),
|
|
4
|
-
nombre: z.string().optional(),
|
|
5
|
-
username: z
|
|
6
|
-
.string("Introduce un nombre de usuario")
|
|
7
|
-
.min(3, "El nombre de usuario debe tener al menos 3 caracteres"),
|
|
8
|
-
password: z
|
|
9
|
-
.string("Introduce una contraseña")
|
|
10
|
-
.min(6, "La contraseña debe tener al menos 6 caracteres"),
|
|
11
|
-
confirmPassword: z
|
|
12
|
-
.string()
|
|
13
|
-
.min(6, "La contraseña debe tener al menos 6 caracteres"),
|
|
14
|
-
movil: z.string().min(1, "Introduce un número de móvil"),
|
|
15
|
-
});
|
|
16
|
-
export const VerifyEmailSchema = z.object({
|
|
17
|
-
email: z.email(),
|
|
18
|
-
code: z.string().length(6, "El código debe tener 6 dígitos"),
|
|
19
|
-
});
|
|
20
|
-
export const ResendCodeSchema = z.object({
|
|
21
|
-
email: z.email(),
|
|
22
|
-
});
|
|
23
|
-
export const LoginSchema = z.object({
|
|
24
|
-
email: z.email('Introduce un correo válido'),
|
|
25
|
-
password: z.string().min(6, 'La contraseña debe tener al menos 6 caracteres'),
|
|
26
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './auth.schemas.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './auth.schemas.js';
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare enum EstadoEnfrentamiento {
|
|
2
|
-
SinJugar = "SIN_JUGAR",
|
|
3
|
-
CorroborarResultado = "CORROBORAR_RESULTADO",
|
|
4
|
-
ConfirmarResultado = "CONFIRMAR_RESULTADO",
|
|
5
|
-
Jugado = "JUGADO"
|
|
6
|
-
}
|
|
7
|
-
export declare enum EstadoEnfrentamientoConOpcionCualquiera {
|
|
8
|
-
SinJugar = "SIN_JUGAR",
|
|
9
|
-
CorroborarResultado = "CORROBORAR_RESULTADO",
|
|
10
|
-
ConfirmarResultado = "CONFIRMAR_RESULTADO",
|
|
11
|
-
Jugado = "JUGADO",
|
|
12
|
-
Cualquiera = "CUALQUIERA"
|
|
13
|
-
}
|