Options
All
  • Public
  • Public/Protected
  • All
Menu

This class is responsible to control the hero that is controlled by the game player in the maps.

Hierarchy

Index

Constructors

Properties

Accessors

Methods

Constructors

  • new Hero(game: Game, data: GoldenSun, key_name: string, initial_x: number, initial_y: number, initial_action: string, initial_direction: string, walk_speed: number, dash_speed: number, climb_speed: number): Hero

Properties

_active: boolean
_body_radius: number
_current_action: string
_current_animation: string
_current_direction: number

The direction that the char is moving.

_current_speed: { x: number; y: number }

Type declaration

  • x: number
  • y: number
_emoticon_sprite: Sprite
_extra_speed: number
_extra_speed_force: { x: number; y: number }

Type declaration

  • x: number
  • y: number
_force_diagonal_speed: { x: number; y: number }

Type declaration

  • x: number
  • y: number
_ice_slide_direction: number

The direction of the ice sliding movement that can be different of char direction.

_push_timer: Timer
_required_direction: number

The direction determined by the input.

_shapes_collision_active: boolean
_sprite_info: SpriteBase
_temp_speed: { x: number; y: number }

Type declaration

  • x: number
  • y: number
_tile_x_pos: number
_tile_y_pos: number
_transition_direction: number

When changing directions, the char smoothly changes to the target direction. This var holds the intermediate directions.

_trying_to_push_direction: number

The direction that the char is trying to push an interactable object

avoid_encounter: boolean

If true, the next battle encounter will be avoided, then this var is reset to false.

casting_aura_stop_function: ((reset_casting_psy_flag?: boolean, reset_map_tint?: boolean) => Promise<void>)

Type declaration

    • (reset_casting_psy_flag?: boolean, reset_map_tint?: boolean): Promise<void>
    • The function used to stop this char casting aura.

      Parameters

      • Optional reset_casting_psy_flag: boolean
      • Optional reset_map_tint: boolean

      Returns Promise<void>

casting_psynergy: boolean

Whether this char is casting psynergy.

climb_speed: number
climbing: boolean

Whether this char is climbing.

climbing_rope: boolean

Whether this char is climbing a rope.

colliding_directions_mask: number

A mask that contains in which directions the hero is colliding. Example:

  • If the hero is colliding on left direction, which has 4 as value, then this variable will have this value: 00010000.
  • If the hero is colliding on right direction, which has 0 as value, then this variable will have this value: 00000001.
  • Colliding in both left and right direction: 00010001.
crop_texture: boolean

Whether the char is prone to have it's texture halved when going through forests.

dash_speed: number
dashing: boolean

Whether this char is dashing.

data: GoldenSun
enable_footsteps: boolean

Whether the char will let footprints in the ground.

force_char_stop_in_event: boolean

Forces this char to stop while in game event.

force_direction: boolean

Whether the char had its direction changed due to side collision.

force_idle_action_in_event: boolean

Forces char to assume idle action if it's forced to stop while in a game event.

game: Game
general_counter: number

This hero general counter. Used in recover PP, djinn recover and poison damage.

ice_sliding_active: boolean

Whether this char is under an ice sliding ground.

idle_climbing: boolean

Whether this char is idle during climbing state.

ignore_play: boolean

If true, animation play will be ignored.

jumping: boolean

Whether this char is jumping.

look_target: ControllableChar = null
misc_busy: boolean

Whether this char is busy by any misc. reason.

on_custom_psynergy_effect: boolean

Whether this char is under custom psynergy effect.

on_reveal: boolean

Whether this char is under Reveal psynergy effect.

on_stair: boolean

If true, it will assume that this char is walking over a stair. This will impact this char facing direction.

pushing: boolean

Whether this char is pushing an Interactable Object.

sand_mode: boolean

Whether this char is melted in sand.

shadow: Sprite

The shadow sprite object.

shadow_following: boolean

Whether the shadow is following or not this char.

