@rpgjs/action-battle 5.0.0-beta.5 → 5.0.0-beta.7
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/README.md +161 -22
- package/dist/ai.server.d.ts +55 -4
- package/dist/client/index.js +13 -8
- package/dist/client/index10.js +54 -136
- package/dist/client/index11.js +52 -23
- package/dist/client/index12.js +101 -1217
- package/dist/client/index13.js +139 -42
- package/dist/client/index14.js +23 -8
- package/dist/client/index15.js +68 -444
- package/dist/client/index16.js +1343 -0
- package/dist/client/index17.js +13 -0
- package/dist/client/index18.js +60 -0
- package/dist/client/index19.js +10 -0
- package/dist/client/index2.js +25 -87
- package/dist/client/index20.js +504 -0
- package/dist/client/index3.js +45 -83
- package/dist/client/index4.js +98 -297
- package/dist/client/index5.js +81 -33
- package/dist/client/index6.js +284 -78
- package/dist/client/index7.js +33 -74
- package/dist/client/index8.js +95 -55
- package/dist/client/index9.js +75 -96
- package/dist/core/attack-profile.d.ts +9 -0
- package/dist/core/attack-runtime.d.ts +20 -0
- package/dist/core/enemy-attack-profiles.d.ts +6 -0
- package/dist/core/equipment.d.ts +2 -0
- package/dist/core/hit-reaction.d.ts +5 -0
- package/dist/index.d.ts +7 -2
- package/dist/server/index.js +12 -7
- package/dist/server/index10.js +1340 -8
- package/dist/server/index11.js +37 -0
- package/dist/server/index12.js +60 -0
- package/dist/server/index13.js +13 -0
- package/dist/server/index14.js +503 -0
- package/dist/server/index15.js +10 -0
- package/dist/server/index2.js +1 -1
- package/dist/server/index3.js +25 -87
- package/dist/server/index4.js +45 -141
- package/dist/server/index5.js +104 -21
- package/dist/server/index6.js +137 -1215
- package/dist/server/index7.js +22 -34
- package/dist/server/index8.js +70 -44
- package/dist/server/index9.js +44 -437
- package/dist/server.d.ts +8 -2
- package/dist/ui/state.d.ts +5 -5
- package/package.json +5 -5
- package/src/ai.server.spec.ts +120 -0
- package/src/ai.server.ts +362 -56
- package/src/client.ts +21 -12
- package/src/config.ts +17 -2
- package/src/core/attack-profile.spec.ts +118 -0
- package/src/core/attack-profile.ts +100 -0
- package/src/core/attack-runtime.spec.ts +103 -0
- package/src/core/attack-runtime.ts +83 -0
- package/src/core/contracts.ts +3 -0
- package/src/core/enemy-attack-profiles.spec.ts +35 -0
- package/src/core/enemy-attack-profiles.ts +103 -0
- package/src/core/equipment.spec.ts +37 -0
- package/src/core/equipment.ts +17 -0
- package/src/core/hit-reaction.spec.ts +43 -0
- package/src/core/hit-reaction.ts +70 -0
- package/src/core/hit.spec.ts +54 -1
- package/src/core/hit.ts +26 -0
- package/src/index.ts +48 -1
- package/src/server.ts +192 -34
- package/src/types.ts +62 -6
package/src/types.ts
CHANGED
|
@@ -89,6 +89,61 @@ export interface ActionBattleUiOptions {
|
|
|
89
89
|
targeting?: ActionBattleUiTargetingOptions;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
+
export type ActionBattleAttackDirection =
|
|
93
|
+
| "up"
|
|
94
|
+
| "down"
|
|
95
|
+
| "left"
|
|
96
|
+
| "right"
|
|
97
|
+
| "default";
|
|
98
|
+
|
|
99
|
+
export interface ActionBattleAttackHitboxConfig {
|
|
100
|
+
offsetX: number;
|
|
101
|
+
offsetY: number;
|
|
102
|
+
width: number;
|
|
103
|
+
height: number;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export type ActionBattleAttackHitboxMap = Partial<
|
|
107
|
+
Record<ActionBattleAttackDirection, ActionBattleAttackHitboxConfig>
|
|
108
|
+
>;
|
|
109
|
+
|
|
110
|
+
export type ActionBattleAttackHitPolicy =
|
|
111
|
+
| "oncePerTarget"
|
|
112
|
+
| "allowRepeatHits";
|
|
113
|
+
|
|
114
|
+
export interface ActionBattleHitReactionProfile {
|
|
115
|
+
invincibilityMs?: number;
|
|
116
|
+
hitstunMs?: number;
|
|
117
|
+
staggerPower?: number;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export interface NormalizedActionBattleHitReactionProfile {
|
|
121
|
+
invincibilityMs: number;
|
|
122
|
+
hitstunMs: number;
|
|
123
|
+
staggerPower: number;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export interface ActionBattleAttackProfile {
|
|
127
|
+
id?: string;
|
|
128
|
+
startupMs?: number;
|
|
129
|
+
activeMs?: number;
|
|
130
|
+
recoveryMs?: number;
|
|
131
|
+
cooldownMs?: number;
|
|
132
|
+
movementLock?: boolean;
|
|
133
|
+
directionLock?: boolean;
|
|
134
|
+
animationKey?: ActionBattleAnimationKey;
|
|
135
|
+
hitPolicy?: ActionBattleAttackHitPolicy;
|
|
136
|
+
reaction?: ActionBattleHitReactionProfile;
|
|
137
|
+
hitboxes?: ActionBattleAttackHitboxMap;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export interface NormalizedActionBattleAttackProfile
|
|
141
|
+
extends Required<Omit<ActionBattleAttackProfile, "hitboxes" | "reaction">> {
|
|
142
|
+
reaction: NormalizedActionBattleHitReactionProfile;
|
|
143
|
+
hitboxes?: ActionBattleAttackHitboxMap;
|
|
144
|
+
totalDurationMs: number;
|
|
145
|
+
}
|
|
146
|
+
|
|
92
147
|
export interface ActionBattleSkillOptions {
|
|
93
148
|
getTargeting?: ActionBattleSkillTargetingResolver;
|
|
94
149
|
defaultAoeMask?: ActionBattleAoeMask;
|
|
@@ -99,19 +154,19 @@ export interface ActionBattleTargetingOptions {
|
|
|
99
154
|
allowEmptyTarget?: boolean;
|
|
100
155
|
}
|
|
101
156
|
|
|
157
|
+
export interface ActionBattleDebugOptions {
|
|
158
|
+
attacks?: boolean;
|
|
159
|
+
}
|
|
160
|
+
|
|
102
161
|
export interface ActionBattleAttackOptions {
|
|
162
|
+
profile?: ActionBattleAttackProfile;
|
|
103
163
|
lockMovement?: boolean;
|
|
104
164
|
lockDurationMs?: number;
|
|
105
165
|
showPreview?: boolean;
|
|
106
166
|
previewDurationMs?: number;
|
|
107
167
|
previewColor?: number;
|
|
108
168
|
previewAccentColor?: number;
|
|
109
|
-
hitboxes?:
|
|
110
|
-
Record<
|
|
111
|
-
"up" | "down" | "left" | "right" | "default",
|
|
112
|
-
{ offsetX: number; offsetY: number; width: number; height: number }
|
|
113
|
-
>
|
|
114
|
-
>;
|
|
169
|
+
hitboxes?: ActionBattleAttackHitboxMap;
|
|
115
170
|
resolveHitboxes?: (context: {
|
|
116
171
|
player: any;
|
|
117
172
|
direction: string;
|
|
@@ -139,6 +194,7 @@ export interface ActionBattleOptions {
|
|
|
139
194
|
skills?: ActionBattleSkillOptions;
|
|
140
195
|
targeting?: ActionBattleTargetingOptions;
|
|
141
196
|
attack?: ActionBattleAttackOptions;
|
|
197
|
+
debug?: ActionBattleDebugOptions;
|
|
142
198
|
animations?: ActionBattleAnimationOptions;
|
|
143
199
|
systems?: ActionBattleSystemOptions;
|
|
144
200
|
}
|