@rpgjs/action-battle 5.0.0-beta.8 → 5.0.0-beta.9

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.
Files changed (40) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/client/index11.js +1 -0
  3. package/dist/client/index12.js +5 -5
  4. package/dist/client/index6.js +9 -5
  5. package/dist/client/index8.js +2 -1
  6. package/dist/client/index9.js +2 -1
  7. package/dist/server/ai.server.d.ts +569 -0
  8. package/dist/server/animations.d.ts +16 -0
  9. package/dist/server/config.d.ts +5 -0
  10. package/dist/server/core/attack-profile.d.ts +9 -0
  11. package/dist/server/core/attack-runtime.d.ts +20 -0
  12. package/dist/server/core/context.d.ts +5 -0
  13. package/dist/server/core/defaults.d.ts +81 -0
  14. package/dist/server/core/enemy-attack-profiles.d.ts +6 -0
  15. package/dist/server/core/equipment.d.ts +2 -0
  16. package/dist/server/core/hit-reaction.d.ts +5 -0
  17. package/dist/server/core/hit.d.ts +2 -0
  18. package/dist/server/enemies/factory.d.ts +7 -0
  19. package/dist/server/index.d.ts +21 -0
  20. package/dist/server/index9.js +1 -0
  21. package/dist/server/server.d.ts +106 -0
  22. package/dist/server/targeting.d.ts +19 -0
  23. package/package.json +10 -10
  24. /package/dist/{ai.server.d.ts → client/ai.server.d.ts} +0 -0
  25. /package/dist/{animations.d.ts → client/animations.d.ts} +0 -0
  26. /package/dist/{client.d.ts → client/client.d.ts} +0 -0
  27. /package/dist/{config.d.ts → client/config.d.ts} +0 -0
  28. /package/dist/{core → client/core}/attack-profile.d.ts +0 -0
  29. /package/dist/{core → client/core}/attack-runtime.d.ts +0 -0
  30. /package/dist/{core → client/core}/context.d.ts +0 -0
  31. /package/dist/{core → client/core}/defaults.d.ts +0 -0
  32. /package/dist/{core → client/core}/enemy-attack-profiles.d.ts +0 -0
  33. /package/dist/{core → client/core}/equipment.d.ts +0 -0
  34. /package/dist/{core → client/core}/hit-reaction.d.ts +0 -0
  35. /package/dist/{core → client/core}/hit.d.ts +0 -0
  36. /package/dist/{enemies → client/enemies}/factory.d.ts +0 -0
  37. /package/dist/{index.d.ts → client/index.d.ts} +0 -0
  38. /package/dist/{server.d.ts → client/server.d.ts} +0 -0
  39. /package/dist/{targeting.d.ts → client/targeting.d.ts} +0 -0
  40. /package/dist/{ui → client/ui}/state.d.ts +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @rpgjs/action-battle
2
2
 
3
+ ## 5.0.0-beta.9
4
+
5
+ ### Major Changes
6
+
7
+ - c456d25: beta.9
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [c456d25]
12
+ - @rpgjs/client@5.0.0-beta.9
13
+ - @rpgjs/common@5.0.0-beta.9
14
+ - @rpgjs/server@5.0.0-beta.9
15
+ - @rpgjs/vite@5.0.0-beta.9
16
+
3
17
  ## 5.0.0-beta.8
4
18
 
5
19
  ### Major Changes
@@ -31,6 +31,7 @@ var getTargetKey = (target) => {
31
31
  return String(target.id);
32
32
  };
33
33
  var ActionBattleHitTracker = class {
34
+ hitPolicy;
34
35
  hitTargets = /* @__PURE__ */ new Set();
35
36
  constructor(hitPolicy) {
36
37
  this.hitPolicy = hitPolicy;
@@ -1,8 +1,8 @@
1
1
  import { normalizeActionBattleOptions } from "./index4.js";
2
2
  import { setActionBattleOptions, startAttackPreview, stopAttackPreview } from "./index5.js";
3
- import component from "./index6.js";
4
- import component$1 from "./index8.js";
5
- import component$2 from "./index9.js";
3
+ import __ce_component from "./index6.js";
4
+ import __ce_component$1 from "./index8.js";
5
+ import __ce_component$2 from "./index9.js";
6
6
  import { resolveActionBattleAnimation } from "./index10.js";
7
7
  import { getNormalizedActionBattleAttackProfile } from "./index11.js";
8
8
  import { PrebuiltComponentAnimations, RpgClientEngine, RpgGui, inject } from "@rpgjs/client";
@@ -68,7 +68,7 @@ var createActionBattleClient = (options = {}) => {
68
68
  const normalized = normalizeActionBattleOptions(options);
69
69
  setActionBattleOptions(normalized);
70
70
  const actionBarEnabled = normalized.ui?.actionBar?.enabled;
71
- const componentsInFront = [...normalized.ui?.targeting?.enabled ? [component$1] : [], component$2];
71
+ const componentsInFront = [...normalized.ui?.targeting?.enabled ? [__ce_component$1] : [], __ce_component$2];
72
72
  const hitComponent = PrebuiltComponentAnimations?.Hit;
73
73
  return defineModule({
74
74
  componentAnimations: hitComponent ? [{
@@ -77,7 +77,7 @@ var createActionBattleClient = (options = {}) => {
77
77
  }] : [],
78
78
  gui: actionBarEnabled ? [{
79
79
  id: "action-battle-action-bar",
80
- component,
80
+ component: __ce_component,
81
81
  dependencies: () => {
82
82
  return [inject(RpgClientEngine).scene.currentPlayer];
83
83
  }
@@ -2,11 +2,14 @@ import { actionBattleTargetingState, actionBattleUiOptions, moveTargetingOffset,
2
2
  import { RpgClientEngine, inject } from "@rpgjs/client";
3
3
  import { DOMContainer, DOMElement, DOMSprite, computed, cond, effect, h, loop, signal, useDefineProps, useProps } from "canvasengine";
4
4
  //#region src/components/action-bar.ce
5
- if (typeof document !== "undefined" && !document.getElementById("ce-style--home-runner-work-RPG-JS-RPG-JS-packages-action-battle-src-components-action-bar-ce")) {
6
- const styleElement = document.createElement("style");
7
- styleElement.id = "ce-style--home-runner-work-RPG-JS-RPG-JS-packages-action-battle-src-components-action-bar-ce";
5
+ if (typeof document !== "undefined") {
6
+ let styleElement = document.getElementById("ce-style--home-runner-work-RPG-JS-RPG-JS-packages-action-battle-src-components-action-bar-ce");
7
+ if (!styleElement) {
8
+ styleElement = document.createElement("style");
9
+ styleElement.id = "ce-style--home-runner-work-RPG-JS-RPG-JS-packages-action-battle-src-components-action-bar-ce";
10
+ document.head.appendChild(styleElement);
11
+ }
8
12
  styleElement.textContent = ".action-battle-actionbar-root {\n pointer-events: none;\n }\n\n .action-battle-actionbar {\n position: absolute;\n left: 12px;\n right: 12px;\n bottom: 12px;\n pointer-events: auto;\n display: flex;\n justify-content: center;\n }\n\n .action-battle-actionbar-plate {\n width: min(760px, 100%);\n --rpg-ui-hotbar-size: clamp(38px, 8vw, 52px);\n }\n\n .action-battle-actionbar-track {\n --rpg-ui-hotbar-slots: 10;\n }";
9
- document.head.appendChild(styleElement);
10
13
  }
11
14
  function component($$props) {
12
15
  useProps($$props);
@@ -303,5 +306,6 @@ function component($$props) {
303
306
  }))
304
307
  ]))))));
305
308
  }
309
+ var __ce_component = component;
306
310
  //#endregion
307
- export { component as default };
311
+ export { __ce_component as default };
@@ -97,5 +97,6 @@ function component($$props) {
97
97
  };
98
98
  return h(Container, null, cond(shouldRender, () => h(Graphics, { draw: drawGrid })));
99
99
  }