sliding: boolean

Whether this char is cliff sliding.

sliding_on_ice: boolean

Whether this char is sliding/moving over an ice ground.

sprite: Sprite

The char main sprite object.

stop_by_colliding: boolean

Whether the char is idle/stopped due to collision.

storage_keys: { action?: string; active?: string; animation?: string; position?: string }

Type declaration

  • Optional action?: string
  • Optional active?: string
  • Optional animation?: string
  • Optional position?: string
teleporting: boolean

Whether this char is teleporting by the teleport TileEvent.

trying_to_push: boolean

Whether thic char is trying to push an Interactable Object.

walk_speed: number
walking_over_rope: boolean

Whether this char is walking over a rope.

GENERAL_COUNTER_INCR_DASH: 204 = 0xcc

The increment value for hero general counter when dashing. Used in recover PP, djinn recover and poison damage.

GENERAL_COUNTER_INCR_WALK: 102 = 0x66

The increment value for hero general counter when walking. Used in recover PP, djinn recover and poison damage.

GENERAL_COUNTER_LIMIT: 65535 = 0xffff

The counter limit value. Used in recover PP, djinn recover and poison damage.

ROTATION_KEY: directions[] = ...

This variable can convert from pressed keys to the corresponding in-game rotation.

SPEEDS: { 0: { x: number; y: number }; 1: { x: number; y: number }; 2: { x: number; y: number }; 3: { x: number; y: number }; 4: { x: number; y: number }; 5: { x: number; y: number }; 6: { x: number; y: number }; 7: { x: number; y: number } } = ...

Speed factor values for each standard direction.

Type declaration

  • 0: { x: number; y: number }
    • x: number
    • y: number
  • 1: { x: number; y: number }
    • x: number
    • y: number
  • 2: { x: number; y: number }
    • x: number
    • y: number
  • 3: { x: number; y: number }
    • x: number
    • y: number
  • 4: { x: number; y: number }
    • x: number
    • y: number
  • 5: { x: number; y: number }
    • x: number
    • y: number
  • 6: { x: number; y: number }
    • x: number
    • y: number
  • 7: { x: number; y: number }
    • x: number
    • y: number

