@wayward/types 2.13.5-beta.dev.20230726.1 → 2.13.5-beta.dev.20230727.1

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.
@@ -16,7 +16,7 @@ import { CreatureType } from "game/entity/creature/ICreature";
16
16
  import EntityWithStats from "game/entity/EntityWithStats";
17
17
  import type { IAttack, ICausesDamage, IEntityConstructorOptions } from "game/entity/IEntity";
18
18
  import { AttackType, DamageType, IStatChangeInfo, StatusEffectChangeReason, StatusType } from "game/entity/IEntity";
19
- import type { ICheckUnderOptions, ICrafted, ICustomizations, IHumanEvents, ILoadOnIslandOptions, IRestData, IVoyageInfo } from "game/entity/IHuman";
19
+ import type { ICheckUnderOptions, ICrafted, ICustomizations, IHumanEvents, ILoadOnIslandOptions, IRestData, IVoyageInfo, WalkPathChangeReason } from "game/entity/IHuman";
20
20
  import { EquipType, RestCancelReason, SkillType } from "game/entity/IHuman";
21
21
  import type { IStat } from "game/entity/IStats";
22
22
  import { Stat } from "game/entity/IStats";
@@ -254,7 +254,7 @@ export default abstract class Human<TypeType extends number = number> extends En
254
254
  getMovementIntent(): IMovementIntent;
255
255
  updateMovementIntent(movementIntent: IMovementIntent): boolean;
256
256
  hasWalkPath(): boolean;
257
- setWalkPath(path: IVector2[] | undefined, force?: boolean): void;
257
+ setWalkPath(path: IVector2[] | undefined, force?: boolean, reason?: WalkPathChangeReason): void;
258
258
  protected onDie(): void;
259
259
  checkUnder(inFacingDirection?: boolean, options?: ICheckUnderOptions): ICheckUnderOptions;
260
260
  trampleFire(fireEvent: TileEvent): void;
@@ -159,6 +159,11 @@ export interface IHumanEvents extends Events<EntityWithStats>, ISkillEvents {
159
159
  * @returns The movement intent of the player or undefined to use the default logic
160
160
  */
161
161
  getMovementIntent(): IMovementIntent | undefined;
162
+ /**
163
+ * Called when the walk path of the player is about to change.
164
+ * @returns False to prevent the walk path change or undefined to use the default logic
165
+ */
166
+ canChangeWalkPath(walkPath: IVector2[] | undefined, reason: WalkPathChangeReason): false | undefined;
162
167
  /**
163
168
  * Called when the walk path of the player changes.
164
169
  */
@@ -376,6 +381,7 @@ export declare enum RestCancelReason {
376
381
  WaterPoured = 7
377
382
  }
378
383
  export declare const restCancelReasonMessageMap: Record<RestCancelReason, Message | undefined>;
384
+ export type WalkPathChangeReason = "Damage" | "Overburdened" | "Unknown";
379
385
  export interface IRestData {
380
386
  type: RestType;
381
387
  startHealth: number;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wayward/types",
3
3
  "description": "TypeScript declarations for Wayward, used for modding.",
4
- "version": "2.13.5-beta.dev.20230726.1",
4
+ "version": "2.13.5-beta.dev.20230727.1",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",