@wayward/types 2.14.0-beta.dev.20241012.1 → 2.14.0-beta.dev.20241017.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.
@@ -14,7 +14,7 @@ import { ActionArgument } from "@wayward/game/game/entity/action/IAction";
14
14
  import type Creature from "@wayward/game/game/entity/creature/Creature";
15
15
  import type Human from "@wayward/game/game/entity/Human";
16
16
  import type NPC from "@wayward/game/game/entity/npc/NPC";
17
- import type { IItemDescription, IItemOnUse } from "@wayward/game/game/item/IItem";
17
+ import { type IItemDescription, type IItemOnUse } from "@wayward/game/game/item/IItem";
18
18
  export interface IHealOtherCanUse extends IActionUsable {
19
19
  itemDescription: IItemDescription;
20
20
  target: Creature | Human | NPC;
@@ -17,7 +17,7 @@ import type { RuneChance } from "@wayward/game/game/deity/IDeities";
17
17
  import type { DoodadType, DoodadTypeGroup } from "@wayward/game/game/doodad/IDoodad";
18
18
  import type Human from "@wayward/game/game/entity/Human";
19
19
  import type { DamageType, Defense, EntityType, ICastable, MoveType } from "@wayward/game/game/entity/IEntity";
20
- import type { Delay, EquipType, SkillType } from "@wayward/game/game/entity/IHuman";
20
+ import { SkillType, type Delay, type EquipType } from "@wayward/game/game/entity/IHuman";
21
21
  import { Stat } from "@wayward/game/game/entity/IStats";
22
22
  import type { IActionApi } from "@wayward/game/game/entity/action/IAction";
23
23
  import { ActionType } from "@wayward/game/game/entity/action/IAction";
@@ -382,11 +382,11 @@ export interface IConsumeItemStat {
382
382
  stat: Stat;
383
383
  amount: number;
384
384
  }
385
- export type ConsumeItemStatsTuple = [health: number, stamina: number, hunger: number, thirst: number, otherStats?: IConsumeItemStat[]];
385
+ export type ConsumeItemStatsTuple = [health: number, stamina: number, hunger: number, thirst: number, skillUse: SkillType, otherStats?: IConsumeItemStat[]];
386
386
  export type ConsumeItemStats = ConsumeItemStatsTuple | IConsumeItemStat[];
387
387
  export declare namespace ConsumeItemStats {
388
388
  const DEFAULT_STATS: Stat[];
389
- function resolve(stats?: number | ConsumeItemStats): Map<Stat, number>;
389
+ function resolve(stats?: ConsumeItemStats): Map<Stat, number>;
390
390
  }
391
391
  export interface IItemOnUse {
392
392
  [ActionType.Apply]?: ConsumeItemStats;
@@ -396,7 +396,7 @@ export interface IItemOnUse {
396
396
  [ActionType.DrinkItem]?: ConsumeItemStats;
397
397
  [ActionType.Eat]?: ConsumeItemStats;
398
398
  [ActionType.Heal]?: ConsumeItemStats;
399
- [ActionType.HealOther]?: number;
399
+ [ActionType.HealOther]?: ConsumeItemStats;
400
400
  [ActionType.Invoke]?: IInvokeUse;
401
401
  [ActionType.PlaceDown]?: IItemBuild;
402
402
  [ActionType.Plant]?: DoodadType;
@@ -384,6 +384,11 @@ export default class Item extends EntityMovable<IItemDescription, ItemType, Refe
384
384
  * Gets the skill type associated with the item, or choose a random one if the description is an array.
385
385
  */
386
386
  getSkillUse(): SkillType;
387
+ /**
388
+ *
389
+ * @param action Gets the consume skill for the given action (Eat, Heal, HealOther, DrinkItem, or Cure) on the item
390
+ */
391
+ getConsumeSkillUse(action: ActionType): SkillType;
387
392
  getDamageType(): DamageType;
388
393
  /**
389
394
  * Returns the damage types associated with a skill with a fallback for whatever damage types the item normally provides
@@ -16,7 +16,7 @@ import { Direction } from "@wayward/game/utilities/math/Direction";
16
16
  import { ApplicationDom } from "@wayward/test/core/applicationDom";
17
17
  import { ApplicationLogger } from "@wayward/test/core/applicationLogger";
18
18
  import type { IDedicatedServerGameOptions, INewGameOptions, ITestJoinServerOptions, IWaitUntilGameLoadedOptions } from "@wayward/test/interfaces";
19
- import type { TestRunContext } from "@wayward/test/testRunner";
19
+ import { type TestRunContext } from "@wayward/test/testRunner";
20
20
  import type { Random } from "@wayward/utilities/random/Random";
21
21
  export default class ApplicationInteractions {
22
22
  protected readonly testContext: TestRunContext;
@@ -15,5 +15,7 @@ export default class Task {
15
15
  private lastYieldEnd;
16
16
  constructor(interval?: number);
17
17
  reset(): void;
18
- yield(quick?: boolean): Promise<void>;
18
+ get shouldYield(): boolean;
19
+ yield(quick?: boolean): Promise<void> | undefined;
20
+ forceYield(quick?: boolean): Promise<void>;
19
21
  }
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.14.0-beta.dev.20241012.1",
4
+ "version": "2.14.0-beta.dev.20241017.1",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",