Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MainChar

This class represents a main char of the game, the ones that can be integrated into the party like Isaac, Felix, Jenna, Mia, Garet etc.

Hierarchy

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

  • new MainChar(key_name: any, info: any, sprite_base: any, weapons_sprite_base: any, name: any, hp_curve: any, pp_curve: any, atk_curve: any, def_curve: any, agi_curve: any, luk_curve: any, exp_curve: any, starting_level: any, class_table: any, battle_scale: any, base_level: any, base_power: any, base_resist: any, innate_abilities: any, in_party: any, djinni: any, items: any, battle_animations_variations: any, battle_shadow_key: any, status_sprite_shift: any, special_class_type: any, weapon_sprite_shift: any): MainChar
  • Parameters

    • key_name: any
    • info: any
    • sprite_base: any
    • weapons_sprite_base: any
    • name: any
    • hp_curve: any
    • pp_curve: any
    • atk_curve: any
    • def_curve: any
    • agi_curve: any
    • luk_curve: any
    • exp_curve: any
    • starting_level: any
    • class_table: any
    • battle_scale: any
    • base_level: any
    • base_power: any
    • base_resist: any
    • innate_abilities: any
    • in_party: any
    • djinni: any
    • items: any
    • battle_animations_variations: any
    • battle_shadow_key: any
    • status_sprite_shift: any
    • special_class_type: any
    • weapon_sprite_shift: any

    Returns MainChar

Properties

abilities

abilities: string[]

agi

agi: number

agi_curve

agi_curve: number[]

agi_extra

agi_extra: number

atk

atk: number

atk_curve

atk_curve: number[]

atk_extra

atk_extra: number

base_level

base_level: { all_elements: any; jupiter: any; mars: any; mercury: any; no_element: any; venus: any }

Type declaration

base_power

base_power: { all_elements: any; jupiter: any; mars: any; mercury: any; no_element: any; venus: any }

Type declaration

base_resist

base_resist: { all_elements: any; jupiter: any; mars: any; mercury: any; no_element: any; venus: any }

Type declaration

battle_animations_variations

battle_animations_variations: {}

Type declaration

  • [ability_key: string]: string

battle_scale

battle_scale: number

battle_shadow_key

battle_shadow_key: string

class

class: Classes

class_table

class_table: any

current_exp

current_exp: number

current_hp

current_hp: number

current_level

current_level: { all_elements: any; jupiter: any; mars: any; mercury: any; no_element: any; venus: any }

Type declaration

current_power

current_power: { all_elements: any; jupiter: any; mars: any; mercury: any; no_element: any; venus: any }

Type declaration

current_pp

current_pp: number

current_resist

current_resist: { all_elements: any; jupiter: any; mars: any; mercury: any; no_element: any; venus: any }

Type declaration

def

def: number

def_curve

def_curve: number[]

def_extra

def_extra: number

djinn_by_element

djinn_by_element: { all_elements: any; jupiter: any; mars: any; mercury: any; no_element: any; venus: any }

Type declaration

effect_turns_count

effect_turns_count: {}

Type declaration

  • [effect: string]: number | {}

effects

effects: Effect[]

element_afinity

element_afinity: elements

equip_slots

equip_slots: { body: any; boots: any; chest: any; class_changer: any; head: any; ring: any; underwear: any; weapon: any }

Type declaration

equipped_abilities

equipped_abilities: string[]

exp_curve

exp_curve: number[]

fighter_type

fighter_type: fighter_types

hp_curve

hp_curve: number[]

hp_extra

hp_extra: number

hp_recovery

hp_recovery: number

in_party

in_party: boolean

info

info: GameInfo

innate_abilities

innate_abilities: string[]

items

items: ItemSlot[]

key_name

key_name: string

level

level: number

luk

luk: number

luk_curve

luk_curve: number[]

luk_extra

luk_extra: number

max_hp

max_hp: number

max_pp

max_pp: number

name

name: string

on_status_change

on_status_change: Subject<{ added: boolean; status: DOWNED | POISON | VENOM | EQUIP_CURSE | HAUNT | DELUSION | STUN | SLEEP | SEAL | DEATH_CURSE }>

paralyzed_by_effect

paralyzed_by_effect: boolean

permanent_status

permanent_status: Set<permanent_status>

pp_curve

pp_curve: number[]

pp_extra

pp_extra: number

pp_recovery

pp_recovery: number

special_class_type

special_class_type: number

sprite_base

sprite_base: SpriteBase

starting_level

starting_level: number

status_sprite_shift

status_sprite_shift: number

temporary_status

temporary_status: Set<temporary_status>

turns

turns: number

weapon_sprite_shift

weapon_sprite_shift: number

weapons_sprite_base

weapons_sprite_base: SpriteBase

Static Private Readonly ELEM_LV_DELTA

ELEM_LV_DELTA: 1 = 1

Static Private Readonly ELEM_POWER_DELTA

ELEM_POWER_DELTA: 5 = 5

Static Private Readonly ELEM_RESIST_DELTA

