@wayward/types 2.13.3-beta.dev.20230702.2 → 2.13.4-beta.dev.20230704.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.
@@ -30,6 +30,7 @@ import type { ISkillAttribute } from "game/entity/skill/ISkills";
30
30
  import SkillManager from "game/entity/skill/SkillManager";
31
31
  import type { StatChangeTimerFactory } from "game/entity/StatFactory";
32
32
  import { StatChangeCurrentTimerStrategy } from "game/entity/StatFactory";
33
+ import StatusEffect from "game/entity/status/StatusEffect";
33
34
  import { FireType } from "game/IGame";
34
35
  import type { Quality } from "game/IObject";
35
36
  import type { IMobCheck, IMoveToIslandOptions, IslandId } from "game/island/IIsland";
@@ -194,7 +195,10 @@ export default abstract class Human<TypeType extends number = number> extends En
194
195
  private getAttackSkillBonus;
195
196
  private getAttackSkill;
196
197
  damage(damageInfoOrAmount: IDamageInfo | number): number | undefined;
197
- damage(damageInfoOrAmount: IDamageInfo | number, damageMessage?: Message | Translation, soundDelay?: number, causesBlood?: boolean): number | undefined;
198
+ /**
199
+ * @deprecated provide a full IDamageInfo object yourself you lazy fiend
200
+ */
201
+ damage(damageInfoOrAmount: IDamageInfo | number, damageMessage?: Message | Translation, soundDelay?: number, causesBlood?: boolean, statusEffect?: StatusEffect): number | undefined;
198
202
  getEquippedItems(includeDisabled?: true): Item[];
199
203
  getEquippedItem(slot: EquipType, includeDisabled?: true): Item | undefined;
200
204
  isOffHandDisabled(): boolean;
@@ -251,6 +255,7 @@ export default abstract class Human<TypeType extends number = number> extends En
251
255
  updateMovementIntent(movementIntent: IMovementIntent): boolean;
252
256
  hasWalkPath(): boolean;
253
257
  setWalkPath(path: IVector2[] | undefined, force?: boolean): void;
258
+ protected onDie(): void;
254
259
  checkUnder(inFacingDirection?: boolean, options?: ICheckUnderOptions): ICheckUnderOptions;
255
260
  trampleFire(fireEvent: TileEvent): void;
256
261
  damageByInteractingWith(thing: Doodad | TileEvent, options: ICheckUnderOptions | undefined, damageLocation: EquipType): ICheckUnderOptions;