100
+ var __ce_component = component;
100
101
  //#endregion
101
- export { component as default };
102
+ export { __ce_component as default };
@@ -74,5 +74,6 @@ function component($$props) {
74
74
  };
75
75
  return h(Container, null, cond(shouldRender, () => h(Graphics, { draw: drawSlash })));
76
76
  }
77
+ var __ce_component = component;
77
78
  //#endregion
78
- export { component as default };
79
+ export { __ce_component as default };
@@ -0,0 +1,569 @@
1
+ import { RpgEvent, RpgPlayer } from '@rpgjs/server';
2
+ import { ActionBattleEnemyAttackProfileMap } from './core/enemy-attack-profiles';
3
+ import { ActionBattleDamageResult } from './core/contracts';
4
+ import { NormalizedActionBattleHitReactionProfile, ActionBattleAnimationOptions } from './types';
5
+ type RpgEventWithBattleAi = RpgEvent & {
6
+ battleAi?: BattleAi;
7
+ };
8
+ export interface BattleAiRewardItem {
9
+ item?: any;
10
+ itemId?: string;
11
+ amount?: number;
12
+ chance?: number;
13
+ }
14
+ export interface BattleAiRewards {
15
+ exp?: number;
16
+ gold?: number;
17
+ items?: Array<BattleAiRewardItem | string>;
18
+ showNotification?: boolean;
19
+ }
20
+ export interface BattleAiDefeatReward {
21
+ readonly awarded: boolean;
22
+ giveTo(player?: RpgPlayer | null): void;
23
+ }
24
+ export interface BattleAiDefeatedContext {
25
+ event: RpgEvent;
26
+ attacker?: RpgPlayer;
27
+ reward: BattleAiDefeatReward;
28
+ remove: () => void;
29
+ }
30
+ export type BattleAiDefeatedCallback = (context: BattleAiDefeatedContext) => void;
31
+ export type BattleAiLegacyDefeatedCallback = (event: RpgEvent, attacker?: RpgPlayer) => void;
32
+ export interface BattleAiBaseOptions {
33
+ enemyType?: EnemyType;
34
+ attackCooldown?: number;
35
+ visionRange?: number;
36
+ attackRange?: number;
37
+ dodgeChance?: number;
38
+ dodgeCooldown?: number;
39
+ fleeThreshold?: number;
40
+ attackSkill?: any;
41
+ attackPatterns?: AttackPattern[];
42
+ attackProfiles?: ActionBattleEnemyAttackProfileMap;
43
+ patrolWaypoints?: Array<{
44
+ x: number;
45
+ y: number;
46
+ }>;
47
+ groupBehavior?: boolean;
48
+ moveToCooldown?: number;
49
+ retreatCooldown?: number;
50
+ poise?: number;
51
+ hitstunMs?: number;
52
+ invincibilityMs?: number;
53
+ behavior?: {
54
+ baseScore?: number;
55
+ updateInterval?: number;
56
+ minStateDuration?: number;
57
+ assaultThreshold?: number;
58
+ retreatThreshold?: number;
59
+ };
60
+ behaviorKey?: string;
61
+ animations?: ActionBattleAnimationOptions;
62
+ rewards?: BattleAiRewards;
63
+ autoAwardRewards?: boolean;
64
+ }
65
+ export interface BattleAiOptions extends BattleAiBaseOptions {
66
+ /** Callback called when the AI is defeated */
67
+ onDefeated?: BattleAiDefeatedCallback;
68
+ }
69
+ export interface BattleAiLegacyOptions extends BattleAiBaseOptions {
70
+ /** @deprecated Use the context callback signature instead. */
71
+ onDefeated?: BattleAiLegacyDefeatedCallback;
72
+ }
73
+ /**
74
+ * Hit result data returned after applying damage
75
+ *
76
+ * Contains information about the hit including damage dealt,
77
+ * knockback parameters, and whether the target was defeated.
78
+ * Used by hooks to customize hit behavior.
79
+ *
80
+ * @example
81
+ * ```ts
82
+ * const hitResult: HitResult = {
83
+ * damage: 25,
84
+ * knockbackForce: 50,
85
+ * knockbackDuration: 300,
86
+ * defeated: false,
87
+ * attacker: this.event,
88
+ * target: player
89
+ * };
90
+ * ```
91
+ */
92
+ export interface HitResult {
93
+ /** Damage dealt to the target */
94
+ damage: number;
95
+ /** Knockback force applied (from weapon or default) */
96
+ knockbackForce: number;
97
+ /** Knockback duration in milliseconds */
98
+ knockbackDuration: number;
99
+ /** Whether the target was defeated */
100
+ defeated: boolean;
101
+ /** The entity that attacked */
102
+ attacker: RpgEvent | RpgPlayer;
103
+ /** The entity that was hit */
104
+ target: RpgPlayer | RpgEvent;
105
+ }
106
+ /**
107
+ * Hook options for customizing hit behavior
108
+ *
109
+ * Allows overriding knockback parameters and adding custom effects
110
+ * when a hit is applied.
111
+ *
112
+ * @example
113
+ * ```ts
114
+ * const hooks: ApplyHitHooks = {
115
+ * onBeforeHit(result) {
116
+ * // Reduce knockback for armored enemies
117
+ * if (result.target.hasState('armored')) {
118
+ * result.knockbackForce *= 0.5;
119
+ * }
120
+ * return result;
121
+ * },
122
+ * onAfterHit(result) {
123
+ * // Add poison effect on hit
124
+ * if (Math.random() < 0.3) {
125
+ * result.target.addState('poison');
126
+ * }
127
+ * }
128
+ * };
129
+ * ```
130
+ */
131
+ export interface ApplyHitHooks {
132
+ /**
133
+ * Called before the hit is applied
134
+ * Can modify the hit result before damage and knockback
135
+ *
136
+ * @param result - The hit result data
137
+ * @returns Modified hit result or void to use original
138
+ */
139
+ onBeforeHit?: (result: HitResult) => HitResult | void;
140
+ /**
141
+ * Called after the hit is applied
142
+ * Used for side effects like adding states, playing sounds, etc.
143
+ *
144
+ * @param result - The final hit result data
145
+ */
146
+ onAfterHit?: (result: HitResult) => void;
147
+ }
148
+ /**
149
+ * AI Debug Logger
150
+ *
151
+ * Conditional logging utility for AI behavior debugging.
152
+ * Enable by setting `AiDebug.enabled = true` or via environment variable `RPGJS_DEBUG_AI=1`
153
+ *
154
+ * @example
155
+ * ```ts
156
+ * // Enable debug logging
157
+ * AiDebug.enabled = true;
158
+ *
159
+ * // Or filter by event ID
160
+ * AiDebug.filterEventId = 'goblin-1';
161
+ * ```
162
+ */
163
+ export declare const AiDebug: {
164
+ /** Enable/disable all AI debug logs */
165
+ enabled: boolean;
166
+ /** Filter logs to a specific event ID (null = all events) */
167
+ filterEventId: string | null;
168
+ /** Log categories to enable (empty = all) */
169
+ categories: string[];
170
+ /**
171
+ * Log an AI debug message
172
+ *
173
+ * @param category - Log category (e.g., 'state', 'attack', 'movement', 'damage')
174
+ * @param eventId - Event ID for filtering
175
+ * @param message - Log message
176
+ * @param data - Optional additional data
177
+ */
178
+ log(category: string, eventId: string | undefined, message: string, data?: any): void;
179
+ };
180
+ /**
181
+ * AI State enumeration
182
+ *
183
+ * Defines the different states an AI can be in, each with its own behavior.
184
+ */
185
+ export declare enum AiState {
186
+ Idle = "idle",
187
+ Alert = "alert",
188
+ Combat = "combat",
189
+ Flee = "flee",
190
+ Stunned = "stunned"
191
+ }
192
+ /**
193
+ * Enemy Type enumeration
194
+ *
195
+ * Defines different enemy archetypes with unique behaviors.
196
+ * Stats (HP, ATK, etc.) should be set on the event itself via onInit.
197
+ */
198
+ export declare enum EnemyType {
199
+ Aggressive = "aggressive",
200
+ Defensive = "defensive",
201
+ Ranged = "ranged",
202
+ Tank = "tank",
203
+ Berserker = "berserker"
204
+ }
205
+ /**
206
+ * Attack Pattern enumeration
207
+ *
208
+ * Different attack patterns the AI can use.
209
+ */
210
+ export declare enum AttackPattern {
211
+ Melee = "melee",
212
+ Combo = "combo",
213
+ Charged = "charged",
214
+ Zone = "zone",
215
+ DashAttack = "dashAttack"
216
+ }
217
+ /**
218
+ * Default knockback configuration
219
+ *
220
+ * Used when no weapon is equipped or weapon doesn't specify knockback.
221
+ */
222
+ export declare const DEFAULT_KNOCKBACK: {
223
+ /** Default knockback force */
224
+ force: number;
225
+ /** Default knockback duration in milliseconds */
226
+ duration: number;
227
+ };
228
+ /**
229
+ * Advanced Battle AI Controller for events
230
+ *
231
+ * This class provides intelligent combat behavior control for events.
232
+ * It uses the existing RPGJS API for stats, skills, items, etc.
233
+ * The AI only manages behavior - the event's stats should be configured
234
+ * in onInit using standard RPGJS methods.
235
+ *
236
+ * ## Usage with RPGJS API
237
+ *
238
+ * Configure the event stats using standard RPGJS methods:
239
+ * - `this.hp = 100` - Set health
240
+ * - `this.learnSkill(FireBall)` - Learn a skill
241
+ * - `this.addItem(Potion, 3)` - Add items
242
+ * - `this.equip(Sword)` - Equip items
243
+ * - `this.setClass(WarriorClass)` - Set class
244
+ * - `this.param[ATK] = 20` - Set parameters
245
+ *
246
+ * @example
247
+ * ```ts
248
+ * function GoblinEnemy() {
249
+ * return {
250
+ * name: "Goblin",
251
+ * onInit() {
252
+ * this.setGraphic("goblin");
253
+ *
254
+ * // Configure stats using RPGJS API
255
+ * this.hp = 80;
256
+ * this.param[ATK] = 15;
257
+ * this.param[PDEF] = 5;
258
+ * this.learnSkill(Slash);
259
+ *
260
+ * // Apply AI behavior
261
+ * new BattleAi(this, {
262
+ * enemyType: EnemyType.Aggressive,
263
+ * attackSkill: Slash
264
+ * });
265
+ * }
266
+ * };
267
+ * }
268
+ * ```
269
+ */
270
+ export declare class BattleAi {
271
+ private event;
272
+ private target;
273
+ private lastAttackTime;
274
+ private updateInterval?;
275
+ /**
276
+ * Log AI debug message for this event
277
+ */
278
+ private debugLog;
279
+ private state;
280
+ private stateStartTime;
281
+ private stunnedUntil;
282
+ private enemyType;
283
+ private attackCooldown;
284
+ private visionRange;
285
+ private attackRange;
286
+ private dodgeChance;
287
+ private dodgeCooldown;
288
+ private lastDodgeTime;
289
+ private fleeThreshold;
290
+ private attackSkill;
291
+ private attackPatterns;
292
+ private attackProfiles;
293
+ private animations?;
294
+ private comboCount;
295
+ private comboMax;
296
+ private chargingAttack;
297
+ private groupBehavior;
298
+ private nearbyEnemies;
299
+ private groupUpdateInterval;
300
+ private patrolWaypoints;
301
+ private currentPatrolIndex;
302
+ private lastHpCheck;
303
+ private recentDamageTaken;
304
+ private damageCheckInterval;
305
+ private isMovingToTarget;
306
+ private onDefeatedCallback?;
307
+ private rewards?;
308
+ private autoAwardRewards;
309
+ private defeated;
310
+ private lastFacingDirection;
311
+ private behaviorScore;
312
+ private behaviorMode;
313
+ private behaviorLastUpdate;
314
+ private behaviorUpdateInterval;
315
+ private behaviorAssaultThreshold;
316
+ private behaviorRetreatThreshold;
317
+ private behaviorMinStateDuration;
318
+ private behaviorEnabled;
319
+ private moveToCooldown;
320
+ private lastMoveToTime;
321
+ private retreatCooldown;
322
+ private lastRetreatTime;
323
+ private timers;
324
+ private behaviorKey?;
325
+ private poise;
326
+ private hitstunMs;
327
+ private invincibilityMs;
328
+ /**
329
+ * Create a new Battle AI Controller
330
+ *
331
+ * The AI controls behavior only. Stats should be set on the event
332
+ * using standard RPGJS methods (hp, param, learnSkill, etc.)
333
+ *
334
+ * @param event - The event to control
335
+ * @param options - AI behavior configuration
336
+ *
337
+ * @example
338
+ * ```ts
339
+ * // In your event's onInit
340
+ * this.hp = 100;
341
+ * this.param[ATK] = 20;
342
+ * this.learnSkill(FireBall);
343
+ *
344
+ * new BattleAi(this, {
345
+ * enemyType: EnemyType.Ranged,
346
+ * attackSkill: FireBall,
347
+ * visionRange: 200,
348
+ * fleeThreshold: 0.2
349
+ * });
350
+ * ```
351
+ */
352
+ constructor(event: RpgEventWithBattleAi, options?: BattleAiOptions);
353
+ constructor(event: RpgEventWithBattleAi, options?: BattleAiLegacyOptions);
354
+ /**
355
+ * Apply enemy type-specific behavior modifiers
356
+ *
357
+ * This only affects AI behavior (cooldowns, ranges, dodge).
358
+ * Stats should be set on the event itself.
359
+ */
360
+ private applyEnemyTypeBehavior;
361
+ /**
362
+ * Setup vision detection
363
+ */
364
+ private setupVision;
365
+ /**
366
+ * Start the AI behavior loop
367
+ */
368
+ private startAiBehaviorLoop;
369
+ /**
370
+ * Change AI state with validated transitions
371
+ */
372
+ private changeState;
373
+ /**
374
+ * Main AI behavior update loop
375
+ */
376
+ private updateAiBehavior;
377
+ /**
378
+ * Update idle behavior (patrolling)
379
+ */
380
+ private updateIdleBehavior;
381
+ /**
382
+ * Update alert behavior
383
+ */
384
+ private updateAlertBehavior;
385
+ /**
386
+ * Update combat behavior
387
+ */
388
+ private updateCombatBehavior;
389
+ /**
390
+ * Update flee behavior
391
+ */
392
+ private updateFleeBehavior;
393
+ /**
394
+ * Select and perform an attack pattern
395
+ */
396
+ private selectAndPerformAttack;
397
+ /**
398
+ * Select attack pattern with weighted probability
399
+ */
400
+ private selectAttackPattern;
401
+ /**
402
+ * Perform attack pattern
403
+ */
404
+ private performAttackPattern;
405
+ /**
406
+ * Perform melee attack
407
+ * Uses skill if configured, otherwise creates hitbox
408
+ */
409
+ private performMeleeAttack;
410
+ private executeMeleeAttack;
411
+ /**
412
+ * Perform basic hitbox attack when no skill is set
413
+ */
414
+ private performBasicHitbox;
415
+ /**
416
+ * Apply hit to target using RPGJS damage system with knockback
417
+ *
418
+ * Calculates damage using RPGJS formula, applies knockback based on
419
+ * equipped weapon's knockbackForce property, and triggers visual effects.
420
+ * Supports hooks for customizing behavior.
421
+ *
422
+ * @param target - The player or entity being hit
423
+ * @param hooks - Optional hooks for customizing hit behavior
424
+ * @returns The hit result containing damage and knockback info
425
+ *
426
+ * @example
427
+ * ```ts
428
+ * // Basic hit
429
+ * this.applyHit(player);
430
+ *
431
+ * // With custom hooks
432
+ * this.applyHit(player, {
433
+ * onBeforeHit(result) {
434
+ * result.knockbackForce *= 1.5; // Increase knockback
435
+ * return result;
436
+ * },
437
+ * onAfterHit(result) {
438
+ * console.log(`Dealt ${result.damage} damage!`);
439
+ * }
440
+ * });
441
+ * ```
442
+ */
443
+ private applyHit;
444
+ /**
445
+ * Get knockback force from equipped weapon
446
+ *
447
+ * Retrieves the knockbackForce property from the event's equipped weapon.
448
+ * Falls back to DEFAULT_KNOCKBACK.force if no weapon or property is set.
449
+ *
450
+ * @returns Knockback force value
451
+ *
452
+ * @example
453
+ * ```ts
454
+ * // Weapon with knockbackForce: 80
455
+ * const force = this.getWeaponKnockbackForce(); // 80
456
+ *
457
+ * // No weapon equipped
458
+ * const force = this.getWeaponKnockbackForce(); // 50 (default)
459
+ * ```
460
+ */
461
+ private getWeaponKnockbackForce;
462
+ /**
463
+ * Perform combo attack
464
+ */
465
+ private performComboAttack;
466
+ /**
467
+ * Perform charged attack
468
+ */
469
+ private performChargedAttack;
470
+ /**
471
+ * Perform zone attack (360 degrees)
472
+ */
473
+ private performZoneAttack;
474
+ /**
475
+ * Perform dash attack
476
+ */
477
+ private performDashAttack;
478
+ private getAttackProfile;
479
+ private telegraphAttack;
480
+ private scheduleAttackStartup;
481
+ /**
482
+ * Face the current target with hysteresis to prevent animation flickering
483
+ *
484
+ * Uses multiple strategies to prevent flickering:
485
+ * 1. When very close to target (collision), keep current direction
486
+ * 2. When near diagonal, require significant difference to change
487
+ * 3. Only change if direction is clearly wrong (opposite)
488
+ */
489
+ private faceTarget;
490
+ /**
491
+ * Try to dodge
492
+ */
493
+ private tryDodge;
494
+ private canDodge;
495
+ private shouldDodge;
496
+ /**
497
+ * Flee from target
498
+ */
499
+ private fleeFromTarget;
500
+ /**
501
+ * Retreat from target (temporary)
502
+ */
503
+ private retreatFromTarget;
504
+ /**
505
+ * Check damage taken for retreat decision
506
+ */
507
+ private checkDamageTaken;
508
+ /**
509
+ * Start patrol
510
+ */
511
+ private startPatrol;
512
+ /**
513
+ * Update group behavior
514
+ */
515
+ private updateGroupBehavior;
516
+ /**
517
+ * Find nearby enemies
518
+ */
519
+ private findNearbyEnemies;
520
+ /**
521
+ * Apply formation around target
522
+ */
523
+ private applyFormation;
524
+ /**
525
+ * Handle player entering vision
526
+ */
527
+ onDetectInShape(player: InstanceType<typeof RpgPlayer>, shape: any): void;
528
+ /**
529
+ * Handle player leaving vision
530
+ */
531
+ onDetectOutShape(player: InstanceType<typeof RpgPlayer>, shape: any): void;
532
+ /**
533
+ * Handle taking damage (called from server.ts)
534
+ *
535
+ * This triggers state changes like stun and flee check.
536
+ * The actual damage is applied externally via RPGJS API.
537
+ */
538
+ takeDamage(attacker: RpgPlayer): boolean;
539
+ handleDamage(attacker: RpgPlayer, damageResult: ActionBattleDamageResult & {
540
+ reaction?: NormalizedActionBattleHitReactionProfile;
541
+ }): boolean;
542
+ /**
543
+ * Kill this AI
544
+ *
545
+ * Stops all movements, cleans up resources, calls the onDefeated hook,
546
+ * and removes the event from the map.
547
+ */
548
+ private kill;
549
+ /**
550
+ * Get distance between entities
551
+ */
552
+ private getDistance;
553
+ private updateBehavior;
554
+ private applyCustomBehavior;
555
+ private handleTacticalMovement;
556
+ private handleAssaultMovement;
557
+ private requestMoveTo;
558
+ private schedule;
559
+ getHealth(): number;
560
+ getMaxHealth(): number;
561
+ getTarget(): InstanceType<typeof RpgPlayer> | null;
562
+ getState(): AiState;
563
+ getEnemyType(): EnemyType;
564
+ /**
565
+ * Clean up
566
+ */
567
+ destroy(): void;
568
+ }
569
+ export {};
@@ -0,0 +1,16 @@
1
+ import { ActionBattleAnimationContext, ActionBattleAnimationEntity, ActionBattleAnimationKey, ActionBattleAnimationOptions } from './types';
2
+ export declare const DEFAULT_DIE_ANIMATION_DELAY_MS = 500;
3
+ export interface ResolvedActionBattleAnimation {
4
+ animationName: string;
5
+ graphic?: string | string[];
6
+ repeat: number;
7
+ waitEnd: boolean;
8
+ delayMs?: number;
9
+ }
10
+ export interface ActionBattleAnimationDefaults {
11
+ animationName?: string;
12
+ repeat?: number;
13
+ }
14
+ export declare function resolveActionBattleAnimation(key: ActionBattleAnimationKey, entity: ActionBattleAnimationEntity, animations?: ActionBattleAnimationOptions, context?: ActionBattleAnimationContext, defaults?: ActionBattleAnimationDefaults): ResolvedActionBattleAnimation | null;
15
+ export declare function playActionBattleAnimation(key: ActionBattleAnimationKey, entity: ActionBattleAnimationEntity, animations?: ActionBattleAnimationOptions, context?: ActionBattleAnimationContext, defaults?: ActionBattleAnimationDefaults): ResolvedActionBattleAnimation | null;
16
+ export declare function getActionBattleAnimationRemovalDelay(animation: ResolvedActionBattleAnimation | null): number;
@@ -0,0 +1,5 @@
1
+ import { ActionBattleOptions } from './types';
2
+ export declare const DEFAULT_ACTION_BATTLE_OPTIONS: ActionBattleOptions;
3
+ export declare function normalizeActionBattleOptions(options?: ActionBattleOptions): ActionBattleOptions;
4
+ export declare function setActionBattleOptions(options: ActionBattleOptions): void;
5
+ export declare function getActionBattleOptions(): ActionBattleOptions;
@@ -0,0 +1,9 @@
1
+ import { ActionBattleAttackHitboxMap, ActionBattleAttackProfile, NormalizedActionBattleAttackProfile } from '../types';
2
+ export declare const DEFAULT_ACTION_BATTLE_ATTACK_PROFILE: NormalizedActionBattleAttackProfile;
3
+ export interface ActionBattleAttackProfileFallbacks {
4
+ id?: string;
5
+ lockMovement?: boolean;
6
+ lockDurationMs?: number;
7
+ hitboxes?: ActionBattleAttackHitboxMap;
8
+ }
9
+ export declare function normalizeActionBattleAttackProfile(profile?: ActionBattleAttackProfile | undefined, fallbacks?: ActionBattleAttackProfileFallbacks): NormalizedActionBattleAttackProfile;
@@ -0,0 +1,20 @@
1
+ import { ActionBattleAttackHitPolicy, ActionBattleOptions, NormalizedActionBattleAttackProfile } from '../types';
2
+ export declare const ACTION_BATTLE_HITBOX_FRAME_MS = 16;
3
+ export declare function getNormalizedActionBattleAttackProfile(options?: ActionBattleOptions): NormalizedActionBattleAttackProfile;
4
+ export declare function resolveActionBattleHitboxSpeed(profile: NormalizedActionBattleAttackProfile, hitboxCount: number): number;
5
+ export declare function scheduleActionBattleStartup(profile: NormalizedActionBattleAttackProfile, callback: () => void, scheduler?: (callback: () => void, delayMs: number) => unknown): unknown;
6
+ export declare function createActionBattleAttackId(attackerId: string | number | undefined, profileId: string): string;
7
+ export declare class ActionBattleHitTracker {
8
+ private readonly hitPolicy;
9
+ private hitTargets;
10
+ constructor(hitPolicy: ActionBattleAttackHitPolicy);
11
+ canHit(target: {
12
+ id?: string | number;
13
+ } | undefined): boolean;
14
+ recordHit(target: {
15
+ id?: string | number;
16
+ } | undefined): void;
17
+ tryHit(target: {
18
+ id?: string | number;
19
+ } | undefined): boolean;
20
+ }
@@ -0,0 +1,5 @@
1
+ import { ActionBattleOptions } from '../types';
2
+ import { ActionBattleSystems } from './contracts';
3
+ export declare const setActionBattleSystems: (options?: ActionBattleOptions) => void;
4
+ export declare const getActionBattleSystems: () => ActionBattleSystems;
5
+ export declare const createActionBattleSystems: (options?: ActionBattleOptions) => ActionBattleSystems;
@@ -0,0 +1,81 @@
1
+ import { RpgPlayer } from '@rpgjs/server';
2
+ import { ActionBattleAiBehavior, ActionBattleAttackContext, ActionBattleCombatSystem, ActionBattleDamageContext, ActionBattleKnockbackContext, ActionBattleKnockbackResult, ActionBattleSystems } from './contracts';
3
+ export declare const DEFAULT_ZELDA_PLAYER_HITBOXES: {
4
+ up: {
5
+ offsetX: number;
6
+ offsetY: number;
7
+ width: number;
8
+ height: number;
9
+ };
10
+ down: {
11
+ offsetX: number;
12
+ offsetY: number;
13
+ width: number;
14
+ height: number;
15
+ };
16
+ left: {
17
+ offsetX: number;
18
+ offsetY: number;
19
+ width: number;
20
+ height: number;
21
+ };
22
+ right: {
23
+ offsetX: number;
24
+ offsetY: number;
25
+ width: number;
26
+ height: number;
27
+ };
28
+ default: {
29
+ offsetX: number;
30
+ offsetY: number;
31
+ width: number;
32
+ height: number;
33
+ };
34
+ };
35
+ export declare const createDefaultPlayerHitboxResolver: (hitboxes?: {
36
+ up: {
37
+ offsetX: number;
38
+ offsetY: number;
39
+ width: number;
40
+ height: number;
41
+ };
42
+ down: {
43
+ offsetX: number;
44
+ offsetY: number;
45
+ width: number;
46
+ height: number;
47
+ };
48
+ left: {
49
+ offsetX: number;
50
+ offsetY: number;
51
+ width: number;
52
+ height: number;
53
+ };
54
+ right: {
55
+ offsetX: number;
56
+ offsetY: number;
57
+ width: number;
58
+ height: number;
59
+ };
60
+ default: {
61
+ offsetX: number;
62
+ offsetY: number;
63
+ width: number;
64
+ height: number;
65
+ };
66
+ }) => (context: ActionBattleAttackContext) => {
67
+ x: any;
68
+ y: any;
69
+ width: number;
70
+ height: number;
71
+ }[];
72
+ export declare const defaultRpgjsDamageResolver: (context: ActionBattleDamageContext) => {
73
+ damage: any;
74
+ defeated: boolean;
75
+ raw: any;
76
+ };
77
+ export declare const defaultKnockbackResolver: (context: ActionBattleKnockbackContext) => ActionBattleKnockbackResult;
78
+ export declare const defaultCombatSystem: ActionBattleCombatSystem;
79
+ export declare const defaultEnemyBehaviors: Record<string, ActionBattleAiBehavior>;
80
+ export declare const defaultActionBattleSystems: ActionBattleSystems;
81
+ export declare const getEntityWeaponKnockbackForce: (entity: RpgPlayer) => number;
@@ -0,0 +1,6 @@
1
+ import { ActionBattleAttackProfile, NormalizedActionBattleAttackProfile } from '../types';
2
+ export type ActionBattleEnemyAttackProfileKey = "melee" | "combo" | "charged" | "zone" | "dashAttack";
3
+ export declare const DEFAULT_ACTION_BATTLE_ENEMY_ATTACK_PROFILES: Record<ActionBattleEnemyAttackProfileKey, ActionBattleAttackProfile>;
4
+ export type ActionBattleEnemyAttackProfileMap = Partial<Record<ActionBattleEnemyAttackProfileKey, ActionBattleAttackProfile>>;
5
+ export type NormalizedActionBattleEnemyAttackProfileMap = Record<ActionBattleEnemyAttackProfileKey, NormalizedActionBattleAttackProfile>;
6
+ export declare function normalizeActionBattleEnemyAttackProfiles(overrides?: ActionBattleEnemyAttackProfileMap): NormalizedActionBattleEnemyAttackProfileMap;
@@ -0,0 +1,2 @@
1
+ import { ActionBattleAttackProfile } from '../types';
2
+ export declare function resolveActionBattleWeaponAttackProfile(entity: any): ActionBattleAttackProfile | null;
@@ -0,0 +1,5 @@
1
+ import { ActionBattleHitReactionProfile, NormalizedActionBattleHitReactionProfile } from '../types';
2
+ export declare const DEFAULT_ACTION_BATTLE_HIT_REACTION: NormalizedActionBattleHitReactionProfile;
3
+ export declare function normalizeActionBattleHitReaction(reaction: ActionBattleHitReactionProfile | undefined, defaults?: NormalizedActionBattleHitReactionProfile): NormalizedActionBattleHitReactionProfile;
4
+ export declare function isActionBattleEntityInvincible(entity: any, now?: number): boolean;
5
+ export declare function setActionBattleInvincibility(entity: any, durationMs: number, now?: number): void;
@@ -0,0 +1,2 @@
1
+ import { ActionBattleCombatSystem, ActionBattleHitContext, ActionBattleHitResult } from './contracts';
2
+ export declare const applyActionBattleHit: (system: ActionBattleCombatSystem, context: ActionBattleHitContext) => ActionBattleHitResult;
@@ -0,0 +1,7 @@
1
+ import { RpgEvent } from '@rpgjs/server';
2
+ import { BattleAi, BattleAiOptions } from '../ai.server';
3
+ export interface ActionBattleEnemyPreset extends BattleAiOptions {
4
+ stats?: (event: RpgEvent) => void;
5
+ }
6
+ export type ActionBattleEnemyPresetMap = Record<string, ActionBattleEnemyPreset>;
7
+ export declare const createActionEnemy: (event: RpgEvent, presetOrOptions: string | BattleAiOptions, presets?: ActionBattleEnemyPresetMap) => BattleAi;
@@ -0,0 +1,21 @@
1
+ import { ActionBattleOptions } from './types';
2
+ export { BattleAi, AiState, EnemyType, AttackPattern, AiDebug, DEFAULT_KNOCKBACK } from './ai.server';
3
+ export type { HitResult, ApplyHitHooks, BattleAiOptions, BattleAiDefeatedCallback, BattleAiDefeatedContext, BattleAiDefeatReward, BattleAiLegacyDefeatedCallback, BattleAiLegacyOptions, BattleAiRewardItem, BattleAiRewards, } from './ai.server';
4
+ export type { ActionBattleAnimationContext, ActionBattleAnimationEntity, ActionBattleAnimationKey, ActionBattleAnimationOptions, ActionBattleAnimationResolver, ActionBattleAnimationResult, ActionBattleOptions, ActionBattleActionBarData, ActionBattleActionBarItem, ActionBattleActionBarSkill, ActionBattleSkillTargeting, ActionBattleSkillTargetingResolver, ActionBattleAttackOptions, ActionBattleUiOptions, ActionBattleUiActionBarOptions, ActionBattleUiTargetingOptions, ActionBattleAttackDirection, ActionBattleAttackHitboxConfig, ActionBattleAttackHitboxMap, ActionBattleAttackHitPolicy, ActionBattleAttackProfile, ActionBattleDebugOptions, ActionBattleHitReactionProfile, NormalizedActionBattleHitReactionProfile, NormalizedActionBattleAttackProfile, ActionBattleCombatOptions, ActionBattleSystemOptions, ActionBattleAiSystemOptions, } from './types';
5
+ export type { ActionBattleAiBehavior, ActionBattleAiContext, ActionBattleAiDecision, ActionBattleAttackContext, ActionBattleCombatSystem, ActionBattleDamageContext, ActionBattleDamageResult, ActionBattleDirection, ActionBattleEntity, ActionBattleHitContext, ActionBattleHitHooks, ActionBattleHitResult, ActionBattleHitbox, ActionBattleKnockbackContext, ActionBattleKnockbackResult, ActionBattleSystems, } from './core/contracts';
6
+ export { DEFAULT_ACTION_BATTLE_ATTACK_PROFILE, normalizeActionBattleAttackProfile, type ActionBattleAttackProfileFallbacks, } from './core/attack-profile';
7
+ export { ACTION_BATTLE_HITBOX_FRAME_MS, ActionBattleHitTracker, createActionBattleAttackId, getNormalizedActionBattleAttackProfile, resolveActionBattleHitboxSpeed, scheduleActionBattleStartup, } from './core/attack-runtime';
8
+ export { DEFAULT_ACTION_BATTLE_HIT_REACTION, isActionBattleEntityInvincible, normalizeActionBattleHitReaction, setActionBattleInvincibility, } from './core/hit-reaction';
9
+ export { DEFAULT_ACTION_BATTLE_ENEMY_ATTACK_PROFILES, normalizeActionBattleEnemyAttackProfiles, type ActionBattleEnemyAttackProfileKey, type ActionBattleEnemyAttackProfileMap, type NormalizedActionBattleEnemyAttackProfileMap, } from './core/enemy-attack-profiles';
10
+ export { resolveActionBattleWeaponAttackProfile } from './core/equipment';
11
+ export { DEFAULT_ZELDA_PLAYER_HITBOXES, createDefaultPlayerHitboxResolver, defaultCombatSystem, defaultEnemyBehaviors, defaultKnockbackResolver, defaultRpgjsDamageResolver, } from './core/defaults';
12
+ export { createActionBattleSystems, getActionBattleSystems, } from './core/context';
13
+ export { applyActionBattleHit } from './core/hit';
14
+ export { createActionEnemy, type ActionBattleEnemyPreset, type ActionBattleEnemyPresetMap, } from './enemies/factory';
15
+ export { DEFAULT_PLAYER_ATTACK_HITBOXES, getPlayerWeaponKnockbackForce, applyPlayerHitToEvent, ACTION_BATTLE_ACTION_BAR_GUI_ID, openActionBattleActionBar, updateActionBattleActionBar, createActionBattleServer, } from './server';
16
+ export declare function provideActionBattle(options?: ActionBattleOptions): any[];
17
+ declare const _default: {
18
+ server: import('@rpgjs/server').RpgServer;
19
+ client: import('@rpgjs/client').RpgClient;
20
+ };
21
+ export default _default;
@@ -31,6 +31,7 @@ var getTargetKey = (target) => {
31
31
  return String(target.id);
32
32
  };