Accessors

  • get active(): boolean
  • get active_filters(): { color_blend: boolean; colorize: boolean; flame: boolean; gray: boolean; hue: boolean; levels: boolean; mode7: boolean; outline: boolean; pixel_shift: boolean; tint: boolean; watery: boolean }
  • An object containing which filters are active in this char.

    Returns { color_blend: boolean; colorize: boolean; flame: boolean; gray: boolean; hue: boolean; levels: boolean; mode7: boolean; outline: boolean; pixel_shift: boolean; tint: boolean; watery: boolean }

    • color_blend: boolean
    • colorize: boolean
    • flame: boolean
    • gray: boolean
    • hue: boolean
    • levels: boolean
    • mode7: boolean
    • outline: boolean
    • pixel_shift: boolean
    • tint: boolean
    • watery: boolean
  • get body(): Body
  • get body_radius(): number
  • get collision_layer(): number
  • Gets the collision layer that the hero is.

    Returns number

  • get color_blend_filter(): ColorBlend
  • The Phaser.Filter that controls the blend of colors of the texture of this char sprite.

    Returns ColorBlend

  • get colorize_filter(): Colorize
  • The Phaser.Filter that controls the colors of the texture of this char sprite.

    Returns Colorize

  • get current_action(): string
  • get current_animation(): string
  • get current_direction(): number
  • The current active direction of this char according to it movement.

    Returns number

  • get current_speed(): { x: number; y: number }
  • This char current speed normalized vector. This pretty much indicates the char direction.

    Returns { x: number; y: number }

    • x: number
    • y: number
  • get extra_speed(): number
  • The extra char speed that might be applied to current speed.

    Returns number

  • get extra_speed_force(): { x: number; y: number }
  • The extra char speed that might be applied to current speed even if it's idle.

    Returns { x: number; y: number }

    • x: number
    • y: number
  • get flame_filter(): Flame
  • The Phaser.Filter that sets flame colors into char sprite.

    Returns Flame

  • get force_diagonal_speed(): { x: number; y: number }
  • This char speed according to the collision slope.

    Returns { x: number; y: number }

    • x: number
    • y: number
  • get gray_filter(): Gray
  • The Phaser.Filter that controls the saturation of the texture of this char sprite.

    Returns Gray

  • get height(): number
  • get hue_filter(): Hue
  • The Phaser.Filter that controls the hue of the texture of this char sprite.

    Returns Hue

  • get ice_slide_direction(): number
  • The direction in which this char is sliding in the ice. It's not necessarily the direction that this char is facing.

    Returns number

  • get is_interactable_object(): boolean
  • Returns whether it's an IO. Always returns false.

    Returns boolean

  • get is_npc(): boolean
  • get key_name(): string
  • get levels_filter(): Levels
  • The Phaser.Filter that controls the color levels of the texture of this char sprite.

    Returns Levels

  • get outline_filter(): Outline
  • The Phaser.Filter that activates an outline in this char sprite.

    Returns Outline

  • get pixel_shift_filter(): PixelShift
  • The Phaser.Filter that ashifts the texture of this char sprite.

    Returns PixelShift

  • get push_timer(): Timer
  • The Phaser.TimerEvent used in the Interactable Object push process.

    Returns Timer

  • get required_direction(): number
  • The directing that's being requested to this char to go.

    Returns number

  • get shapes_collision_active(): boolean
  • Whether the shapes of this char body are active (colliding) or not.

    Returns boolean

  • get temp_speed(): { x: number; y: number }
  • This char pre-caculated speed. It might change due to collision.

    Returns { x: number; y: number }

    • x: number
    • y: number
  • get tile_pos(): { x: number; y: number }
  • Gets the tile pos object for this char.

    Returns { x: number; y: number }

    • x: number
    • y: number
  • get tile_x_pos(): number
  • get tile_y_pos(): number
  • get tint_filter(): Tint
  • The Phaser.Filter that tints the texture of this char sprite.

    Returns Tint

  • get transition_direction(): number
  • When changing direction, the char doesn't face immediately the requested direction. This property holds the transion directions till it reaches the requested direction.

    Returns number

  • get trying_to_push_direction(): number
  • The direction that this char is trying to push an Interactable Object.

    Returns number

  • get watery_filter(): Watery
  • The Phaser.Filter that sets water colors into char sprite.

    Returns Watery

  • get width(): number
  • get x(): number
  • set x(x: number): void
  • get y(): number
  • set y(y: number): void

