Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Battle

Index

Constructors

  • new Battle(game: Game, data: GoldenSun, background_key: string, enemy_party_key: string, bgm: string, reset_previous_bgm: boolean, before_fade_finish_callback?: ((victory: boolean, all_party_fled: boolean) => Promise<void>), finish_callback?: ((victory: boolean, all_party_fled?: boolean) => void)): Battle
  • Parameters

    • game: Game
    • data: GoldenSun
    • background_key: string
    • enemy_party_key: string
    • bgm: string
    • reset_previous_bgm: boolean
    • Optional before_fade_finish_callback: ((victory: boolean, all_party_fled: boolean) => Promise<void>)
        • (victory: boolean, all_party_fled: boolean): Promise<void>
        • Parameters

          • victory: boolean
          • all_party_fled: boolean

          Returns Promise<void>

    • Optional finish_callback: ((victory: boolean, all_party_fled?: boolean) => void)
        • (victory: boolean, all_party_fled?: boolean): void
        • Parameters

          • victory: boolean
          • Optional all_party_fled: boolean

          Returns void

    Returns Battle

Properties

advance_log_control_key: number
advance_log_resolve: Function
allies_abilities: PlayerAbilities
allies_defeated: boolean
allies_info: PlayerInfo[]
allies_map_sprite: {}

Type declaration

animation_manager: BattleAnimationManager
background_key: string
battle_finishing: boolean
battle_log: BattleLog
battle_menu: MainBattleMenu
battle_phase: number
battle_stage: BattleStage
before_fade_finish_callback: ((victory: boolean, all_party_fled: boolean) => Promise<void>)

Type declaration

    • (victory: boolean, all_party_fled: boolean): Promise<void>
    • Parameters

      • victory: boolean
      • all_party_fled: boolean

      Returns Promise<void>

bgm: string
can_escape: boolean
data: GoldenSun
enemies_abilities: PlayerAbilities
enemies_defeated: boolean
enemies_info: PlayerInfo[]
enemies_map_sprite: {}

Type declaration

enemies_party_name: string
finish_callback: ((victory: boolean, all_party_fled?: boolean) => void)

Type declaration

    • (victory: boolean, all_party_fled?: boolean): void
    • Parameters

      • victory: boolean
      • Optional all_party_fled: boolean

      Returns void

flee_attemps: { allies: number; enemies: number }

Type declaration

  • allies: number
  • enemies: number
game: Game
on_going_effects: Effect[]
party_fled: boolean
previous_bgm: string
previous_map_state: { previously_inactive_io: Set<number>; previously_inactive_npc: Set<number>; previously_not_visible_layers: Set<number> }

Type declaration

  • previously_inactive_io: Set<number>
  • previously_inactive_npc: Set<number>
  • previously_not_visible_layers: Set<number>
reset_previous_bgm: boolean
round_end_effects: { ability: Ability; action: PlayerAbility; effect: any }[]
target_window: ChoosingTargetWindow
this_enemies_list: {}

Type declaration

  • [battle_key: string]: Enemy
turns_actions: PlayerAbility[]
MAX_CHARS_IN_BATTLE: 4 = 4

Methods

  • apply_battle_recovery(party: PlayerInfo[], is_hp_recovery: boolean): Promise<void>
  • apply_item_ability_side_effects(action: PlayerAbility): Promise<void>
  • battle_fadein(): Promise<void>
  • battle_phase_combat(): Promise<void>
  • battle_phase_end(): Promise<void>
  • battle_phase_flee(): Promise<void>
  • battle_phase_menu(): void
  • battle_phase_none(): Promise<void>
  • battle_phase_round_end(): Promise<void>
  • battle_phase_round_start(): Promise<void>
  • can_flee(ally_attempt: boolean): boolean
  • check_if_ability_will_unleash(action: PlayerAbility, ability: Ability, item_name: string): Promise<{ ability: Ability; item_name: string }>
  • check_if_char_is_paralyzed(action: PlayerAbility): Promise<boolean>
  • check_if_curse_will_take_effect(action: PlayerAbility): Promise<boolean>
  • check_parties(): void
  • check_phases(): void
  • choose_targets(ability_key: string, action: string, callback: Function, caster: Player, item_obj?: ItemSlot): void
  • flee(ally_attempt: boolean, enemy_battle_key?: string): Promise<void>
  • initialize_battle_objs(): void
  • setup_battle_sound(): Promise<void>
  • start_battle(): void
  • unset_battle(): void
  • update(): void
  • wait_for_key(): Promise<void>

Generated using TypeDoc