• Public
  • Public/Protected
  • All

The GameEvent that shows an emoticon above a ControllableChar head.





  • new EmoticonEvent(game: any, data: any, active: any, key_name: any, emoticon: any, duration: any, sound_effect: any, is_npc: any, npc_index: any, npc_label: any, location: any, face_hero: any, finish_events: any): EmoticonEvent



active: boolean

Whether this GameEvent is active or not.

Private char

The target char that will show the emoticon.


data: GoldenSun

Private duration

duration: number

INPUT. The emoticon show duration.

Private emoticon

emoticon: string

INPUT. The emoticon key name.

Private face_hero

face_hero: boolean

INPUT. If target char is NPC, make hero and npc look each other.

Private finish_events

finish_events: GameEvent[] = []

INPUT. The list of game events to be fired on this event end.


game: Game


id: number

The GameEvent id number.

Private is_npc

is_npc: boolean

INPUT. Whether the target char is a NPC. If not, it's the hero.


key_name: string

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

Private location

location: { x: number; y: number }

INPUT. A custom location for the emoticon.

Type declaration

  • x: number
  • y: number

Private npc_index

npc_index: number

INPUT. If the target char is a NPC, the npc index. Use this or npc_label

Private npc_label

npc_label: string

INPUT. If the target char is a NPC, the npc unqie label. Use this or npc_index


origin_npc: NPC = null

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

Private sound_effect

sound_effect: string

INPUT. A sfx to be played while on emoticon show.


The GameEvent type.

Static Private Readonly DEFAULT_DURATION


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



  • _fire(oringin_npc: NPC): Promise<void>


  • destroy(): void


  • finish(): void


  • 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.


    • Optional origin_npc: NPC

      the NPC that originated this game event.

    Returns void


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


    • 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.


    • 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.


    • 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