@@ -257,6 +257,10 @@ export interface IHumanEvents extends Events<EntityWithStats>, ISkillEvents {
257
257
  * @return `false` to stop the human from dying
258
258
  */
259
259
  shouldDie(): false | void;
260
+ /**
261
+ * Called when the human is killed.
262
+ */
263
+ die(): any;
260
264
  /**
261
265
  * Called when the human position is set, from a teleport type of movement
262
266
  * @param tile Tile the human is now on
@@ -18,6 +18,7 @@ import type { DamageType, Defense, ICausesStatusEffect, IStatChangeInfo, MoveTyp
18
18
  import { AiType } from "game/entity/IEntity";
19
19
  import type { IStat } from "game/entity/IStats";
20
20
  import type { IPackedMessage } from "game/entity/player/IMessageManager";
21
+ import type StatusEffect from "game/entity/status/StatusEffect";
21
22
  import type { ItemType, ItemTypeGroup } from "game/item/IItem";
22
23
  import type Item from "game/item/Item";
23
24
  import type { LootGroupType } from "game/item/LootGroups";
@@ -325,6 +326,7 @@ export interface IDamageInfo {
325
326
  damageMessage?: Message | Translation;
326
327
  soundDelay?: number;
327
328
  surpressAttackAnimation?: boolean;
329
+ statusEffect?: StatusEffect;
328
330
  }
329
331
  export interface IDamageOutcomeInput {
330
332
  human?: Human;
@@ -44,7 +44,7 @@ export interface IPlayerEvents extends Events<Human> {
44
44
  * Called when the player is killed.
45
45
  * @param showingGameEndScreen True if the game end screen will be shown
46
46
  */
47
- die(showingGameEndScreen: boolean): any;
47
+ die(showingGameEndScreen?: boolean): any;
48
48
  /**
49
49
  * Called when the player will be respawned. If any handlers return `false` to stop the player from respawning,
50
50
  * no further handlers will be called.
@@ -8,11 +8,12 @@
8
8
  * Wayward is a copyrighted and licensed work. Modification and/or distribution of any source files is prohibited. If you wish to modify the game in any way, please refer to the modding guide:
9
9
  * https://github.com/WaywardGame/types/wiki
10
10
  */
11
- import type { IEventEmitter } from "event/EventEmitter";
11
+ import { type IEventEmitter } from "event/EventEmitter";
12
12
  import { TileUpdateType } from "game/IGame";
13
13
  import Human from "game/entity/Human";
14
14
  import { EntityType } from "game/entity/IEntity";
15
15
  import { SkillType } from "game/entity/IHuman";
16
+ import type { IDamageInfo } from "game/entity/creature/ICreature";
16
17
  import { CreatureType } from "game/entity/creature/ICreature";
17
18
  import type { IMovementIntent, IPlayerEvents } from "game/entity/player/IPlayer";
18
19
  import MessageManager from "game/entity/player/MessageManager";
@@ -68,7 +69,10 @@ export default class Player extends Human implements IPreSerializeCallback, IUns
68
69
  */
69
70
  addItemMilestones(item: Item): void;
70
71
  checkSkillMilestones(): void;
72
+ private getUsableAction;
73
+ protected onGetMovementIntent(): IMovementIntent | undefined;
71
74
  protected onCanMove(direction: Direction.Cardinal): false | undefined;
75
+ protected onDamage(damageInfo: IDamageInfo): void;
72
76
  addMilestone(milestone: Milestone, data?: number | string, update?: boolean): void;
73
77
  updateMovementIntent(movementIntent: IMovementIntent): boolean;
74
78
  load(): void;
@@ -96,6 +96,7 @@ export interface IInputManagerEvents {
96
96
  enabled(): any;
97
97
  rising(catalyst: InputCatalyst, info: InputInfo, modifiers: Set<Modifier>): any;
98
98
  falling(catalyst: InputCatalyst, info: InputInfo, modifiers: Set<Modifier>): any;
99
+ loop(): any;
99
100
  }
100
101
  declare class InputManager extends EventEmitter.Host<IInputManagerEvents> {
101
102
  readonly mouse: GlobalMouseInfo;
@@ -94,7 +94,7 @@ export default class GameScreen extends Screen {
94
94
  onOpenBook(human: Human, item: Item): void;
95
95
  protected onReadMap1(map: DrawnMap, item: Item, reader: Human): void;
96
96
  protected onSailOffMapEdge(player: Player, direction: Direction): void;
97
- protected onDie(player: Player, showingGameEndScreen: boolean): void;
97
+ protected onDie(player: Player, showingGameEndScreen?: boolean): void;
98
98
  protected onRespawn(): void;
99
99
  protected onItemMenu(api: IBindHandlerApi): boolean;
100
100
  protected onZoom(api: IBindHandlerApi): boolean;
@@ -19,13 +19,13 @@ import type ContextMenu from "ui/component/ContextMenu";
19
19
  import Bindable from "ui/input/Bindable";
20
20
  import type ActionBar from "ui/screen/screens/game/static/ActionBar";
21
21
  import type { ActionSlot } from "ui/screen/screens/game/static/ActionBar";
22
- import type { IDraggableComponent } from "ui/util/Draggable";
22
+ import type { IDraggableEvents } from "ui/util/Draggable";
23
23
  import Draggable from "ui/util/Draggable";
24
24
  import Vector2 from "utilities/math/Vector2";
25
25
  export type ItemSlot = Omit<Component, "event"> & {
26
26
  event: IEventEmitter<Component, IItemSlotEvents>;
27
27
  };
28
- export interface IItemSlotEvents extends Events<Component> {
28
+ export interface IItemSlotEvents extends Events<Component>, IDraggableEvents {
29
29
  pickUp(api: IItemPickUpApi): any;
30
30
  drop(api: IItemDropApi, intoSlot?: ItemSlot): any;
31
31
  }
@@ -89,7 +89,7 @@ export declare enum ItemRefreshType {
89
89
  export default class ItemComponent extends Component {
90
90
  protected readonly handler: IItemHandler;
91
91
  static registerSlot(slot: ItemSlot): void;
92
- event: IEventEmitter<this, Events<IDraggableComponent> & IItemSlotEvents>;
92
+ event: IEventEmitter<this, IItemSlotEvents>;
93
93
  readonly magicalIcon: Component<HTMLElement>;
94
94
  readonly protectedIcon: Component<HTMLElement>;
95
95
  readonly actionIcon: Component<HTMLElement> | undefined;
@@ -129,4 +129,5 @@ export default class ItemComponent extends Component {
129
129
  private refreshDurabilityBar;
130
130
  private lastActionIcon?;
131
131
  private refreshActionIcon;
132
+ protected onHoldingNotMoving(time: number): void;
132
133
  }
@@ -30,7 +30,7 @@ import ItemComponent from "ui/screen/screens/game/component/ItemComponent";
30
30
  import QuadrantComponent from "ui/screen/screens/game/component/QuadrantComponent";
31
31
  import ActionsConfigurationDrawer from "ui/screen/screens/game/static/actions/ActionsDrawer";
32
32
  import ActionSlotTooltipHandler from "ui/screen/screens/game/static/actions/ActionSlotTooltip";
33
- import { IActionBarSlotData } from "ui/screen/screens/game/static/actions/IActionBar";
33
+ import { ActionSlotUpdateReason, IActionBarSlotData } from "ui/screen/screens/game/static/actions/IActionBar";
34
34
  import type TooltipLocationHandler from "ui/tooltip/TooltipLocationHandler";
35
35
  export declare const MAX_SLOTS = 48;
36
36
  export declare enum ActionBarClasses {
@@ -108,7 +108,7 @@ declare class ActionSlotSlottedContainer extends ItemComponent {
108
108
  protected onEnter(reason: "mouse" | "focus"): void;
109
109
  }
110
110
  export interface IActionSlotEvents extends Events<Button>, IItemSlotEvents {
111
- update(item?: Item, oldItem?: Item): any;
111
+ update(item: Item | undefined, oldItem: Item | undefined, reason: ActionSlotUpdateReason): any;
112
112
  unequipItem(): any;
113
113
  }
114
114
  export declare class ActionSlot extends Button implements IRefreshable {
@@ -123,7 +123,10 @@ export declare class ActionSlot extends Button implements IRefreshable {
123
123
  private lastQuality?;
124
124
  usability: ReturnableUsableActionUsability;
125
125
  constructor(number: number, slotData: IActionBarSlotData);
126
- refresh(): this;
126
+ private skipNextClick;
127
+ private lastActivate;
128
+ protected onHoldingNotDragging(time: number): void;
129
+ refresh(_?: any, newItem?: Item, oldItem?: Item, reason?: ActionSlotUpdateReason): this;
127
130
  private onItemTransformed;
128
131
  private isUsable;
129
132
  clear(): void;
@@ -55,3 +55,10 @@ export declare class ActionSlotContext extends InfoProviderContext {
55
55
  getActionType(): ActionType | undefined;
56
56
  displayLevelExtraUnlessActionType(actionType: ActionType): InfoDisplayLevel.Always | InfoDisplayLevel.Extra;
57
57
  }
58
+ export declare enum ActionSlotUpdateReason {
59
+ AutoUseToggle = 0,
60
+ Replace = 1,
61
+ Using = 2,
62
+ Verify = 3,
63
+ Used = 4
64
+ }
@@ -9,7 +9,6 @@
9
9
  * https://github.com/WaywardGame/types/wiki
10
10
  */
11
11
  import EventEmitter from "event/EventEmitter";
12
- import type { IDamageInfo } from "game/entity/creature/ICreature";
13
12
  import type Component from "ui/component/Component";
14
13
  import type { IBindHandlerApi } from "ui/input/Bind";
15
14
  import WalkToTileHandler from "ui/screen/screens/game/util/movement/WalkToTileHandler";
@@ -32,8 +31,6 @@ export default class MovementHandler extends EventEmitter.Host<IMovementHandlerE
32
31
  deregister(): this;
33
32
  protected onMoveStart(): void;
34
33
  protected onMoveComplete(): void;
35
- protected onPlayerDamage(_: any, damageInfo: IDamageInfo): void;
36
- protected onPlayerDeath(): void;
37
34
  protected onFaceDown(api: IBindHandlerApi): boolean;
38
35
  faceTowardsMouse(api?: Pick<IBindHandlerApi, "mouse">): void;
39
36
  protected onFaceDirection(api?: Pick<IBindHandlerApi, "mouse" | "input">): boolean;
@@ -9,7 +9,6 @@
9
9
  * https://github.com/WaywardGame/types/wiki
10
10
  */
11
11
  import EventEmitter from "event/EventEmitter";
12
- import type { IStat } from "game/entity/IStats";
13
12
  import type Player from "game/entity/player/Player";
14
13
  import type Tile from "game/tile/Tile";
15
14
  import type Component from "ui/component/Component";
@@ -50,7 +49,6 @@ export default class WalkToTileHandler extends EventEmitter.Host<IWalkToTileHand
50
49
  protected onCancelMoveToTile(_api: IBindHandlerApi): boolean;
51
50
  protected onHoldMoveToTilePreview(api: IBindHandlerApi): boolean;
52
51
  protected onReleaseMoveToTilePreview(): void;
53
- protected onStatChanged(player: Player, stat: IStat): void;
54
52
  protected onPostMove(player: Player, fromTile: Tile, toTile: Tile): void;
55
53
  protected onWalkPathChange(player: Player, walkPath: IVector2[] | undefined): void;
56
54
  private resetToMouse;
@@ -30,6 +30,7 @@ export interface IDraggableEvents {
30
30
  moveStart(mouse: Vector2): false | void;
31
31
  move(offset: Vector2, mouse: Vector2): any;
32
32
  moveEnd(offset: Vector2, mouse: Vector2, bindable?: Bindable): any;
33
+ holdingNotMoving(time: number): any;
33
34
  }
34
35
  export type WithDraggableEvents<EVENTS_OF> = Events<EVENTS_OF> & IDraggableEvents;
35
36
  export interface IDraggableComponent extends Component {
@@ -38,6 +39,7 @@ export interface IDraggableComponent extends Component {
38
39
  export default class Draggable {
39
40
  private mouseStartPosition?;
40
41
  private dragStage;
42
+ private dragStartTime?;
41
43
  private readonly hostRef;
42
44
  get host(): IDraggableComponent;
43
45
  constructor(host: IDraggableComponent, ...bindables: Bindable[]);
@@ -58,5 +60,6 @@ export default class Draggable {
58
60
  dragStart(event: IDraggableInputEvent): boolean;
59
61
  private drag;
60
62
  dragEnd(event?: IDraggableInputEvent): boolean;
63
+ private onInputLoop;
61
64
  private getMousePosition;
62
65
  }
@@ -8,7 +8,7 @@
8
8
  * Wayward is a copyrighted and licensed work. Modification and/or distribution of any source files is prohibited. If you wish to modify the game in any way, please refer to the modding guide:
9
9
  * https://github.com/WaywardGame/types/wiki
10
10
  */
11
- export declare const gameVersionStage = "beta", gameVersionMajor = 2, gameVersionMinor = 13, gameVersionPatch = 3, gameVersionName = "Beacon's Call";
11
+ export declare const gameVersionStage = "beta", gameVersionMajor = 2, gameVersionMinor = 13, gameVersionPatch = 4, gameVersionName = "Beacon's Call";
12
12
  export declare const gameVersion: string;
13
13
  export declare const gameVersionTitleMajor: string;
14
14
  export declare const gameVersionTitleMinor: string;
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.3-beta.dev.20230702.2",
4
+ "version": "2.13.4-beta.dev.20230704.1",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",