@rpgjs/server 5.0.0-beta.5 → 5.0.0-beta.6

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/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as RpgCommonPlayer, A as isArray, At as createErrorClass, B as ProjectileMovement, C as SDEF, Ct as isSignal, D as arrayFlat, Dt as finalize$1, E as PrebuiltGui, Et as untracked, F as ModulesToken, G as Knockback, H as PathFollow, I as RpgModule, J as Entity, K as IceMovement, L as WorldMapsManager, M as isInstanceOf, N as isString, O as arrayUniq, Ot as combineLatest, P as random, Q as Direction, R as RpgCommonMap, S as PDEF, St as isObjectSubject, T as PerlinNoise2D, Tt as signal, U as Oscillate, V as ProjectileType, W as LinearRepulsion, X as Vector2, Y as EntityState, Z as RpgShape, _ as ATK, _t as ObjectSubject, a as isMapUpdateAuthorized, at as createStatesSnapshot, b as MAXHP, bt as isArraySubject, ct as getByPath, d as context, dt as persist, et as Skill, f as inject, ft as sync, g as AGI, gt as ArraySubject, h as injector, ht as users, j as isFunction, k as capitalize, kt as BehaviorSubject, l as context$1, lt as id, m as inject$1, mt as type, n as MAP_UPDATE_TOKEN_ENV, nt as __decorate, ot as createStatesSnapshotDeep, p as setInject, pt as syncClass, q as Dash, r as MAP_UPDATE_TOKEN_HEADER, rt as __decorateMetadata, st as generateShortUUID$1, t as provideServerModules, tt as Item, u as clearInject, ut as load, v as DEX, vt as computed, w as STR, wt as linkedSignal, x as MAXSP, xt as isComputed, y as INT, yt as effect, z as SeekAvoid } from "./module-BmvXIvlE.js";
1
+ import { $ as Skill, A as isArray, B as ProjectileMovement, C as SDEF, Ct as linkedSignal, D as arrayFlat, Dt as combineLatest, E as PrebuiltGui, Et as finalize$1, F as ModulesToken, G as Knockback, H as PathFollow, I as RpgModule, J as Entity, K as IceMovement, L as WorldMapsManager, M as isInstanceOf, N as isString, O as arrayUniq, Ot as BehaviorSubject, P as random, Q as RpgCommonPlayer, R as RpgCommonMap, S as PDEF, St as isSignal, T as PerlinNoise2D, Tt as untracked, U as Oscillate, V as ProjectileType, W as LinearRepulsion, X as RpgShape, Y as Vector2, Z as Direction, _ as ATK, _t as computed, a as isMapUpdateAuthorized, at as createStatesSnapshotDeep, b as MAXHP, bt as isComputed, ct as id, d as context, dt as sync, et as Item, f as inject, ft as syncClass, g as AGI, gt as ObjectSubject, h as injector, ht as ArraySubject, it as createStatesSnapshot, j as isFunction, k as capitalize, kt as createErrorClass, l as context$1, lt as load, m as inject$1, mt as users, n as MAP_UPDATE_TOKEN_ENV, nt as __decorateMetadata, ot as generateShortUUID$1, p as setInject, pt as type, q as Dash, r as MAP_UPDATE_TOKEN_HEADER, st as getByPath, t as provideServerModules, tt as __decorate, u as clearInject, ut as persist, v as DEX, vt as effect, w as STR, wt as signal, x as MAXSP, xt as isObjectSubject, y as INT, yt as isArraySubject, z as SeekAvoid } from "./module-Dy124Jyk.js";
2
2
  //#region ../../node_modules/.pnpm/dset@3.1.4/node_modules/dset/dist/index.mjs
3
3
  function dset(obj, keys, val) {
4
4
  keys.split && (keys = keys.split("."));
@@ -10521,7 +10521,7 @@ var RpgPlayer = class extends BasicPlayerMixins(RpgCommonPlayer) {
10521
10521
  const height = hitbox?.h ?? 32;
10522
10522
  const centerX = positions.x + width / 2;
10523
10523
  const centerY = positions.y + height / 2;
10524
- this.map.physic.teleport(entity, {
10524
+ this.map.physic.teleportEntity(entity, {
10525
10525
  x: centerX,
10526
10526
  y: centerY
10527
10527
  });
@@ -15743,7 +15743,11 @@ var RpgMap = class RpgMap extends RpgCommonMap {
15743
15743
  * ```
15744
15744
  */
15745
15745
  onAction(player, action) {
15746
- const events = this.getCollisions(player.id).map((id) => this.getEvent(id)).filter((event) => !!event && this.isEventVisibleForPlayer(event, player));
15746
+ const direction = typeof player.getDirection === "function" ? player.getDirection() : typeof player.direction === "function" ? player.direction() : void 0;
15747
+ const collisions = new Set(this.getCollisions(player.id));
15748
+ const interactionCollisions = this.getInteractionCollisions?.(player.id, direction);
15749
+ if (Array.isArray(interactionCollisions)) interactionCollisions.forEach((id) => collisions.add(id));
15750
+ const events = Array.from(collisions).map((id) => this.getEvent(id)).filter((event) => !!event && this.isEventVisibleForPlayer(event, player));
15747
15751
  if (events.length > 0) events.forEach((event) => {
15748
15752
  event.execMethod("onAction", [player, action]);
15749
15753
  });
@@ -16895,18 +16899,13 @@ var RpgMap = class RpgMap extends RpgCommonMap {
16895
16899
  const centerX = x + width / 2;
16896
16900
  const centerY = y + height / 2;
16897
16901
  const entityId = `shape-${name}`;
16898
- this.physic.createEntity({
16899
- uuid: entityId,
16900
- position: {
16901
- x: centerX,
16902
- y: centerY
16903
- },
16902
+ this.physic.createStaticObstacle(entityId, {
16903
+ x: centerX,
16904
+ y: centerY,
16904
16905
  width,
16905
16906
  height,
16906
- mass: Infinity,
16907
- state: EntityState.Static,
16908
16907
  restitution: 0
16909
- }).freeze();
16908
+ });
16910
16909
  const properties = { ...obj.properties || {} };
16911
16910
  if (obj.z !== void 0) properties.z = obj.z;
16912
16911
  if (obj.color !== void 0) properties.color = obj.color;