pokemon-io-core 0.0.118 → 0.0.120
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/engine.d.ts +53 -0
- package/dist/core/engine.js +1046 -0
- package/dist/core/fighters.d.ts +1 -1
- package/dist/core/types.d.ts +1 -1
- package/dist/engine/combat/damage.js +9 -9
- package/dist/engine/engine.d.ts +53 -0
- package/dist/engine/engine.js +1046 -0
- package/dist/engine/index.d.ts +1 -1
- package/dist/engine/pokemonBattleService.d.ts +6 -0
- package/dist/engine/pokemonBattleService.js +32 -0
- package/dist/engine/turn/index.d.ts +1 -0
- package/dist/engine/turn/index.js +1 -0
- package/dist/skins/pokemon/data/pokemon-moves.json +609 -0
- package/dist/skins/pokemon/moves.js +0 -1
- package/package.json +1 -1
|
@@ -0,0 +1,53 @@
|
|
|
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/index.js";
|
|
2
|
+
interface BattleRules {
|
|
3
|
+
baseCritChance: number;
|
|
4
|
+
critPerStat: number;
|
|
5
|
+
critMultiplier: number;
|
|
6
|
+
stabMultiplier: number;
|
|
7
|
+
randomMinDamageFactor: number;
|
|
8
|
+
randomMaxDamageFactor: number;
|
|
9
|
+
}
|
|
10
|
+
export interface BattleRuntime {
|
|
11
|
+
rules: BattleRules;
|
|
12
|
+
typesById: Record<TypeId, TypeDefinition>;
|
|
13
|
+
movesById: Record<MoveId, MoveDefinition>;
|
|
14
|
+
itemsById: Record<ItemId, ItemDefinition>;
|
|
15
|
+
amuletsById: Record<string, AmuletDefinition>;
|
|
16
|
+
statusesById: Record<StatusId, StatusDefinition>;
|
|
17
|
+
typeEffectiveness: TypeEffectivenessMatrix;
|
|
18
|
+
}
|
|
19
|
+
export interface PlayerFighterBattleConfig {
|
|
20
|
+
fighter: FighterDefinition;
|
|
21
|
+
maxHp: number;
|
|
22
|
+
moves: MoveDefinition[];
|
|
23
|
+
amulet: AmuletDefinition | null;
|
|
24
|
+
}
|
|
25
|
+
export interface PlayerBattleConfig {
|
|
26
|
+
fighters: PlayerFighterBattleConfig[];
|
|
27
|
+
items: ItemDefinition[];
|
|
28
|
+
amulet: AmuletDefinition | null;
|
|
29
|
+
}
|
|
30
|
+
export interface BattleConfig {
|
|
31
|
+
types: TypeDefinition[];
|
|
32
|
+
typeEffectiveness: TypeEffectivenessMatrix;
|
|
33
|
+
moves: MoveDefinition[];
|
|
34
|
+
items: ItemDefinition[];
|
|
35
|
+
amulets: AmuletDefinition[];
|
|
36
|
+
statuses: StatusDefinition[];
|
|
37
|
+
player1: PlayerBattleConfig;
|
|
38
|
+
player2: PlayerBattleConfig;
|
|
39
|
+
rules?: Partial<BattleRules>;
|
|
40
|
+
}
|
|
41
|
+
export interface RuntimeBattleState extends BattleState {
|
|
42
|
+
runtime: BattleRuntime;
|
|
43
|
+
}
|
|
44
|
+
export declare const createInitialBattleState: (config: BattleConfig) => BattleState;
|
|
45
|
+
export declare const applyForcedSwitchChoice: (state: BattleState, targetPlayer: "player1" | "player2", newIndex: number) => {
|
|
46
|
+
state: BattleState;
|
|
47
|
+
events: BattleEvent[];
|
|
48
|
+
};
|
|
49
|
+
export declare const resolveTurn: (state: BattleState, actions: BattleActions) => {
|
|
50
|
+
newState: BattleState;
|
|
51
|
+
events: BattleEvent[];
|
|
52
|
+
};
|
|
53
|
+
export {};
|