Options
All
  • Public
  • Public/Protected
  • All
Menu

The GameEvent that shows an emoticon above a ControllableChar head.

Hierarchy

Index

Constructors

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

    • game: any
    • data: any
    • active: any
    • key_name: any
    • keep_reveal: any
    • keep_custom_psynergy: any
    • emoticon: any
    • duration: any
    • sound_effect: any
    • is_npc: any
    • npc_index: any
    • npc_label: any
    • location: any
    • face_hero: any
    • reset_direction: any
    • destroy_emoticon: any
    • finish_events: any

    Returns EmoticonEvent

Properties

The target char that will show the emoticon.

data: GoldenSun
destroy_emoticon: boolean

INPUT. If true, it will destroy any currect active emoticon on the given char. 'finish_events' won't be called if this is prop is true.

duration: number

INPUT. The emoticon show duration.

emoticon: string

INPUT. The emoticon key name.

face_hero: boolean

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

finish_events: GameEvent[] = []

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

game: Game
is_npc: boolean

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

location: { x: number; y: number }

INPUT. A custom location for the emoticon.

Type declaration

  • x: number
  • y: number
npc_index: number

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

npc_label: string

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

previous_direction: directions

The previous direction before facing hero.

reset_direction: boolean

INPUT. Reset direction on finish if "face_hero" was set to true.

sound_effect: string

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

DEFAULT_DURATION: 800 = 800
events: {}

The events object where the keys are the ids.

Type declaration

id_incrementer: number

The GameEvents id incrementer.

labeled_events: {}

The events object where the keys are the events labels.

Type declaration

Accessors

  • get active(): boolean
  • get id(): number
  • get keep_reveal(): boolean
  • get key_name(): string
  • get origin_npc(): NPC

Methods

  • _destroy(): void
  • _fire(): Promise<void>
  • destroy(): void
  • This function is the one that should be called to destroy an event. It should never be overriden. Call this function to destroy this event. This can be called whenever an associated entity is destroyed, like maps, NPCs etc.

    Returns void

  • finish(): Promise<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.

    Parameters

    • Optional origin_npc: NPC

      the NPC that originated this game event.

    Returns void

    if the child class has an async fire function, returns its Promise.

  • set_event_activation(activate: boolean): void
  • 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.

  • get_labeled_event(key_name: string): GameEvent
  • reset(): void

Generated using TypeDoc