ELEM_RESIST_DELTA: 5 = 5

Static Readonly MAX_ITEMS_PER_CHAR

MAX_ITEMS_PER_CHAR: 30 = 30

Accessors

djinni

  • get djinni(): string[]
  • Returns a list of djinn sorted by djinn index that this char owns.

    Returns string[]

granted_class_type

  • get granted_class_type(): number
  • If this char is equipping an item that changes his class, this function returns the class type of the class that this item grants. If no class changer item is equipped, returns -1.

    Returns number

Methods

add_djinn

  • add_djinn(djinn_key_name: string): void
  • Adds a specific djinn to this char and do all the necessary attribute updates.

    Parameters

    • djinn_key_name: string

      The djinn key name.

    Returns void

add_effect

  • add_effect(effect_obj: any, effect_owner_instance: Ability | Item, apply?: boolean): { changes: { after?: number; all_elements?: boolean; before?: number; removed_effects?: Effect[] }; effect: Effect }
  • Parameters

    • effect_obj: any
    • effect_owner_instance: Ability | Item
    • apply: boolean = false

    Returns { changes: { after?: number; all_elements?: boolean; before?: number; removed_effects?: Effect[] }; effect: Effect }

    • changes: { after?: number; all_elements?: boolean; before?: number; removed_effects?: Effect[] }
      • Optional after?: number
      • Optional all_elements?: boolean
      • Optional before?: number
      • Optional removed_effects?: Effect[]
    • effect: Effect

add_exp

  • add_exp(value: number): { after: StatusType; before: StatusType }
  • Adds an amount of experience to this char. This char level, class, abilities and attributes are also updated if needed.

    Parameters

    • value: number

      the amount of experience to add.

    Returns { after: StatusType; before: StatusType }

    returns the before and after exp add char status, like level, abilities and stats.

    • after: StatusType
    • before: StatusType

add_extra_stat

  • add_extra_stat(stat: extra_main_stats, amount: number, update?: boolean): void
  • Increments by a value a given extra main stat of this char.

    Parameters

    • stat: extra_main_stats

      the extra main stat.

    • amount: number

      the quantity to increment.

    • update: boolean = true

      whether the char correspondent main stat should be updated.

    Returns void

add_item

  • add_item(item_key_name: string, quantity: number, equip: boolean): void
  • Adds an item to this char. If this char already has the given item, this function will just increase this item quantity.

    Parameters

    • item_key_name: string

      The item key name.

    • quantity: number

      The amount of this item to add.

    • equip: boolean

      if true, this item will be equipped.

    Returns void

add_permanent_status

add_temporary_status

equip_item

  • equip_item(index: number, initialize?: boolean): void
  • Equips an item to this char. This char must already own the item. After equipping, all relevant updates are done like abilities, class, attributes, effects etc.

    Parameters

    • index: number

      the item slot index of this char.

    • initialize: boolean = false

      only sets this to true if constructing this char.

    Returns void

get_effect_turns_count

  • get_effect_turns_count(effect: Effect): any

get_effect_turns_key

  • get_effect_turns_key(effect: Effect): string

has_permanent_status

has_temporary_status

Private init_djinni

  • init_djinni(djinni: string[]): void
  • Initializes this char djinn list and updates this char elemental attributes. Call this function when constructing a char.

    Parameters

    • djinni: string[]

      list of initial djinn key names.

    Returns void

init_effect_turns_count

  • init_effect_turns_count(): void

Private init_items

  • init_items(): void
  • Initializes this char items by equipping them.

    Returns void

is_paralyzed

  • is_paralyzed(include_downed?: boolean, exclude_no_downed_anim?: boolean): boolean
  • Parameters

    • include_downed: boolean = false
    • exclude_no_downed_anim: boolean = false

    Returns boolean

is_poisoned

preview_djinn_change

  • preview_djinn_change(stats: main_stats[], djinni_key_names: string[], djinni_next_status: djinn_status[], action?: djinn_actions): { abilities?: string[]; class_key_name: string; class_name: string } & { agi: any; atk: any; current_hp: any; current_pp: any; def: any; luk: any; max_hp: any; max_pp: any }
  • Previews the changes of trading, giving, receiving and/or changing the status of a list of djinn. These changes are in class, abilities and stats.

    Parameters

    • stats: main_stats[]

      The stats the you want to analyze.

    • djinni_key_names: string[]

      The djinn key names.

    • djinni_next_status: djinn_status[]

      The next djinn status. Must match with djinni_key_names size.

    • Optional action: djinn_actions

      Whether it's trading or giving a djinn.

    Returns { abilities?: string[]; class_key_name: string; class_name: string } & { agi: any; atk: any; current_hp: any; current_pp: any; def: any; luk: any; max_hp: any; max_pp: any }

    Returns an object with the changes info.

preview_elemental_stats_without_abilities_effect

  • preview_elemental_stats_without_abilities_effect(): { all_elements: any; jupiter: any; mars: any; mercury: any; no_element: any; venus: any }
  • Previews the elemental stats values without abilities effects.

    Returns { all_elements: any; jupiter: any; mars: any; mercury: any; no_element: any; venus: any }

    returns the preview values for power, resist and level for each element.

