Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

constructor

  • new TimerEvent(game: any, data: any, active: any, key_name: any, duration: any, finish_events: any): TimerEvent

Properties

active

active: boolean

Whether this GameEvent is active or not.

data

data: GoldenSun

Private duration

duration: number

Private finish_events

finish_events: GameEvent[] = []

game

game: Game

id

id: number

The GameEvent id number.

key_name

key_name: string

An unique label that identifies this GameEvent. This is optional.

origin_npc

origin_npc: NPC = null

If this GameEvent was originated by a NPC, this var holds this NPC reference.

type

The GameEvent type.

Static events

events: {}

The events object where the keys are the ids.

Type declaration

Static id_incrementer

id_incrementer: number

The GameEvents id incrementer.

Static labeled_events

labeled_events: {}

The events object where the keys are the events labels.

Type declaration

Methods

_fire

  • _fire(origin_npc?: NPC): void

destroy

  • destroy(): void

fire

  • fire(origin_npc?: NPC): void
  • This function is the one that should be called to start a event. It should never be overriden. Always before this function is called, it's checked whether Reveal psynergy is being casted, if yes, it's stopped before this event start.

    Parameters

    • Optional origin_npc: NPC

      the NPC that originated this game event.

    Returns void

wait

  • wait(time: number): Promise<void>
  • Promised way to create and wait a Phaser.Timer. Waits for the amount of time given.

    Parameters

    • time: number

      the time in ms.

    Returns Promise<void>

Static check_reveal

  • check_reveal(target: Object, property_key: string, descriptor: PropertyDescriptor): PropertyDescriptor
  • Everytime a game event is fired, it's checked whether reveal is casted, if yes, it stops the reveal psynergy effect.

    Parameters

    • target: Object

      not used.

    • property_key: string

      not used.

    • descriptor: PropertyDescriptor

      the function descriptor.

    Returns PropertyDescriptor

    returns a new descriptor.

Static get_char

  • get_char(data: GoldenSun, options: { is_npc?: boolean; npc_index?: number; npc_label?: string }): Hero | NPC
  • A helper function that defines the ControllableChar based on inputs. The controllable char can be a hero or a npc.

    Parameters

    • data: GoldenSun

      The GoldenSun instance.

    • options: { is_npc?: boolean; npc_index?: number; npc_label?: string }

      Some options to help defining the char.

      • Optional is_npc?: boolean

        Whether it's a npc or not.

      • Optional npc_index?: number

        The npc index number.

      • Optional npc_label?: string

        The npc unique label identifier.

    Returns Hero | NPC

    the defined char.

Static get_event

Static get_labeled_event

  • get_labeled_event(key_name: string): GameEvent

Static reset

  • reset(): void

Generated using TypeDoc