Type Parameters

Hierarchy

  • Action

Implements

Constructors

Properties

argumentTypes: A
canUseHandler: ((actionApi: IActionHandlerApi<E, CU>, ...args: AV) => CU | IActionNotUsable)

Type declaration

confirmer?: ((actionApi: IActionConfirmerApi<E, any>, ...args: AV) => Promise<boolean>)

Type declaration

deities?: DeityReal[]
exampleHandler?: ((actionApi: IActionExampleApi<E, CU>, ...args: AV) => IActionExample)

Type declaration

flags: {
    0: undefined | boolean;
} = {}

Type declaration

  • 0: undefined | boolean
handler: ((actionApi: IActionHandlerApi<E, CU>, ...args: AV) => R)

Type declaration

notUsableHandler: ((actionApi: IActionNotUsableHandlerApi<E, CU>, ...args: AV) => R)

Type declaration

preExecutionHandler?: ((actionApi: IActionApi<E, CU>, ...args: AV) => any)

Type declaration

    • (actionApi: IActionApi<E, CU>, ...args: AV): any
    • Parameters

      Returns any

usability: {
    0: undefined | boolean;
    1: undefined | boolean;
    2: undefined | boolean;
    3: undefined | boolean;
    4: undefined | boolean;
} = {}

Type declaration

  • 0: undefined | boolean
  • 1: undefined | boolean
  • 2: undefined | boolean
  • 3: undefined | boolean
  • 4: undefined | boolean
validExecutors: Set<EntityType>

Accessors

  • get hasSetCanUse(): boolean
  • Check if the action has setup CanUse logic

    Returns boolean

Methods

  • Creates an identical clone of this action.

    Returns Action<A, E, R, CU, AV>

  • Parameters

    • actionApiOrExecutor: E | IActionApi<E, any>
    • Rest ...args: AV

    Returns undefined | R | Promise<R> | Promise<undefined | R>

  • Parameters

    • actionApiOrExecutor: E | IActionApi<E, any>
    • args: AV

    Returns Promise<boolean>

  • Add an asynchronous "confirmer" handler to this action.

    When an entity attempts to execute an action, the confirmer is the second handler called (after the pre-execution handler). Confirmer handlers are executed on the client-side only.

    Note: If you use actionApi.addItems in a pre-execution handler, a confirmation interrupt will already be shown. In that case, a confirmer is unnecessary.

    Returns

    false to cancel the execution of the action.

    Parameters

    Returns Action<A, E, R, CU, AV>

  • Sets which deities can award runes for this action

    Parameters

    Returns Action<A, E, R, CU, AV>

  • Add a handler for this action.

    Handlers are executed on both the client-side and the server-side.

    Type Parameters

    Parameters

    • handler: H

    Returns Action<A, E, ReturnType<H>, CU, ActionArgumentTupleTypes<A>>

  • Add a handler that is called when it's executed while not being usable

    Handlers are executed on both the client-side and the server-side.

    Type Parameters

    Parameters

    • handler: H

    Returns Action<A, E, ReturnType<H>, CU, ActionArgumentTupleTypes<A>>

  • Add a "pre-execution" handler to this action.

    When an entity attempts to execute an action, the pre-execution handler is the first handler called. Pre-execution handlers are executed on the client-side only.

    Returns

    false to cancel the execution of the action.

    Parameters

    • handler: ((actionApi: IActionApi<E, CU>, ...args: AV) => any)
        • (actionApi: IActionApi<E, CU>, ...args: AV): any
        • Parameters

          Returns any

    Returns Action<A, E, R, CU, AV>

  • Sets additional times the action can be used in.

    Parameters

    Returns Action<A, E, R, CU, AV>

Generated using TypeDoc