@wayward/types 2.13.0-beta.dev.20230322.1 → 2.13.0-beta.dev.20230324.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.
|
@@ -322,6 +322,10 @@ export default class Doodad extends Entity<DoodadType, DoodadTag> implements IUn
|
|
|
322
322
|
* @returns Map of skill type and number (skill value).
|
|
323
323
|
*/
|
|
324
324
|
getMagicalDoodadSkills(): Map<SkillType, number>;
|
|
325
|
+
/**
|
|
326
|
+
* Forces a boat to be drydocked (revert from doodad to an item if water was taken away for some reason).
|
|
327
|
+
*/
|
|
328
|
+
dryDockBoat(human: Human): void;
|
|
325
329
|
/**
|
|
326
330
|
* Decay over time
|
|
327
331
|
*/
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import type { SfxType } from "audio/IAudio";
|
|
12
12
|
import EventEmitter from "event/EventEmitter";
|
|
13
|
-
import type { AnyActionDescription, IActionApi, IActionArgumentTypeMap, IActionConfirmerApi, IActionDescription,
|
|
13
|
+
import type { ActionExecutorEvents, AnyActionDescription, IActionApi, IActionArgumentTypeMap, IActionConfirmerApi, IActionDescription, IActionNotUsable, IActionParticle, IActionSoundEffect, IActionUsable } from "game/entity/action/IAction";
|
|
14
14
|
import { ActionArgument, ActionType } from "game/entity/action/IAction";
|
|
15
15
|
import type Entity from "game/entity/Entity";
|
|
16
16
|
import type { SkillType } from "game/entity/IHuman";
|
|
@@ -23,20 +23,7 @@ import ActionPacket from "multiplayer/packets/shared/ActionPacket";
|
|
|
23
23
|
import type { IRGB } from "utilities/Color";
|
|
24
24
|
import type { Direction } from "utilities/math/Direction";
|
|
25
25
|
import type { IVector3 } from "utilities/math/IVector";
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Called before an action is executed
|
|
29
|
-
* This is called before the action result is used
|
|
30
|
-
* @returns False to cancel the action
|
|
31
|
-
*/
|
|
32
|
-
preExecuteAction(actionType: ActionType, actionApi: IActionHandlerApi<any, any>, args: any[]): false | void;
|
|
33
|
-
/**
|
|
34
|
-
* Called after an action has been executed
|
|
35
|
-
* This is called after the action result is used
|
|
36
|
-
*/
|
|
37
|
-
postExecuteAction(actionType: ActionType, actionApi: IActionHandlerApi<any, any>, args: any[]): any;
|
|
38
|
-
}
|
|
39
|
-
export default class ActionExecutor<A extends Array<ActionArgument | ActionArgument[]>, E extends Entity, R, CU extends IActionUsable, AV extends any[]> extends EventEmitter.Host<ActionEvents> implements IActionApi<E, CU>, IActionConfirmerApi<E, CU> {
|
|
26
|
+
export default class ActionExecutor<A extends Array<ActionArgument | ActionArgument[]>, E extends Entity, R, CU extends IActionUsable, AV extends any[]> extends EventEmitter.Host<ActionExecutorEvents> implements IActionApi<E, CU>, IActionConfirmerApi<E, CU> {
|
|
40
27
|
/**
|
|
41
28
|
* Gets an action by its description. If you're using the Action class for constructing the descriptions, just pass the action instance.
|
|
42
29
|
*
|
|
@@ -136,4 +123,3 @@ export default class ActionExecutor<A extends Array<ActionArgument | ActionArgum
|
|
|
136
123
|
private isUsableWhen;
|
|
137
124
|
private static validate;
|
|
138
125
|
}
|
|
139
|
-
export {};
|
|
@@ -420,4 +420,17 @@ export type Tuple5<X1, X2, X3, X4, X5> = undefined extends X5 ? (undefined exten
|
|
|
420
420
|
export type ActionArguments<A extends IActionDescription<any, any, any, any, any>> = A extends IActionDescription<any, any, any, any, infer AA> ? AA : never;
|
|
421
421
|
export type ActionEntities<A extends IActionDescription<any, any>> = A extends IActionDescription<any, infer E> ? E : never;
|
|
422
422
|
export type ActionApi<A extends IActionDescription<any, any>> = IActionApi<ActionEntities<A>>;
|
|
423
|
+
export interface ActionExecutorEvents {
|
|
424
|
+
/**
|
|
425
|
+
* Called before an action is executed
|
|
426
|
+
* This is called before the action result is used
|
|
427
|
+
* @returns False to cancel the action
|
|
428
|
+
*/
|
|
429
|
+
preExecuteAction<A extends Array<ActionArgument | ActionArgument[]> = Array<ActionArgument | ActionArgument[]>, E extends Entity = Entity, AV extends any[] = ActionArgumentTupleTypes<A>, CU extends IActionUsable = any>(actionType: ActionType, actionApi: IActionHandlerApi<E, CU>, args: AV): false | void;
|
|
430
|
+
/**
|
|
431
|
+
* Called after an action has been executed
|
|
432
|
+
* This is called after the action result is used
|
|
433
|
+
*/
|
|
434
|
+
postExecuteAction<A extends Array<ActionArgument | ActionArgument[]> = Array<ActionArgument | ActionArgument[]>, E extends Entity = Entity, AV extends any[] = ActionArgumentTupleTypes<A>, CU extends IActionUsable = any>(actionType: ActionType, actionApi: IActionHandlerApi<E, CU>, args: AV): any;
|
|
435
|
+
}
|
|
423
436
|
export {};
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
import { Action } from "game/entity/action/Action";
|
|
12
12
|
import type { IActionUsable } from "game/entity/action/IAction";
|
|
13
13
|
import { ActionArgument } from "game/entity/action/IAction";
|
|
14
|
-
import { IItemDescription } from "game/item/IItem";
|
|
14
|
+
import type { IItemDescription } from "game/item/IItem";
|
|
15
15
|
export interface IConsumeItemCanUse extends IActionUsable {
|
|
16
16
|
description: IItemDescription;
|
|
17
17
|
}
|
package/package.json
CHANGED