pokemon-io-core 0.0.111 → 0.0.113
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/fighters.d.ts +1 -1
- package/dist/engine/actions/move.js +5 -1
- package/dist/engine/combat/damage.js +17 -11
- package/dist/engine/events/applyRandomEvent.js +1 -3
- package/dist/engine/fighters/fighter.js +1 -1
- package/dist/skins/cliches/fighters.js +18 -18
- package/dist/skins/pokemon/fighters.js +18 -18
- package/package.json +2 -2
- package/dist/api/battle.d.ts +0 -90
- package/dist/api/room.d.ts +0 -29
- package/dist/api/socketTypes.d.ts +0 -96
- package/dist/core/actions.d.ts +0 -22
- package/dist/core/amulets.d.ts +0 -18
- package/dist/core/battleRuntime.d.ts +0 -46
- package/dist/core/emotes.d.ts +0 -13
- package/dist/core/engine.d.ts +0 -53
- package/dist/core/engine.js +0 -1046
- package/dist/core/events.d.ts +0 -142
- package/dist/core/ids.d.ts +0 -6
- package/dist/core/index.d.ts +0 -16
- package/dist/core/items.d.ts +0 -12
- package/dist/core/moves.d.ts +0 -87
- package/dist/core/randomEvents.d.ts +0 -28
- package/dist/core/randomEventsList.d.ts +0 -11
- package/dist/core/status.d.ts +0 -11
- package/dist/core/types.d.ts +0 -14
- package/dist/engine/actions/forcedSwitch.d.ts +0 -5
- package/dist/engine/actions/index.d.ts +0 -5
- package/dist/engine/actions/item.d.ts +0 -6
- package/dist/engine/actions/move.d.ts +0 -7
- package/dist/engine/actions/priority.d.ts +0 -6
- package/dist/engine/actions/switch.d.ts +0 -6
- package/dist/engine/combat/crit.d.ts +0 -2
- package/dist/engine/combat/damage.d.ts +0 -20
- package/dist/engine/combat/heal.d.ts +0 -6
- package/dist/engine/combat/index.d.ts +0 -5
- package/dist/engine/combat/stages.d.ts +0 -5
- package/dist/engine/combat/typeEffectiveness.d.ts +0 -3
- package/dist/engine/combat/winner.d.ts +0 -2
- package/dist/engine/debug.d.ts +0 -1
- package/dist/engine/effects/applyEffects.d.ts +0 -7
- package/dist/engine/effects/index.d.ts +0 -2
- package/dist/engine/effects/target.d.ts +0 -6
- package/dist/engine/engine.d.ts +0 -53
- package/dist/engine/engine.js +0 -1046
- package/dist/engine/events/applyRandomEvent.d.ts +0 -11
- package/dist/engine/events/index.d.ts +0 -2
- package/dist/engine/events/randomEventTrigger.d.ts +0 -16
- package/dist/engine/events.d.ts +0 -8
- package/dist/engine/fighters/fighter.d.ts +0 -4
- package/dist/engine/fighters/index.d.ts +0 -3
- package/dist/engine/fighters/selectors.d.ts +0 -13
- package/dist/engine/fighters/update.d.ts +0 -3
- package/dist/engine/index.d.ts +0 -12
- package/dist/engine/pokemonBattleService.d.ts +0 -6
- package/dist/engine/pokemonBattleService.js +0 -32
- package/dist/engine/rng.d.ts +0 -2
- package/dist/engine/rules.d.ts +0 -6
- package/dist/engine/runtime.d.ts +0 -7
- package/dist/engine/status/apply.d.ts +0 -6
- package/dist/engine/status/clear.d.ts +0 -6
- package/dist/engine/status/endOfTurn.d.ts +0 -6
- package/dist/engine/status/hardCc.d.ts +0 -3
- package/dist/engine/status/index.d.ts +0 -4
- package/dist/engine/turn/index.d.ts +0 -1
- package/dist/engine/turn/index.js +0 -1
- package/dist/engine/turn/resolveTurn.d.ts +0 -5
- package/dist/index.d.ts +0 -6
- package/dist/skins/CombatSkin.d.ts +0 -21
- package/dist/skins/cliches/clicheSkin.d.ts +0 -14
- package/dist/skins/cliches/fighters.d.ts +0 -2
- package/dist/skins/cliches/index.d.ts +0 -5
- package/dist/skins/cliches/items.d.ts +0 -2
- package/dist/skins/cliches/moves.d.ts +0 -2
- package/dist/skins/cliches/statuses.d.ts +0 -2
- package/dist/skins/cliches/types.d.ts +0 -13
- package/dist/skins/index.d.ts +0 -3
- package/dist/skins/pokemon/data/pokemon-moves.json +0 -609
- package/dist/skins/pokemon/fighters.d.ts +0 -2
- package/dist/skins/pokemon/index.d.ts +0 -6
- 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 -14
- package/dist/skins/pokemon/statuses.d.ts +0 -2
- package/dist/skins/pokemon/types.d.ts +0 -13
package/dist/core/events.d.ts
DELETED
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
import type { FighterId, MoveId, ItemId, StatusId } from "./ids.js";
|
|
2
|
-
export type BattleEventKind = "turn_start" | "action_declared" | "action_skipped_hard_cc" | "move_miss" | "move_hit" | "item_used" | "status_cleared" | "damage" | "heal" | "fighter_switched" | "shield_applied" | "status_applied" | "status_refreshed" | "status_expired" | "status_tick" | "fighter_fainted" | "turn_end" | "stats_changed" | "random_event_triggered" | "random_event_effect" | "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 GenericBattleEvent extends BaseBattleEvent {
|
|
11
|
-
kind: Exclude<BattleEventKind, "stats_changed" | "action_declared" | "action_skipped_hard_cc" | "move_miss" | "move_hit" | "item_used" | "damage" | "heal" | "status_applied" | "fighter_switched" | "status_expired" | "status_tick" | "action_skipped_hard_cc" | "fighter_fainted" | "battle_end" | "random_event_effect" | "status_cleared">;
|
|
12
|
-
}
|
|
13
|
-
export interface StatsChangedEvent extends BaseBattleEvent {
|
|
14
|
-
kind: "stats_changed";
|
|
15
|
-
targetId: FighterId;
|
|
16
|
-
changes: {
|
|
17
|
-
offense?: number;
|
|
18
|
-
defense?: number;
|
|
19
|
-
speed?: number;
|
|
20
|
-
crit?: number;
|
|
21
|
-
accuracy?: number;
|
|
22
|
-
evasion?: number;
|
|
23
|
-
};
|
|
24
|
-
source?: "move" | "status" | "item" | "random_event";
|
|
25
|
-
}
|
|
26
|
-
export interface ActionDeclaredEvent extends BaseBattleEvent {
|
|
27
|
-
kind: "action_declared";
|
|
28
|
-
actorId: FighterId;
|
|
29
|
-
/**
|
|
30
|
-
* Optional custom list of narration lines.
|
|
31
|
-
* If present, the frontend should play these lines instead of the default message.
|
|
32
|
-
*/
|
|
33
|
-
narration?: string[];
|
|
34
|
-
moveId?: MoveId;
|
|
35
|
-
itemId?: ItemId;
|
|
36
|
-
targetId?: FighterId;
|
|
37
|
-
}
|
|
38
|
-
export interface ActionSkippedHardCcEvent extends BaseBattleEvent {
|
|
39
|
-
kind: "action_skipped_hard_cc";
|
|
40
|
-
actorId: FighterId;
|
|
41
|
-
statusId: StatusId;
|
|
42
|
-
}
|
|
43
|
-
export interface MoveMissEvent extends BaseBattleEvent {
|
|
44
|
-
kind: "move_miss";
|
|
45
|
-
actorId: FighterId;
|
|
46
|
-
moveId: MoveId;
|
|
47
|
-
targetId: FighterId;
|
|
48
|
-
}
|
|
49
|
-
export interface MoveHitEvent extends BaseBattleEvent {
|
|
50
|
-
kind: "move_hit";
|
|
51
|
-
actorId: FighterId;
|
|
52
|
-
moveId: MoveId;
|
|
53
|
-
targetId: FighterId;
|
|
54
|
-
isCritical: boolean;
|
|
55
|
-
effectiveness: number;
|
|
56
|
-
}
|
|
57
|
-
export interface ItemUsedEvent extends BaseBattleEvent {
|
|
58
|
-
kind: "item_used";
|
|
59
|
-
actorId: FighterId;
|
|
60
|
-
itemId: ItemId;
|
|
61
|
-
targetId: FighterId;
|
|
62
|
-
}
|
|
63
|
-
export interface DamageEvent extends BaseBattleEvent {
|
|
64
|
-
kind: "damage";
|
|
65
|
-
actorId: FighterId;
|
|
66
|
-
targetId: FighterId;
|
|
67
|
-
amount: number;
|
|
68
|
-
isCritical: boolean;
|
|
69
|
-
source?: "move" | "status" | "item" | "random_event";
|
|
70
|
-
}
|
|
71
|
-
export interface HealEvent extends BaseBattleEvent {
|
|
72
|
-
kind: "heal";
|
|
73
|
-
actorId: FighterId;
|
|
74
|
-
targetId: FighterId;
|
|
75
|
-
amount: number;
|
|
76
|
-
source?: "move" | "status" | "item" | "random_event";
|
|
77
|
-
}
|
|
78
|
-
export interface StatusAppliedEvent extends BaseBattleEvent {
|
|
79
|
-
kind: "status_applied";
|
|
80
|
-
targetId: FighterId;
|
|
81
|
-
statusId: StatusId;
|
|
82
|
-
stacks: number;
|
|
83
|
-
durationTurns: number;
|
|
84
|
-
}
|
|
85
|
-
export interface FighterSwitchedEvent extends BaseBattleEvent {
|
|
86
|
-
kind: "fighter_switched";
|
|
87
|
-
fromFighterId: FighterId;
|
|
88
|
-
toFighterId: FighterId;
|
|
89
|
-
toHp: number;
|
|
90
|
-
toStatuses: {
|
|
91
|
-
statusId: string;
|
|
92
|
-
stacks: number;
|
|
93
|
-
remainingTurns: number;
|
|
94
|
-
}[];
|
|
95
|
-
}
|
|
96
|
-
export interface StatusClearedEvent extends BaseBattleEvent {
|
|
97
|
-
kind: "status_cleared";
|
|
98
|
-
targetId: FighterId;
|
|
99
|
-
statusIds: StatusId[];
|
|
100
|
-
}
|
|
101
|
-
export interface StatusExpiredEvent extends BaseBattleEvent {
|
|
102
|
-
kind: "status_expired";
|
|
103
|
-
targetId: FighterId;
|
|
104
|
-
statusId: StatusId;
|
|
105
|
-
}
|
|
106
|
-
export interface StatusTickEvent extends BaseBattleEvent {
|
|
107
|
-
kind: "status_tick";
|
|
108
|
-
targetId: FighterId;
|
|
109
|
-
statusId: StatusId;
|
|
110
|
-
stacks: number;
|
|
111
|
-
}
|
|
112
|
-
export interface FighterFaintedEvent extends BaseBattleEvent {
|
|
113
|
-
kind: "fighter_fainted";
|
|
114
|
-
fighterId: FighterId;
|
|
115
|
-
}
|
|
116
|
-
export interface BattleEndEvent extends BaseBattleEvent {
|
|
117
|
-
kind: "battle_end";
|
|
118
|
-
winner: "player1" | "player2" | "draw";
|
|
119
|
-
}
|
|
120
|
-
export interface RandomEventTriggeredEvent extends BaseBattleEvent {
|
|
121
|
-
kind: "random_event_triggered";
|
|
122
|
-
eventId: string;
|
|
123
|
-
eventName: string;
|
|
124
|
-
eventDescription: string;
|
|
125
|
-
narration?: string[];
|
|
126
|
-
eventRarity: "common" | "rare" | "epic" | "legendary";
|
|
127
|
-
imageUrl?: string;
|
|
128
|
-
effects: Array<{
|
|
129
|
-
effectType: string;
|
|
130
|
-
target: string;
|
|
131
|
-
percentValue?: number;
|
|
132
|
-
statType?: string;
|
|
133
|
-
statChange?: number;
|
|
134
|
-
}>;
|
|
135
|
-
}
|
|
136
|
-
export interface RandomEventEffectEvent extends BaseBattleEvent {
|
|
137
|
-
kind: "random_event_effect";
|
|
138
|
-
eventId: string;
|
|
139
|
-
targetId: FighterId;
|
|
140
|
-
effectType: string;
|
|
141
|
-
}
|
|
142
|
-
export type BattleEvent = ActionDeclaredEvent | ActionSkippedHardCcEvent | MoveMissEvent | MoveHitEvent | ItemUsedEvent | DamageEvent | HealEvent | StatusAppliedEvent | StatusClearedEvent | StatusExpiredEvent | StatusTickEvent | FighterFaintedEvent | FighterSwitchedEvent | BattleEndEvent | StatsChangedEvent | RandomEventTriggeredEvent | RandomEventEffectEvent | GenericBattleEvent;
|
package/dist/core/ids.d.ts
DELETED
package/dist/core/index.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export * from "./actions.js";
|
|
2
|
-
export * from "./randomEvents.js";
|
|
3
|
-
export { CORE_RANDOM_EVENTS, POKEMON_RANDOM_EVENTS } from "./randomEventsList.js";
|
|
4
|
-
export * from "./emotes.js";
|
|
5
|
-
export * from "./events.js";
|
|
6
|
-
export * from "./events.js";
|
|
7
|
-
export * from "./fighters.js";
|
|
8
|
-
export * from "./ids.js";
|
|
9
|
-
export * from "./items.js";
|
|
10
|
-
export * from "./moves.js";
|
|
11
|
-
export * from "./status.js";
|
|
12
|
-
export * from "./randomEventsList.js";
|
|
13
|
-
export * from "./battleRuntime.js";
|
|
14
|
-
export * from "./battleState.js";
|
|
15
|
-
export * from "./amulets.js";
|
|
16
|
-
export * from "./types.js";
|
package/dist/core/items.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ItemId } from "./ids.js";
|
|
2
|
-
import type { EffectDefinition, TargetKind } from "./moves.js";
|
|
3
|
-
export type ItemCategory = "damage" | "heal_shield" | "status_buff";
|
|
4
|
-
export interface ItemDefinition {
|
|
5
|
-
id: ItemId;
|
|
6
|
-
name: string;
|
|
7
|
-
target: TargetKind;
|
|
8
|
-
maxUses: number;
|
|
9
|
-
image: string;
|
|
10
|
-
effects: EffectDefinition[];
|
|
11
|
-
narration?: string[];
|
|
12
|
-
}
|
package/dist/core/moves.d.ts
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import type { MoveId, StatusId, TypeId } from "./ids.js";
|
|
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" | "force_switch";
|
|
4
|
-
export type TargetKind = EffectTarget;
|
|
5
|
-
interface BaseEffect {
|
|
6
|
-
target?: EffectTarget;
|
|
7
|
-
chance?: number;
|
|
8
|
-
}
|
|
9
|
-
export interface DamageEffect extends BaseEffect {
|
|
10
|
-
kind: "damage";
|
|
11
|
-
/**
|
|
12
|
-
* Daño “de fórmula” (stats + tipo + crit…).
|
|
13
|
-
* Si no se define, NO se llama a computeDamage.
|
|
14
|
-
*/
|
|
15
|
-
basePower?: number;
|
|
16
|
-
/**
|
|
17
|
-
* Daño plano adicional.
|
|
18
|
-
* Se suma al daño de fórmula o se usa solo si no hay basePower.
|
|
19
|
-
*/
|
|
20
|
-
flatAmount?: number;
|
|
21
|
-
}
|
|
22
|
-
export interface HealEffect extends BaseEffect {
|
|
23
|
-
kind: "heal";
|
|
24
|
-
amount: number;
|
|
25
|
-
}
|
|
26
|
-
export interface ShieldEffect extends BaseEffect {
|
|
27
|
-
kind: "shield";
|
|
28
|
-
amount: number;
|
|
29
|
-
durationTurns: number;
|
|
30
|
-
}
|
|
31
|
-
export interface ModifyStatsEffect extends BaseEffect {
|
|
32
|
-
kind: "modify_stats";
|
|
33
|
-
offenseDelta?: number;
|
|
34
|
-
defenseDelta?: number;
|
|
35
|
-
speedDelta?: number;
|
|
36
|
-
critDelta?: number;
|
|
37
|
-
}
|
|
38
|
-
export interface ApplyStatusEffect extends BaseEffect {
|
|
39
|
-
kind: "apply_status";
|
|
40
|
-
statusId: StatusId;
|
|
41
|
-
}
|
|
42
|
-
export interface ClearStatusEffect extends BaseEffect {
|
|
43
|
-
kind: "clear_status";
|
|
44
|
-
statusIds?: StatusId[];
|
|
45
|
-
kinds?: ("hard_cc" | "soft")[];
|
|
46
|
-
clearAll?: boolean;
|
|
47
|
-
}
|
|
48
|
-
export interface ModifyHitChanceEffect extends BaseEffect {
|
|
49
|
-
kind: "modify_hit_chance";
|
|
50
|
-
delta: number;
|
|
51
|
-
}
|
|
52
|
-
export interface ModifyCritChanceEffect extends BaseEffect {
|
|
53
|
-
kind: "modify_crit_chance";
|
|
54
|
-
delta: number;
|
|
55
|
-
}
|
|
56
|
-
export interface ModifyPriorityEffect extends BaseEffect {
|
|
57
|
-
kind: "modify_priority";
|
|
58
|
-
delta: number;
|
|
59
|
-
}
|
|
60
|
-
export interface ForceSwitchEffect extends BaseEffect {
|
|
61
|
-
kind: "force_switch";
|
|
62
|
-
/**
|
|
63
|
-
* Mensaje/razón opcional para debug/narración interna.
|
|
64
|
-
* Si no lo usas, lo puedes ignorar en el engine.
|
|
65
|
-
*/
|
|
66
|
-
reason?: string;
|
|
67
|
-
}
|
|
68
|
-
export interface ModifyEffectiveSpeedEffect extends BaseEffect {
|
|
69
|
-
kind: "modify_effective_speed";
|
|
70
|
-
multiplier: number;
|
|
71
|
-
}
|
|
72
|
-
export type EffectDefinition = DamageEffect | HealEffect | ShieldEffect | ModifyStatsEffect | ApplyStatusEffect | ClearStatusEffect | ModifyHitChanceEffect | ModifyCritChanceEffect | ModifyPriorityEffect | ModifyEffectiveSpeedEffect | ForceSwitchEffect;
|
|
73
|
-
export interface MoveDefinition {
|
|
74
|
-
id: MoveId;
|
|
75
|
-
name: string;
|
|
76
|
-
typeId: TypeId;
|
|
77
|
-
accuracy?: number;
|
|
78
|
-
maxPP: number;
|
|
79
|
-
priority?: number;
|
|
80
|
-
charge?: {
|
|
81
|
-
invulnerability?: string;
|
|
82
|
-
};
|
|
83
|
-
bypassInvulnerability?: string[];
|
|
84
|
-
effects: EffectDefinition[];
|
|
85
|
-
narration?: string[];
|
|
86
|
-
}
|
|
87
|
-
export {};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export type EventRarity = "common" | "rare" | "epic" | "legendary";
|
|
2
|
-
export type EventEffectType = "damage_percent" | "heal_percent" | "stat_change" | "apply_status" | "reset_stats" | "swap_hp";
|
|
3
|
-
export type EventTarget = "both" | "self" | "opponent" | "random_one";
|
|
4
|
-
export interface EventCondition {
|
|
5
|
-
type: "has_item" | "hp_below_percent" | "hp_above_percent" | "fighter_type" | "has_status" | "stat_stage_above" | "always";
|
|
6
|
-
value?: string | number;
|
|
7
|
-
}
|
|
8
|
-
export interface RandomEventEffect {
|
|
9
|
-
effectType: EventEffectType;
|
|
10
|
-
target: EventTarget;
|
|
11
|
-
condition?: EventCondition;
|
|
12
|
-
percentValue?: number;
|
|
13
|
-
statType?: "offense" | "defense" | "speed" | "crit" | "accuracy" | "evasion";
|
|
14
|
-
statChange?: number;
|
|
15
|
-
statusId?: string;
|
|
16
|
-
statusDuration?: number;
|
|
17
|
-
randomChoices?: RandomEventEffect[];
|
|
18
|
-
}
|
|
19
|
-
export interface RandomEventDefinition {
|
|
20
|
-
id: string;
|
|
21
|
-
name: string;
|
|
22
|
-
description: string;
|
|
23
|
-
narration: string[];
|
|
24
|
-
rarity: EventRarity;
|
|
25
|
-
imageUrl?: string;
|
|
26
|
-
effects: RandomEventEffect[];
|
|
27
|
-
}
|
|
28
|
-
export declare const RARITY_WEIGHTS: Record<EventRarity, number>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { RandomEventDefinition } from "./randomEvents.js";
|
|
2
|
-
/**
|
|
3
|
-
* CORE Random Events - Generic events that work with any skin
|
|
4
|
-
* Phase 1 + Phase 2: 9 total CORE events
|
|
5
|
-
*/
|
|
6
|
-
export declare const CORE_RANDOM_EVENTS: RandomEventDefinition[];
|
|
7
|
-
/**
|
|
8
|
-
* POKEMON-SPECIFIC Random Events
|
|
9
|
-
* These only appear when using the Pokemon skin
|
|
10
|
-
*/
|
|
11
|
-
export declare const POKEMON_RANDOM_EVENTS: RandomEventDefinition[];
|
package/dist/core/status.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { StatusId } from "./ids.js";
|
|
2
|
-
import type { EffectDefinition } from "./moves.js";
|
|
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/types.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { TypeId } from "./ids.js";
|
|
2
|
-
export type Effectiveness = 0 | 0.9 | 1 | 1.1;
|
|
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
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { BattleEvent, PlayerAction } from "../../core/index.js";
|
|
2
|
-
import { RuntimeBattleState } from "../rules.js";
|
|
3
|
-
export declare const resolveItemUse: (state: RuntimeBattleState, playerKey: "player1" | "player2", action: PlayerAction) => {
|
|
4
|
-
state: RuntimeBattleState;
|
|
5
|
-
events: BattleEvent[];
|
|
6
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { BattleEvent, PlayerAction } from "../../core/index.js";
|
|
2
|
-
import { RuntimeBattleState } from "../rules.js";
|
|
3
|
-
export declare const processNarration: (lines: string[], actorId: string, targetId: string) => string[];
|
|
4
|
-
export declare const resolveDamageMove: (state: RuntimeBattleState, playerKey: "player1" | "player2", action: PlayerAction) => {
|
|
5
|
-
state: RuntimeBattleState;
|
|
6
|
-
events: BattleEvent[];
|
|
7
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { PlayerAction } from "../../core/index.js";
|
|
2
|
-
import { RuntimeBattleState } from "../rules.js";
|
|
3
|
-
export declare const getMovePriorityAndSpeed: (state: RuntimeBattleState, playerKey: "player1" | "player2", action: PlayerAction) => {
|
|
4
|
-
priority: number;
|
|
5
|
-
speed: number;
|
|
6
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { BattleEvent, PlayerAction } from "../../core/index.js";
|
|
2
|
-
import { RuntimeBattleState } from "../rules.js";
|
|
3
|
-
export declare const resolveSwitchFighter: (state: RuntimeBattleState, playerKey: "player1" | "player2", action: PlayerAction) => {
|
|
4
|
-
state: RuntimeBattleState;
|
|
5
|
-
events: BattleEvent[];
|
|
6
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { BattleEvent, BattleFighter, FighterId, TypeId } from "../../core/index.js";
|
|
2
|
-
import { RuntimeBattleState } from "../rules.js";
|
|
3
|
-
interface DamageComputationInput {
|
|
4
|
-
state: RuntimeBattleState;
|
|
5
|
-
attacker: BattleFighter;
|
|
6
|
-
defender: BattleFighter;
|
|
7
|
-
moveTypeId: TypeId;
|
|
8
|
-
basePower: number;
|
|
9
|
-
isCritical: boolean;
|
|
10
|
-
}
|
|
11
|
-
export declare const computeDamage: (input: DamageComputationInput) => {
|
|
12
|
-
damage: number;
|
|
13
|
-
effectiveness: number;
|
|
14
|
-
};
|
|
15
|
-
interface DamageApplyResult {
|
|
16
|
-
updatedDefender: BattleFighter;
|
|
17
|
-
events: BattleEvent[];
|
|
18
|
-
}
|
|
19
|
-
export declare const applyDamageToFighter: (state: RuntimeBattleState, defender: BattleFighter, amount: number, actorId: FighterId, isCritical: boolean) => DamageApplyResult;
|
|
20
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { BattleEvent, BattleFighter, FighterId } from "../../core/index.js";
|
|
2
|
-
import { RuntimeBattleState } from "../rules.js";
|
|
3
|
-
export declare const applyHealToFighter: (state: RuntimeBattleState, target: BattleFighter, amount: number, sourceId: FighterId) => {
|
|
4
|
-
updated: BattleFighter;
|
|
5
|
-
events: BattleEvent[];
|
|
6
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare const STAGE_MULTIPLIERS_STATS: Record<number, number>;
|
|
2
|
-
export declare const STAGE_MULTIPLIERS_ACCURACY: Record<number, number>;
|
|
3
|
-
export declare const getCritChanceFromStage: (stage: number) => number;
|
|
4
|
-
export declare const getStatMultiplier: (stage: number) => number;
|
|
5
|
-
export declare const getAccuracyMultiplier: (stage: number) => number;
|
package/dist/engine/debug.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const dbg: (...args: unknown[]) => void;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { BattleEvent, BattleFighter, EffectDefinition, TypeId } from "../../core/index.js";
|
|
2
|
-
import { RuntimeBattleState } from "../rules.js";
|
|
3
|
-
export declare const applyEffectsOnTarget: (state: RuntimeBattleState, actor: BattleFighter, target: BattleFighter, moveTypeId: TypeId | null, isCritical: boolean, effects: EffectDefinition[]) => {
|
|
4
|
-
actor: BattleFighter;
|
|
5
|
-
target: BattleFighter;
|
|
6
|
-
events: BattleEvent[];
|
|
7
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { BattleFighter, EffectDefinition, EffectKind, EffectTarget } from "../../core/index.js";
|
|
2
|
-
export declare const defaultTargetForKind: (kind: EffectKind) => EffectTarget;
|
|
3
|
-
export declare const resolveEffectTarget: (eff: EffectDefinition, actor: BattleFighter, target: BattleFighter) => {
|
|
4
|
-
primary: BattleFighter;
|
|
5
|
-
isSelf: boolean;
|
|
6
|
-
};
|
package/dist/engine/engine.d.ts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
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 {};
|