Methods

  • add_animation_callback(callback: (() => void)): number
  • Adds a callback for this char that will be called when this char animation changes.

    Parameters

    • callback: (() => void)

      the callback that will be called.

        • (): void
        • Returns void

    Returns number

    returns the key to track this callback, so you can identify it later to remove.

  • apply_speed(): void
  • blink(count: number, interval: number, options?: { color?: { b: number; g: number; r: number }; keep_filter?: boolean; outline_blink?: boolean; transparent_outline?: boolean }): Promise<void>
  • Blinks this char by tintint and untinting it or outlining it.

    Parameters

    • count: number

      how many times this char will blink.

    • interval: number

      the time interval between each blink.

    • Optional options: { color?: { b: number; g: number; r: number }; keep_filter?: boolean; outline_blink?: boolean; transparent_outline?: boolean }

      some options.

      • Optional color?: { b: number; g: number; r: number }

        The color to tint/outline the char.

        • b: number

          The blue color component to tint. 0 to 1. Default 1.

        • g: number

          The green color component to tint. 0 to 1. Default 1.

        • r: number

          The red color component to tint. 0 to 1. Default 1.

      • Optional keep_filter?: boolean

        if true, will keep the color filter on blink finish.

      • Optional outline_blink?: boolean

        If true, the char will be outlined instead of tinted. Default is false.

      • Optional transparent_outline?: boolean

        If 'outline_blink' is true, whether the char will be transparent or not when outlined. Default is true.

    Returns Promise<void>

  • calculate_speed(): void
  • check_control_inputs(): void
  • Checks which hero controls are being pressed. Like arrows and dash buttons.

    Returns void

  • check_custom_directions_change(): void
  • Checks whether there's a necessity to change hero direction due to any custom circumstances.

    Returns void

  • check_interactable_objects(contacts: ContactEquation[]): void
  • check_sand_quit(contacts: ContactEquation[]): boolean
  • Checks if this char will quit sand mode by colliding with a tile that has quit_sand property true.

    Parameters

    • contacts: ContactEquation[]

      p2 contact equation array.

    Returns boolean

    returns true if it exited sand mode.

  • choose_action_based_on_char_state(check_on_event?: boolean): void
  • choose_direction_by_speed(): void
  • config_body(body_radius?: number): void
  • Initializes and configs the hero collision body.

    Parameters

    • body_radius: number = numbers.HERO_BODY_RADIUS

      the hero collision body radius.

    Returns void

  • create_half_crop_mask(): void
  • destroy_emoticon(): void
  • face_direction(direction: number, time_between_frames?: number): Promise<void>
  • fall(options: { dest_collision_layer?: number; ground_hit_animation?: boolean; show_exclamation_emoticon?: boolean; splash_sweat_drops?: boolean; teleport?: { dest_collision_layer: number; destination: string; destination_position: { x: number; y: number }; diminish_on_transition?: boolean; origin_position?: { x: number; y: number }; send_to_front_on_teleport?: boolean; on_before_teleport?: any }; walking_in_the_air?: boolean; y_destination_position: number; on_fall_finish_callback?: any }): Promise<void>
  • Make the char to fall to a given destination.

    Parameters

    • options: { dest_collision_layer?: number; ground_hit_animation?: boolean; show_exclamation_emoticon?: boolean; splash_sweat_drops?: boolean; teleport?: { dest_collision_layer: number; destination: string; destination_position: { x: number; y: number }; diminish_on_transition?: boolean; origin_position?: { x: number; y: number }; send_to_front_on_teleport?: boolean; on_before_teleport?: any }; walking_in_the_air?: boolean; y_destination_position: number; on_fall_finish_callback?: any }

      fall options object.

      • Optional dest_collision_layer?: number

        The destination collision layer index.

      • Optional ground_hit_animation?: boolean

        Whether the char will perform a ground hit animation.

      • Optional show_exclamation_emoticon?: boolean

        Whether an exclamation emoticon will appear over the char before falling.

      • Optional splash_sweat_drops?: boolean

        The char will splash sweat drops before falling.

      • Optional teleport?: { dest_collision_layer: number; destination: string; destination_position: { x: number; y: number }; diminish_on_transition?: boolean; origin_position?: { x: number; y: number }; send_to_front_on_teleport?: boolean; on_before_teleport?: any }

        Teleport info. If passed, the char will teleport to another map while falling.

        • dest_collision_layer: number

          The destination collision layer index in the dest map.

        • destination: string

          The teleport map key name destination.

        • destination_position: { x: number; y: number }

          The destination position.

          • x: number

            The x tile position.

          • y: number

            The y tile position.

        • Optional diminish_on_transition?: boolean

          If true, the char will diminish instead of fall before teleport.

        • Optional origin_position?: { x: number; y: number }

          The origin position that the char will be just after the teleport.

          • x: number

            The x tile position.

          • y: number

            The y tile position.

        • Optional send_to_front_on_teleport?: boolean

          If true, the char sprite will be brought to the top on z-index while falling.

        • on_before_teleport?:function
          • on_before_teleport(): void
      • Optional walking_in_the_air?: boolean

        Whether the char will performa a walking in the air animation before falling.

      • y_destination_position: number

        The final y-tile position that the char will reach after falling.

      • on_fall_finish_callback?:function
        • on_fall_finish_callback(): void

    Returns Promise<void>

  • get_encounter_speed_factor(): 1 | 0.5 | 1.5
  • Gets the hero battle encounter factor that depends on the type of the map (if it's world map or not) and whether it's dashing or not.

    Returns 1 | 0.5 | 1.5

    the encounter factor.

  • get_move_callback(dest: { x: number; y: number }, on_position_reach_callback: (() => void), minimal_distance?: number): (() => void)
  • Gets the update callback that need to be fired under a loop in order to move this char to a specific position.

    Parameters

    • dest: { x: number; y: number }

      the desitiona position object.

      • x: number
      • y: number
    • on_position_reach_callback: (() => void)

      the callback that will be called when this char reaches the position.

        • (): void
        • Returns void

    • minimal_distance: number = 3

      the minimal distance to be regarded to when check whether this char is close enough to the destination.

    Returns (() => void)

    return the update callback to keep this char moving and checking whether it should stop.

      • (): void
      • Returns void

  • ground_hit_dust_animation(on_animation_end: (() => void)): void
  • in_action(allow_climbing?: boolean): boolean
  • in_movement(walk_dash_only?: boolean): boolean
  • increase_extra_speed(delta_value: number): void
  • increase_forced_extra_speed(delta_value: { x?: number; y?: number }): void
  • initialize(): void
  • is_close(target_char: NPC): number
  • jump(options: { bounce?: boolean; dest?: { distance?: number; distance_multiplier?: number; tile_x?: number; tile_y?: number; x?: number; y?: number }; dont_play_jump_animation?: boolean; duration?: number; jump_direction?: directions; jump_height?: number; keep_shadow_hidden?: boolean; sfx_key?: string; time_on_finish?: number }): Promise<void>
  • Makes this char to jump vertically or to a specific destination.

    Parameters

    • options: { bounce?: boolean; dest?: { distance?: number; distance_multiplier?: number; tile_x?: number; tile_y?: number; x?: number; y?: number }; dont_play_jump_animation?: boolean; duration?: number; jump_direction?: directions; jump_height?: number; keep_shadow_hidden?: boolean; sfx_key?: string; time_on_finish?: number }
      • Optional bounce?: boolean

        Whether the char will bounce on jump finish. Only for vertical jumps.

      • Optional dest?: { distance?: number; distance_multiplier?: number; tile_x?: number; tile_y?: number; x?: number; y?: number }

        If this object is set, the char will perform a jump towards a given direction.

        • Optional distance?: number

          The jump distance that this char will perform. If not given, this char will jump into the center of the destination. This option is not valid if it's a diagonal direction jumping.

        • Optional distance_multiplier?: number

          The distance multiplier that will be applied to the final jump distance.

        • Optional tile_x?: number

          The x tile position destination. If position in px is defined, this one won't be used.

        • Optional tile_y?: number

          The y tile position destination. If position in px is defined, this one won't be used.

        • Optional x?: number

          The x position destination in px. This position has preference over tile position.

        • Optional y?: number

          The y position destination in px. This position has preference over tile position.

      • Optional dont_play_jump_animation?: boolean

        If true, char jump animation won't be played.

      • Optional duration?: number

        The duration of the jump in ms.

      • Optional jump_direction?: directions

        The direction that the char is going to be while jumping.

      • Optional jump_height?: number

        The height of the jump in px. This option is not valid if it's a diagonal direction jumping.

      • Optional keep_shadow_hidden?: boolean

        Whether the char shadow will remain hidden after jump.

      • Optional sfx_key?: string

        The sound effect to play while jumping.

      • Optional time_on_finish?: number

        A time to wait on jump finish in ms.

    Returns Promise<void>

  • manage_filter(filter: Filter, set: boolean): void
  • play(action?: string, animation?: string, start?: boolean, frame_rate?: number, loop?: boolean, reset_before_start?: boolean, reversed?: boolean): Animation
  • Plays an animation of this char.

    Parameters

    • Optional action: string

      the action that this char is going to doing.

    • Optional animation: string

      an specific animation of the given action that this char is going to be executing.

    • start: boolean = true

      whether you want the animation to start. Otherwise it will be stopped.

    • Optional frame_rate: number

      a custom frame rate value.

    • Optional loop: boolean

      whether the animation will be looping.

    • Optional reset_before_start: boolean

      whether the animation will reset before start.

    • Optional reversed: boolean

      whether the animation will be played on reverse sense.

    Returns Animation

    Returns the resulting Phaser.Animation object.

  • play_current_action(check_on_event?: boolean, force_squat?: boolean): void
  • remove_animation_callback(key: number): boolean
  • reset_anchor(property?: "x" | "y"): void
  • reset_scale(): void
  • set_collision_layer(layer: number): void
  • set_direction(direction?: directions, force_change?: boolean, transition_also?: boolean): void
  • Changes the char current direction to the given direction.

    Parameters

    • Optional direction: directions

      the direction to change.

    • force_change: boolean = false

      plays this new direction.

    • transition_also: boolean = true

      also change the transition direction.

    Returns void

  • set_frame(animation: string | directions, frame_index?: number, action?: string): void
  • set_hue(activate: boolean, angle?: number): void
  • set_ice_slide_direction(direction: directions): void
  • set_outline(activate: boolean, options?: { b?: number; g?: number; keep_transparent?: boolean; r?: number }): void
  • Sets or unsets an outline in this char. You can also use this function to update options. Otherwise, use ControllableChar.outline_filter directly.

    Parameters

    • activate: boolean

      whether you want to activate the outline or not.

    • Optional options: { b?: number; g?: number; keep_transparent?: boolean; r?: number }

      some options.

      • Optional b?: number

        The blue color component of the outline. 0 to 1. Default 1.

      • Optional g?: number

        The green color component of the outline. 0 to 1. Default 1.

      • Optional keep_transparent?: boolean

        If this property is true, the char will be transparent excepting the outline. Default false.

      • Optional r?: number

        The red color component of the outline. 0 to 1. Default 1.

    Returns void

  • set_position(position: { x?: number; y?: number }, update_shadow?: boolean): void
  • set_push_timer(callback: (() => void), delay?: number): void
  • Sets the push timer for this char. This timer is used to start the object pushing. The char must wait for this timer before pushing.

    Parameters

    • callback: (() => void)

      the timer callback.

        • (): void
        • Returns void

    • delay: number = Phaser.Timer.QUARTER

      the initial delay.

    Returns void

  • set_rotation(rotate: boolean, interframe_interval?: number, frame_index?: number): void
  • Activates or deactivates this char rotation on z-axis.

    Parameters

    • rotate: boolean

      if true, activates the rotation.

    • interframe_interval: number = -1

      frame change rate interval in ms. -1 to change every frame.

    • Optional frame_index: number

      optionally specifies a frame index to be in when rotating.

    Returns void

  • set_shadow(group: Group, options?: { is_world_map?: boolean; key_name?: string; shadow_anchor_x?: number; shadow_anchor_y?: number }): void
  • Initialize the shadow sprite of this char.

    Parameters

    • group: Group

      the group where the shadow sprite is going to be inserted.

    • Optional options: { is_world_map?: boolean; key_name?: string; shadow_anchor_x?: number; shadow_anchor_y?: number }

      options to be set like anchor values and whether it's a world map.

      • Optional is_world_map?: boolean
      • Optional key_name?: string
      • Optional shadow_anchor_x?: number
      • Optional shadow_anchor_y?: number

    Returns void

  • set_speed(x_speed: number, y_speed: number, apply_speed?: boolean): void
  • set_speed_factors(check_on_event?: boolean, desired_direction?: directions): void
  • Sets the normalized speed factors of the hero.

    Parameters

    • check_on_event: boolean = false

      if true, it will calculate the factors only when not in a tile event.

    • Optional desired_direction: directions

      a desired direction for the hero to go. If not passed, will pick the arrow inputs direction.

    Returns void

  • set_sprite(group: Group, sprite_info: SpriteBase, layer: number, map: Map, anchor_x?: number, anchor_y?: number, scale_x?: number, scale_y?: number, initial_x_px?: number, initial_y_px?: number): void
  • Initializes the char sprite.

    Parameters

    • group: Group

      the group that this is char is going to be inserted.

    • sprite_info: SpriteBase

      the frames and animations information of this char.

    • layer: number

      the collision layer that this char is.

    • map: Map

      the map where this char is going to be in.

    • Optional anchor_x: number

      optional x anchor value of the sprite.

    • Optional anchor_y: number

      optional y anchor value of the sprite.

    • Optional scale_x: number

      optional x scale value of the sprite.

    • Optional scale_y: number

      optional y scale value of the sprite.

    • Optional initial_x_px: number
    • Optional initial_y_px: number

    Returns void

  • set_temporary_speed(x_speed?: number, y_speed?: number): void
  • Sets some temporary speed values. These temporary values are set before collision analysis and may suffer changes on it. After collision analysis, they are indeed applied to actual speed values.

    Parameters

    • Optional x_speed: number

      the x speed value.

    • Optional y_speed: number

      the y speed value.

    Returns void

  • set_trying_to_push_direction(direction: directions): void
  • set_visible(visible: boolean): void
  • Sets the hero visibility.

    Parameters

    • visible: boolean

      whether to be visible or not.

    Returns void

  • shake(options?: { max_scale_mult?: number; repeat_period?: number; repeats_number?: number; side_shake?: boolean }): Promise<void>
  • Shakes this char by changing its scale.

    Parameters

    • Optional options: { max_scale_mult?: number; repeat_period?: number; repeats_number?: number; side_shake?: boolean }
      • Optional max_scale_mult?: number

        Max scale multiplier

      • Optional repeat_period?: number

        Duration of each shake

      • Optional repeats_number?: number

        How many times the char should shake

      • Optional side_shake?: boolean

        If true, the char will shake horizontally

    Returns Promise<void>

  • show_emoticon(emoticon_key: string, options?: { duration?: number; location?: { x?: number; y?: number }; sound_effect?: string }): Promise<Sprite>
  • Shows an emoticon above this char.

    Parameters

    • emoticon_key: string

      The emoticon key name.

    • Optional options: { duration?: number; location?: { x?: number; y?: number }; sound_effect?: string }

      Some custom options.

      • Optional duration?: number

        The duration that this emoticon is going to be shown in ms. -1 for forever.

      • Optional location?: { x?: number; y?: number }

        A custom location for the emoticon.

        • Optional x?: number
        • Optional y?: number
      • Optional sound_effect?: string

        Sound effect key to be played.

    Returns Promise<Sprite>

    returns the emoticon sprite.

  • splash_sweat_drops(times?: number): Promise<void>
  • stop_animation(reset_frame?: boolean): void
  • stop_char(change_sprite?: boolean): void
  • toggle_active(active: boolean): void
  • toggle_collision(enable: boolean): boolean
  • unset_push_timer(): void
  • update(): void
  • update_general_counter(): void
  • Updates the general counter value. General counter is used in recover PP, djinn recover and poison damage.

    Returns void

  • update_half_crop(force?: boolean): void
  • update_movement(ignore_collide_action_change?: boolean): void
  • update_on_event(): void
  • update_shadow(): void
  • update_sweat_drops_position(): void
  • update_tile_position(): void

Generated using TypeDoc