preview_stat_without_abilities_effect

  • preview_stat_without_abilities_effect(stat: main_stats): number
  • Previews a stat value by ignoring all abilities effects.

    Parameters

    Returns number

    returns the stat preview value.

preview_stats_without_item_effect

  • preview_stats_without_item_effect(effect_type: effect_types, effect_obj: any, item_key_name: string): number
  • Previews a stat value without the given effect of an item.

    Parameters

    • effect_type: effect_types

      the effect type.

    • effect_obj: any

      the item effect object.

    • item_key_name: string

      the item key name.

    Returns number

    returns the corresponding stat preview value of the given effect.

remove_djinn

  • remove_djinn(djinn_key_name: string): void
  • Removes a specific djinn to this char and do all the necessary attribute updates.

    Parameters

    • djinn_key_name: string

      The djinn key name.

    Returns void

remove_effect

  • remove_effect(effect_to_remove: Effect, apply?: boolean): void

remove_item

  • remove_item(item_obj_to_remove: ItemSlot, quantity: number): void
  • Removes/drops an item from this char. If the item is equipped, it will be unequipped. If the given quantity is smaller than the current quantity, the item slot for the given item will be kept.

    Parameters

    • item_obj_to_remove: ItemSlot
    • quantity: number

    Returns void

remove_permanent_status

remove_temporary_status

replace_djinn

  • replace_djinn(old_djinn_key_name: string, new_djinn_key_name: string): void
  • Removes a specific djinni, then adds another specific djinni.

    Parameters

    • old_djinn_key_name: string

      The key name of the djinni to be removed.

    • new_djinn_key_name: string

      The key name of the djinni to be addeed.

    Returns void

set_effect_turns_count

  • set_effect_turns_count(effect: any, value?: number, relative?: boolean): any

Private set_main_stat

  • set_main_stat(stat: main_stats, preview?: boolean, preview_obj?: { action?: djinn_actions; djinni_key_names?: string[]; djinni_next_status?: djinn_status[]; effect_obj?: any; ignore_ability_effect?: boolean; item_key_name?: string }): number
  • Parameters

    • stat: main_stats
    • preview: boolean = false
    • preview_obj: { action?: djinn_actions; djinni_key_names?: string[]; djinni_next_status?: djinn_status[]; effect_obj?: any; ignore_ability_effect?: boolean; item_key_name?: string } = {}
      • Optional action?: djinn_actions
      • Optional djinni_key_names?: string[]
      • Optional djinni_next_status?: djinn_status[]
      • Optional effect_obj?: any
      • Optional ignore_ability_effect?: boolean
      • Optional item_key_name?: string

    Returns number

unequip_item

  • unequip_item(index: number): void
  • Unequips an item to this char. After unequipping, all relevant updates are done like abilities, class, attributes, effects etc.

    Parameters

    • index: number

      the item slot index of this char.

    Returns void

update_abilities

  • update_abilities(): void
  • Updates the abilities list of this char reggarding class, inate abilities and equipped items that grant abilities.

    Returns void

update_all

  • update_all(): void

update_attributes

  • update_attributes(): void
  • Updates all main stats of this char.

    Returns void

update_class

  • update_class(): void

update_elemental_attributes

  • update_elemental_attributes(preview?: boolean, ignore_ability_effects?: boolean): { all_elements: any; jupiter: any; mars: any; mercury: any; no_element: any; venus: any }
  • Updates all elemental stats of this char.

    Parameters

    • preview: boolean = false

      if true, the stats won't be updated and the calculated values returned.

    • ignore_ability_effects: boolean = false

      if true, abilities effects won't be considered.

    Returns { all_elements: any; jupiter: any; mars: any; mercury: any; no_element: any; venus: any }

    if preview is true, it returns the calculated stats.

Static add_djinn_to_party

  • Adds a djinni to the first available position among all party members.

    Parameters

    • party_data: PartyData

      the party data object.

    • djinn: Djinn

      the djinn to be added.

    Returns MainChar

    returns the char that received the djinni.

Static add_item_to_party

  • add_item_to_party(party_data: PartyData, item: Item, quantity: number): boolean
  • Adds an item to the first item slot available among all party members.

    Parameters

    • party_data: PartyData

      the party data object.

    • item: Item

      the item to be added.

    • quantity: number

      the amount of the given item to be added.

    Returns boolean

    returns true if the item was added to a char.

Static add_member_to_party

  • Adds a char to the party.

    Parameters

    Returns void

Static get_active_players

  • Returns all the chars that are not downed.

    Parameters

    • party_data: PartyData

      the party data object.

    • max: number

      the max char to be returned.

    Returns MainChar[]

    return the chars list that are not downed.

Static remove_member_from_party

  • Removes a char from the party.

    Parameters

    • party_data: PartyData

      the party data object.

    • char: MainChar

      the char to be removed.

    Returns void

Generated using TypeDoc