33
33
  var ActionBattleHitTracker = class {
34
+ hitPolicy;
34
35
  hitTargets = /* @__PURE__ */ new Set();
35
36
  constructor(hitPolicy) {
36
37
  this.hitPolicy = hitPolicy;
@@ -0,0 +1,106 @@
1
+ import { RpgEvent, RpgPlayer, RpgServer } from '@rpgjs/server';
2
+ import { HitResult, ApplyHitHooks } from './ai.server';
3
+ import { ActionBattleOptions } from './types';
4
+ export declare const ACTION_BATTLE_ACTION_BAR_GUI_ID = "action-battle-action-bar";
5
+ /**
6
+ * Default player attack hitboxes offsets for each direction
7
+ *
8
+ * These hitboxes define the attack areas relative to the player's position
9
+ * for each cardinal direction. They are converted to absolute coordinates
10
+ * when creating the moving hitbox.
11
+ */
12
+ export declare const DEFAULT_PLAYER_ATTACK_HITBOXES: {
13
+ up: {
14
+ offsetX: number;
15
+ offsetY: number;
16
+ width: number;
17
+ height: number;
18
+ };
19
+ down: {
20
+ offsetX: number;
21
+ offsetY: number;
22
+ width: number;
23
+ height: number;
24
+ };
25
+ left: {
26
+ offsetX: number;
27
+ offsetY: number;
28
+ width: number;
29
+ height: number;
30
+ };
31
+ right: {
32
+ offsetX: number;
33
+ offsetY: number;
34
+ width: number;
35
+ height: number;
36
+ };
37
+ default: {
38
+ offsetX: number;
39
+ offsetY: number;
40
+ width: number;
41
+ height: number;
42
+ };
43
+ };
44
+ /**
45
+ * Get knockback force from player's equipped weapon
46
+ *
47
+ * Retrieves the knockbackForce property from the player's equipped weapon.
48
+ * Falls back to DEFAULT_KNOCKBACK.force if no weapon or property is set.
49
+ *
50
+ * @param player - The player to get weapon knockback from
51
+ * @returns Knockback force value
52
+ *
53
+ * @example
54
+ * ```ts
55
+ * // Player with weapon having knockbackForce: 80
56
+ * const force = getPlayerWeaponKnockbackForce(player); // 80
57
+ *
58
+ * // No weapon equipped
59
+ * const force = getPlayerWeaponKnockbackForce(player); // 50 (default)
60
+ * ```
61
+ */
62
+ export declare function getPlayerWeaponKnockbackForce(player: RpgPlayer): number;
63
+ /**
64
+ * Apply hit from player to target (event with AI)
65
+ *
66
+ * Handles damage calculation, knockback based on weapon, and visual effects.
67
+ * Can be customized using hooks.
68
+ *
69
+ * @param player - The attacking player
70
+ * @param target - The event being hit
71
+ * @param hooks - Optional hooks for customizing hit behavior
72
+ * @returns Hit result if AI exists, undefined otherwise
73
+ *
74
+ * @example
75
+ * ```ts
76
+ * // Basic hit
77
+ * const result = applyPlayerHitToEvent(player, event);
78
+ *
79
+ * // With custom hooks
80
+ * const result = applyPlayerHitToEvent(player, event, {
81
+ * onBeforeHit(result) {
82
+ * result.knockbackForce *= 2; // Double knockback
83
+ * return result;
84
+ * },
85
+ * onAfterHit(result) {
86
+ * if (result.defeated) {
87
+ * player.gold += 10;
88
+ * }
89
+ * }
90
+ * });
91
+ * ```
92
+ */
93
+ export declare function applyPlayerHitToEvent(player: RpgPlayer, target: RpgEvent, hooks?: ApplyHitHooks, metadata?: Record<string, any>): HitResult | undefined;
94
+ export declare const openActionBattleActionBar: (player: RpgPlayer, rawOptions?: ActionBattleOptions) => void;
95
+ export declare const updateActionBattleActionBar: (player: RpgPlayer, rawOptions?: ActionBattleOptions) => void;
96
+ export declare const createActionBattleServer: (rawOptions?: ActionBattleOptions) => RpgServer;
97
+ declare const _default: RpgServer;
98
+ export default _default;
99
+ export { ACTION_BATTLE_HITBOX_FRAME_MS, ActionBattleHitTracker, createActionBattleAttackId, getNormalizedActionBattleAttackProfile, resolveActionBattleHitboxSpeed, scheduleActionBattleStartup, } from './core/attack-runtime';
100
+ export { DEFAULT_ACTION_BATTLE_ATTACK_PROFILE, normalizeActionBattleAttackProfile, type ActionBattleAttackProfileFallbacks, } from './core/attack-profile';
101
+ export type { ActionBattleAttackDirection, ActionBattleAttackHitboxConfig, ActionBattleAttackHitboxMap, ActionBattleAttackHitPolicy, ActionBattleAttackProfile, ActionBattleDebugOptions, ActionBattleHitReactionProfile, NormalizedActionBattleHitReactionProfile, NormalizedActionBattleAttackProfile, } from './types';
102
+ export { DEFAULT_ACTION_BATTLE_HIT_REACTION, isActionBattleEntityInvincible, normalizeActionBattleHitReaction, setActionBattleInvincibility, } from './core/hit-reaction';
103
+ export { DEFAULT_ACTION_BATTLE_ENEMY_ATTACK_PROFILES, normalizeActionBattleEnemyAttackProfiles, type ActionBattleEnemyAttackProfileKey, type ActionBattleEnemyAttackProfileMap, type NormalizedActionBattleEnemyAttackProfileMap, } from './core/enemy-attack-profiles';
104
+ export { resolveActionBattleWeaponAttackProfile } from './core/equipment';
105
+ export { AiDebug, AiState, AttackPattern, BattleAi, DEFAULT_KNOCKBACK, EnemyType, } from './ai.server';
106
+ export type { ApplyHitHooks, BattleAiDefeatedCallback, BattleAiDefeatedContext, BattleAiDefeatReward, BattleAiLegacyDefeatedCallback, BattleAiLegacyOptions, BattleAiOptions, BattleAiRewardItem, BattleAiRewards, HitResult, } from './ai.server';
@@ -0,0 +1,19 @@
1
+ import { ActionBattleAoeMask } from './types';
2
+ export interface ParsedAoeMask {
3
+ width: number;
4
+ height: number;
5
+ centerX: number;
6
+ centerY: number;
7
+ cells: Array<{
8
+ dx: number;
9
+ dy: number;
10
+ }>;
11
+ }
12
+ export declare const parseAoeMask: (mask: ActionBattleAoeMask | undefined) => ParsedAoeMask;
13
+ export declare const manhattanDistance: (a: {
14
+ x: number;
15
+ y: number;
16
+ }, b: {
17
+ x: number;
18
+ y: number;
19
+ }) => number;
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@rpgjs/action-battle",
3
- "version": "5.0.0-beta.8",
4
- "main": "dist/index.js",
5
- "types": "dist/index.d.ts",
3
+ "version": "5.0.0-beta.9",
4
+ "main": "dist/client/index.js",
5
+ "types": "dist/client/index.d.ts",
6
6
  "exports": {
7
7
  ".": {
8
8
  "import": "./dist/client/index.js",
9
- "types": "./dist/index.d.ts"
9
+ "types": "./dist/client/index.d.ts"
10
10
  },
11
11
  "./client": {
12
12
  "import": "./dist/client/index.js",
13
- "types": "./dist/index.d.ts"
13
+ "types": "./dist/client/index.d.ts"
14
14
  },
15
15
  "./server": {
16
16
  "import": "./dist/server/index.js",
17
- "types": "./dist/server.d.ts"
17
+ "types": "./dist/server/index.d.ts"
18
18
  }
19
19
  },
20
20
  "keywords": [],
@@ -23,10 +23,10 @@
23
23
  "description": "RPGJS is a framework for creating RPG/MMORPG games",
24
24
  "peerDependencies": {
25
25
  "@canvasengine/presets": "*",
26
- "@rpgjs/client": "5.0.0-beta.8",
27
- "@rpgjs/common": "5.0.0-beta.8",
28
- "@rpgjs/server": "5.0.0-beta.8",
29
- "@rpgjs/vite": "5.0.0-beta.8",
26
+ "@rpgjs/client": "5.0.0-beta.9",
27
+ "@rpgjs/common": "5.0.0-beta.9",
28
+ "@rpgjs/server": "5.0.0-beta.9",
29
+ "@rpgjs/vite": "5.0.0-beta.9",
30
30
  "canvasengine": "*"
31
31
  },
32
32
  "publishConfig": {
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes