Class: PFM::Pokemon

Inherits:
Object show all
Defined in:
scripts/01200 PFM/00300 Pokemon/00001 Initialize.rb,
scripts/01200 PFM/00300 Pokemon/00002 Properties.rb,
scripts/01200 PFM/00300 Pokemon/00300 Pokemon EV.rb,
scripts/01200 PFM/00300 Pokemon/00003 Deprecatable.rb,
scripts/01200 PFM/00300 Pokemon/01100 Pokemon Text.rb,
scripts/01200 PFM/00300 Pokemon/00500 Pokemon Forms.rb,
scripts/01200 PFM/00300 Pokemon/00700 Pokemon Stats.rb,
scripts/01200 PFM/00300 Pokemon/00900 Pokemon Types.rb,
scripts/01200 PFM/00300 Pokemon/00600 Pokemon Skills.rb,
scripts/01200 PFM/00300 Pokemon/00800 Pokemon Status.rb,
scripts/01400 GamePlay/00700 Pokemon Scenes/09000 GTS.rb,
scripts/01200 PFM/00300 Pokemon/00200 Pokemon Graphics.rb,
scripts/01200 PFM/00300 Pokemon/00400 Pokemon exp & evolve.rb,
scripts/01200 PFM/00300 Pokemon/01000 Pokemon Params (generate).rb

Overview

Add a game_code field and to_s method to the pokemon class

Constant Summary collapse

ABILITY_CHANCES =

List of chance to get a specific ability on Pokemon generation

[49, 98, 100]
FLAG_UNKOWN_USE =

Unknown flag (should always be up in Pokemon)

0x0080_0000
FLAG_FROM_THIS_GAME =

Flag telling the Pokemon comes from this game (this fangame)

0x0040_0000
FLAG_CAUGHT_BY_PLAYER =

Flag telling the Pokemon has been caught by the player

0x0020_0000
FLAG_PRESENT_TIME =

Flag telling the Pokemon comes from present time (used to distinguish pokemon imported from previous games)

0x0010_0000
Shiny_IV =

Flag that tells the Pokemon object to generate Shiny with IV starting at 15

false
FORM_CALIBRATE =
{}
FORM_GENERATION =
{}
ArceusItem =

List of items (in the form index order) that change the form of Arceus

%i[__undef__ flame_plate splash_plate zap_plate meadow_plate
icicle_plate fist_plate toxic_plate earth_plate sky_plate
mind_plate insect_plate stone_plate spooky_plate draco_plate
iron_plate dread_plate pixie_plate]
GenesectModules =

List of items (in the form index order) that change the form of Genesect

%i[__undef__ burn_drive chill_drive douse_drive shock_drive]
SilvallyROM =

List of item (in the form index oreder) that change the form of Silvally

%i[__undef__ fighting_memory flying_memory poison_memory
ground_memory rock_memory bug_memory ghost_memory steel_memory
__undef__ fire_memory water_memory grass_memory electric_memory
psychic_memory ice_memory dragon_memory dark_memory fairy_memory]
Paralyze_Check_Rate =

Paralyze check rate that prevent the Pokemon from using a move

0.25
Paralyze_check_rate =

Paralyz check rate that prevent the Pokemon from using a move (in %)

(100*Paralyze_Check_Rate).to_i
Froze_Check_Rate =

Rate the Pokemon can be unfreeze

0.1
Froze_check_rate =

Rate the Pokemon can be unfreeze in %

(100*Froze_Check_Rate).to_i
EGG_NAME_ID =

Name of the EGG image used as image when it's using the ID of the Pokemon

'egg_%03d'
EGG_NAME =

Name of the generic EGG image

'egg'
FEMALE_NAME_FORM =

Name of the form female battler

'%03df_%02d'
FEMALE_NAME =

Name of the female battler

'%03df'
MALE_NAME_FORM =

Name of the form Male battler

'%03d_%02d'
MALE_NAME =

Name of the Male battler

'%03d'
SHINY_NAME =

Name of the Shiny

'%03ds'
SHINY_FEMALE_NAME =

Name of the Shiny female

'%03dfs'
SHINY_NAME_FORM =

Name of the Shiny form

'%03ds_%02d'
SHINY_FEMALE_NAME_FORM =

Name of the Shiny female form

'%03dfs_%02d'
BATTLER_SIZE =

Size of a battler

96
ICON_SIZE =

Size of an icon

32
FOOT_SIZE =

Size of a footprint

16
EVOLVE_ON_FORM0 =

Tell if PSDK test evolve on form 0 or the current form

PSDK_CONFIG.always_use_form0_for_evolution
SPECIAL_EVOLUTION_ID =

List of key in evolution Hash that corresponds to the expected ID when evolution is valid

Returns:

  • (Array<Symbol>)
%i[trade id]
G_ID =

PSP 0.7 ID Hash key

'ID'
G_NV =

PSP 0.7 level Hash key

'NV'
G_OBJ =

PSP 0.7 item hash key

'OBJ'
G_STAT =

PSP 0.7 stat hash key

'STAT'
G_MOVE =

PSP 0.7 move hash key

'MOVE'
G_GR =

PSP 0.7 gender hash key

'GR'
G_FORM =

PSP 0.7 form hash key

'FORM'
G_SHINY =

PSP 0.7 shiny hash key

'SHINY'

Class Attribute Summary collapse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, level, force_shiny = false, no_shiny = false, form = -1,, opts = {}) ⇒ Pokemon

Create a new Pokemon with specific parameters

Parameters:

  • id (Integer, Symbol)

    ID of the Pokemon in the database

  • level (Integer)

    level of the Pokemon

  • force_shiny (Boolean) (defaults to: false)

    if the Pokemon have 100% chance to be shiny

  • no_shiny (Boolean) (defaults to: false)

    if the Pokemon have 0% chance to be shiny (override force_shiny)

  • form (Integer) (defaults to: -1,)

    Form index of the Pokemon (-1 = automatic generation)

  • opts (Hash) (defaults to: {})

    Hash describing optional value you want to assign to the Pokemon

Options Hash (opts):

  • :given_name (String)

    Nickname of the Pokemon

  • :captured_with (Integer, Symbol)

    ID of the ball used to catch the Pokemon

  • :captured_in (Integer)

    ID of the zone where the Pokemon was caught

  • :captured_at (Integer, Time)

    Time when the Pokemon was caught

  • :captured_level (Integer)

    Level of the Pokemon when it was caught

  • :egg_in (Integer)

    ID of the zone where the egg was layed/found

  • :egg_at (Integer, Time)

    Time when the egg was layed/found

  • :gender (Integer, String)

    Forced gender of the Pokemon

  • :nature (Integer)

    Nature of the Pokemon

  • :stats (Array<Integer>)

    IV array ([hp, atk, dfe, spd, ats, dfs])

  • :bonus (Array<Integer>)

    EV array ([hp, atk, dfe, spd, ats, dfs])

  • :item (Integer, Symbol)

    ID of the item the Pokemon is holding

  • :ability (Integer, Symbol)

    ID of the ability the Pokemon has

  • :rareness (Integer)

    Rareness of the Pokemon (0 = not catchable, 255 = always catchable)

  • :loyalty (Integer)

    Happiness of the Pokemon

  • :moves (Array<Integer, Symbol>)

    Current Moves of the Pokemon (0 = default)

  • :memo_text (Array(Integer, Integer))

    Text used for the memo ([file_id, text_id])

  • :trainer_name (String)

    Name of the trainer that caught / got the Pokemon

  • :trainer_id (Integer)

    ID of the trainer that caught / got the Pokemon

Class Attribute Details

.evolution_criteriaHash{ Symbol => Proc } (readonly)

List of evolution criteria

Returns:

  • (Hash{ Symbol => Proc })

Instance Attribute Details

#abilityInteger

Return the current ability of the Pokemon

Returns:

#ability_currentInteger

ID of the ability the Pokemon has in battle

Returns:

#ability_indexInteger?

Index of the ability in the Pokemon data

Returns:

#ability_usedBoolean

If the Truant (Absenteisme) ability has been “used”

Returns:

  • (Boolean)

#attack_orderInteger

Attack order value tells when the Pokemon attacks (used to test if attack before another pokemon)

Returns:

#battle_effectPokemon_Effect

Return the battle effect of the Pokemon or the default battle effect

Returns:

  • (Pokemon_Effect)

#battle_itemInteger?

ID of the item the Pokemon is holding in battle

Returns:

#battle_item_dataArray?

Various data information of the item during battle

Returns:

  • (Array, nil)

#battle_stageArray(Integer, Integer, Integer, Integer, Integer, Integer, Integer)

The battle Stage of the Pokemon [atk, dfe, spd, ats, dfs, eva, acc]

#battle_turnsInteger

Number of turn the Pokemon has fought

Returns:

#captured_atInteger

Time when the Pokemon was captured (in seconds from jan 1970)

Returns:

#captured_inInteger

Zone (id) where the Pokemon was captured mixed with the Gemme 4.0 Flag

Returns:

#captured_levelInteger

Level of the Pokemon when the Pokemon was caught

Returns:

#captured_withInteger

ID of the item used to catch the Pokemon

Returns:

#characterString

Character filename of the Pokemon (FollowMe optimizations)

Returns:

#codeInteger

Code of the pokemon

Returns:

#confuseBoolean

If the pokemon is confused

Returns:

  • (Boolean)

#critical_modifierInteger

The Pokemon critical modifier (always 0 but usable for scenaristic reasons…)

Returns:

#egg_atInteger

Time when the Egg has been obtained

Returns:

#egg_inInteger

Zone (id) where the Egg has been obtained

Returns:

#ev_atkInteger

ATK Effort Value

Returns:

#ev_atsInteger

ATS Effort Value

Returns:

#ev_dfeInteger

DFE Effort Value

Returns:

#ev_dfsInteger

DFS Effort Value

Returns:

#ev_hpInteger

HP Effort Value

Returns:

#ev_spdInteger

SPD Effort Value

Returns:

#expInteger

The total amount of exp the Pokemon got

Returns:

#exp_rateFloat

The rate of exp point the Pokemon has in its level

Returns:

  • (Float)

#formInteger

Form Index of the Pokemon, ex: Unkown A = 0, Unkown Z = 25

Returns:

#game_codeInteger?

Code of the game where the Pokemon comes from (nil if the Pokemon hasn't been tainted by GTS system)

Returns:

#genderInteger

Gender of the Pokemon : 0 = no gender, 1 = male, 2 = female

Returns:

#given_nameString Also known as: nickname

Return the given name of the Pokemon (Pokedex name if no given name)

Returns:

#hpInteger

The current HP the Pokemon has

Returns:

#hp_rateFloat

The rate of HP the Pokemon has

Returns:

  • (Float)

#idInteger

ID of the Pokemon in the database

Returns:

#item_holdingInteger

ID of the item the Pokemon is holding

Returns:

#iv_atkInteger

ATK Individual Value

Returns:

#iv_atsInteger

ATS Individual Value

Returns:

#iv_dfeInteger

DFE Individual Value

Returns:

#iv_dfsInteger

DFS Individual Value

Returns:

#iv_hpInteger

HP Individual Value

Returns:

#iv_spdInteger

SPD Individual Value

Returns:

#last_skillInteger

Last skill ID used in battle

Returns:

#levelInteger

Current Level of the Pokemon

Returns:

#loyaltyInteger

Happiness/loyalty of the Pokemon (0 no bonds, 255 full bonds)

Returns:

#memo_textArray<Integer>

Memo text [file_id, text_id]

Returns:

#natureArray<Integer>

Return the nature data of the Pokemon

Returns:

  • (Array<Integer>)
    text_id, atk%, dfe%, spd%, ats%, dfs%

#positionInteger?

The position in the Battle, > 0 = actor, < 0 = enemy (index = -position-1), nil = not fighting

Returns:

#prepared_skillInteger

ID of the skill the Pokemon would like to use

Returns:

#ribbonsArray<Integer>

List of Ribbon ID the Pokemon got

Returns:

#skill_learntArray<Integer> (readonly)

List of Skill id the Pokemon learnt during its life

Returns:

#skill_use_timesInteger

Number of times the last skill was used

Returns:

#skills_setArray<PFM::Skill> Also known as: moveset

The current moveset of the Pokemon

Returns:

#statusInteger

ID of the status of the Pokemon

Returns:

#status_countInteger

Internal status counter that helps some status to terminate or worsen

Returns:

#step_remainingInteger

Number of step before the egg hatch (thus the Pokemon is an egg)

Returns:

#sub_codeInteger?

Real code of the Pokemon when used transform (needed to test if roaming pokemon is ditto)

Returns:

#sub_formInteger?

Real form index of the Pokemon when used transform (needed to test if roaming pokemon is ditto)

Returns:

#sub_idInteger?

Real id of the Pokemon when used transform

Returns:

#trainer_idInteger

Return the normalized trainer id of the Pokemon

Returns:

#trainer_nameString

Name of the original trainer

Returns:

#type1Integer

Return the current first type of the Pokemon

Returns:

#type2Integer

Return the current second type of the Pokemon

Returns:

#type3Integer

Return the current third type of the Pokemon

Returns:

Class Method Details

.add_evolution_criteria(key, &block)

Add a new evolution criteria

Parameters:

  • key (Symbol)

    hash key expected in special evolution

  • block (Proc)

    executed proc for special evolution test, will receive : value, extend_data, reason

.back_filename(id, form, female, shiny, egg) ⇒ String

Return the back battle of the Pokemon

Parameters:

  • id (Integer)

    ID of the Pokemon

  • form (Integer)

    form index of the Pokemon

  • female (Boolean)

    if the Pokemon is a female

  • shiny (Boolean)

    shiny state of the Pokemon

  • egg (Boolean)

    egg state of the Pokemon

Returns:

.front_filename(id, form, female, shiny, egg) ⇒ String

Return the front battler name

Parameters:

  • id (Integer)

    ID of the Pokemon

  • form (Integer)

    form index of the Pokemon

  • female (Boolean)

    if the Pokemon is a female

  • shiny (Boolean)

    shiny state of the Pokemon

  • egg (Boolean)

    egg state of the Pokemon

Returns:

.generate_from_hash(hash) ⇒ PFM::Pokemon

Generate a Pokemon from a hash

Parameters:

  • hash (Hash)

    Hash describing optional value you want to assign to the Pokemon

Options Hash (hash):

  • :id (Integer, Symbol)

    ID of the Pokemon

  • :level (Integer)

    level of the Pokemon

  • :shiny (Boolean)

    if the pokemon will be shiny

  • :no_shiny (Boolean)

    if the pokemon will never be shiny

  • :form (Integer)

    form index of the Pokemon

  • :given_name (String)

    Nickname of the Pokemon

  • :captured_with (Integer, Symbol)

    ID of the ball used to catch the Pokemon

  • :captured_in (Integer)

    ID of the zone where the Pokemon was caught

  • :captured_at (Integer, Time)

    Time when the Pokemon was caught

  • :captured_level (Integer)

    Level of the Pokemon when it was caught

  • :egg_in (Integer)

    ID of the zone where the egg was layed/found

  • :egg_at (Integer, Time)

    Time when the egg was layed/found

  • :gender (Integer, String)

    Forced gender of the Pokemon

  • :nature (Integer)

    Nature of the Pokemon

  • :stats (Array<Integer>)

    IV array ([hp, atk, dfe, spd, ats, dfs])

  • :bonus (Array<Integer>)

    EV array ([hp, atk, dfe, spd, ats, dfs])

  • :item (Integer, Symbol)

    ID of the item the Pokemon is holding

  • :ability (Integer, Symbol)

    ID of the ability the Pokemon has

  • :rareness (Integer)

    Rareness of the Pokemon (0 = not catchable, 255 = always catchable)

  • :loyalty (Integer)

    Happiness of the Pokemon

  • :moves (Array<Integer, Symbol>)

    Current Moves of the Pokemon (0 = default)

  • :memo_text (Array(Integer, Integer))

    Text used for the memo ([file_id, text_id])

  • :trainer_name (String)

    Name of the trainer that caught / got the Pokemon

  • :trainer_id (Integer)

    ID of the trainer that caught / got the Pokemon

Returns:

.icon_filename(id, form, female, shiny, egg) ⇒ String

Icon filename of a Pokemon

Parameters:

  • id (Integer)

    ID of the Pokemon

  • form (Integer)

    form index of the Pokemon

  • female (Boolean)

    if the Pokemon is a female

  • shiny (Boolean)

    shiny state of the Pokemon

  • egg (Boolean)

    egg state of the Pokemon

Returns:

Instance Method Details

#ability_db_symbolSymbol

Return the db_symbol of the Pokemon's Ability

Returns:

  • (Symbol)

#ability_descrString

Reture the description of the current ability of the Pokemon

Returns:

#ability_nameString

Return the name of the current ability of the Pokemon

Returns:

#acc_stageInteger

Return the accuracy stage

Returns:

#add_bonus(list) ⇒ Boolean?

Add ev bonus to a Pokemon (with item interaction : x2)

Parameters:

  • list (Array<Integer>)

    an ev list : [hp, atk, dfe, spd, ats, dfs]

Returns:

  • (Boolean, nil)

    if the ev had totally been added or not (nil = couldn't be added at all)

#add_ev_atk(n, evs) ⇒ Boolean

Safely add ATK EV

Parameters:

Returns:

  • (Boolean)

    if the ev has successfully been added

#add_ev_ats(n, evs) ⇒ Boolean

Safely add ATS EV

Parameters:

Returns:

  • (Boolean)

    if the ev has successfully been added

#add_ev_dfe(n, evs) ⇒ Boolean

Safely add DFE EV

Parameters:

Returns:

  • (Boolean)

    if the ev has successfully been added

#add_ev_dfs(n, evs) ⇒ Boolean

Safely add DFS EV

Parameters:

Returns:

  • (Boolean)

    if the ev has successfully been added

#add_ev_hp(n, evs) ⇒ Boolean

Safely add HP EV

Parameters:

Returns:

  • (Boolean)

    if the ev has successfully been added

#add_ev_spd(n, evs) ⇒ Boolean

Safely add SPD EV

Parameters:

Returns:

  • (Boolean)

    if the ev has successfully been added

#add_ribbon(id)

Add a ribbon to the Pokemon

Parameters:

  • id (Integer)

    ID of the ribbon (in the ribbon text file)

#alive?Boolean

Is the Pokemon able to fight

Returns:

  • (Boolean)

#asleep?Boolean

Is the Pokemon asleep?

Returns:

  • (Boolean)

#atkInteger

Return the current atk

Returns:

#atk_basisInteger

Return the atk stat without battle modifier

Returns:

#atk_modifierFloat

Return the atk modifier

Returns:

  • (Float)

    the multiplier

#atk_stageInteger

Return the atk stage

Returns:

#atsInteger

Return the current ats

Returns:

#ats_basisInteger

Return the ats stat without battle modifier

Returns:

#ats_modifierFloat

Return the ats modifier

Returns:

  • (Float)

    the multiplier

#ats_stageInteger

Return the ats stage

Returns:

#ball_colorColor

Return the ball color of the Pokemon (flash)

Returns:

  • (Color)

#ball_imageBitmap

Return the ball image of the Pokemon

Returns:

  • (Bitmap)

#ball_spriteString

Return the ball sprite name of the Pokemon

Returns:

  • (String)

    Sprite to load in Graphics/ball/

#base_atkInteger

Return the base ATK

Returns:

#base_atsInteger

Return the base ATS

Returns:

#base_dfeInteger

Return the base DFE

Returns:

#base_dfsInteger

Return the base DFS

Returns:

#base_expInteger

Return the base experience of the Pokemon

Returns:

#base_hpInteger

Return the base HP

Returns:

#base_spdInteger

Return the base SPD

Returns:

#battle_listArray<Integer>

Return the list of EV the pokemon gives when beaten

Returns:

  • (Array<Integer>)

    ev list (used in bonus functions) : [hp, atk, dfe, spd, ats, dfs]

#battler_backBitmap

Return the back battle of the Pokemon

Returns:

  • (Bitmap)

#battler_faceBitmap Also known as: battler_front

Return the front battler of the Pokemon

Returns:

  • (Bitmap)

#breed_groupArray(Integer, Integer)

Return the breed groups of the Pokemon

Returns:

#breed_moveArray<Integer>

Return the breed moves of the Pokemon (list of skill ID)

Returns:

#burn?Boolean Also known as: burnt?

Is the Pokemon burnt?

Returns:

  • (Boolean)

#burn_effectInteger

Return the burn effect on HP of the Pokemon

Returns:

  • (Integer)

    number of HP loosen by burn

#can_be_asleep?Boolean

Can the Pokemon be asleep?

Returns:

  • (Boolean)

#can_be_burn?Boolean

Can the Pokemon be burnt?

Returns:

  • (Boolean)

#can_be_frozen?(skill_type = 0) ⇒ Boolean

Can the Pokemon be frozen?

Returns:

  • (Boolean)

#can_be_paralyzed?Boolean

Can the Pokemon be paralyzed?

Returns:

  • (Boolean)

#can_be_poisoned?Boolean

Can the Pokemon be poisoned ?

Returns:

  • (Boolean)

#can_learn?(skill_id) ⇒ Boolean?

Check if the Pokemon can learn a skill

Parameters:

  • skill_id (Integer, Symbol)

    id of the skill in the database

Returns:

  • (Boolean, nil)

    nil = learnt, false = cannot learn, true = can learn

#can_mega_evolve?Integer, false

Check if the Pokemon can mega evolve

Returns:

  • (Integer, false)

    form index if the Pokemon can mega evolve, false otherwise

#captured_zone_nameString

Return the name of the zone where the Pokemon has been caught

Returns:

#caught_by_player?Boolean

Tell if the Pokemon is caught by the trainer

Returns:

  • (Boolean)

#change_acc(amount) ⇒ Integer

Change the acc stage

Parameters:

  • amount (Integer)

    the amount to change on the stat stage

Returns:

  • (Integer)

    the difference between the current and the last stage value

#change_atk(amount) ⇒ Integer

Change the atk stage

Parameters:

  • amount (Integer)

    the amount to change on the stat stage

Returns:

  • (Integer)

    the difference between the current and the last stage value

#change_ats(amount) ⇒ Integer

Change the ats stage

Parameters:

  • amount (Integer)

    the amount to change on the stat stage

Returns:

  • (Integer)

    the difference between the current and the last stage value

#change_dfe(amount) ⇒ Integer

Change the dfe stage

Parameters:

  • amount (Integer)

    the amount to change on the stat stage

Returns:

  • (Integer)

    the difference between the current and the last stage value

#change_dfs(amount) ⇒ Integer

Change the dfs stage

Parameters:

  • amount (Integer)

    the amount to change on the stat stage

Returns:

  • (Integer)

    the difference between the current and the last stage value

#change_eva(amount) ⇒ Integer

Change the eva stage

Parameters:

  • amount (Integer)

    the amount to change on the stat stage

Returns:

  • (Integer)

    the difference between the current and the last stage value

#change_spd(amount) ⇒ Integer

Change the spd stage

Parameters:

  • amount (Integer)

    the amount to change on the stat stage

Returns:

  • (Integer)

    the difference between the current and the last stage value

#change_stat(stat_id, amount) ⇒ Integer

Change a stat stage

Parameters:

  • stat_id (Integer)

    id of the stat : 0 = atk, 1 = dfe, 2 = spd, 3 = ats, 4 = dfs, 5 = eva, 6 = acc

  • amount (Integer)

    the amount to change on the stat stage

Returns:

  • (Integer)

    the difference between the current and the last stage value

#character_nameString

Return the character name of the Pokemon

Returns:

#check_skill_and_learn(silent = false, level = @level)

Check if the Pokemon can learn a new skill and make it learn the skill

Parameters:

  • silent (Boolean) (defaults to: false)

    if the skill is automatically learnt or not (false = show skill learn interface & messages)

  • level (Integer) (defaults to: @level)

    The level to check in order to learn the moves

#confuse_checkBoolean, :cured

Check if the Pokemon is still confused

Returns:

  • (Boolean, :cured)

    true = get confuse damage, :cured = not confuse anymore

#confuse_damageInteger

Return the amount of damage the Pokemon receive from confusion

Returns:

#confused?Boolean

Is the Pokemon confused?

Returns:

  • (Boolean)

#convert_skill(id_old, id_new) ⇒ Boolean?

Deprecated.

Never used.

Replace a skill to an other skill

Parameters:

  • id_old (Integer, Symbol)

    id of the old skill

  • id_new (Integer, Symbol)

    id of the new skill

Returns:

  • (Boolean, nil)

    false = id_new found in the skills, nil = id_old not found, true = skill replaced

#cryString

Return the cry file name of the Pokemon

Returns:

#cure

Cure the Pokemon from its statues modifications

#current_deerling_formInteger

Calculate the form of deerling & sawsbuck

Returns:

#data Also known as: get_data

Get the current data of the Pokemon

#db_symbolSymbol

Return the db_symbol of the Pokemon in the database

Returns:

  • (Symbol)

#dead?Boolean

Is the Pokemon not able to fight

Returns:

  • (Boolean)

#dfeInteger

Return the current dfe

Returns:

#dfe_basisInteger

Return the dfe stat without battle modifier

Returns:

#dfe_modifierFloat

Return the dfe modifier

Returns:

  • (Float)

    the multiplier

#dfe_stageInteger

Return the dfe stage

Returns:

#dfsInteger

Return the current dfs

Returns:

#dfs_basisInteger

Return the dfs stat without battle modifier

Returns:

#dfs_modifierFloat

Return the dfs modifier

Returns:

  • (Float)

    the multiplier

#dfs_stageInteger

Return the dfs stage

Returns:

#dv_modifier(list)

Change the IV and update the statistics

Parameters:

  • list (Array<Integer>)

    list of new IV [hp, atk, dfe, spd, ats, dfs]

#edit_bonus(list) ⇒ Boolean?

Add ev bonus to a Pokemon (without item interaction)

Parameters:

  • list (Array<Integer>)

    an ev list : [hp, atk, dfe, spd, ats, dfs]

Returns:

  • (Boolean, nil)

    if the ev had totally been added or not (nil = couldn't be added at all)

#egg?Boolean Also known as: egg

Tell if the Pokemon is an egg or not

Returns:

  • (Boolean)

#egg_finish

Ends the egg process of the Pokemon

#egg_init

Initialize the egg process of the Pokemon

#egg_zone_nameString

Return the name of the zone where the egg has been obtained

Returns:

#elv_armulysBoolean

Check evolve condition to evolve in Silcoon (Armulys)

Returns:

  • (Boolean)

    if the condition is valid

#elv_blindalysBoolean

Check evolve condition to evolve in Cascoon (Blindalys)

Returns:

  • (Boolean)

    if the condition is valid

#elv_demantaBoolean

Check evolve condition to evolve in Mantine

Returns:

  • (Boolean)

    if the condition is valid

#elv_kapoeraBoolean

Check evolve condition to evolve in Hitmontop (Kapoera)

Returns:

  • (Boolean)

    if the condition is valid

#elv_kickleeBoolean

Check evolve condition to evolve in Hitmonlee (kicklee)

Returns:

  • (Boolean)

    if the condition is valid

#elv_nymphaliBoolean

Check evolve condition to evolve in Sylveon (Nymphali)

Returns:

  • (Boolean)

    if the condition is valid

#elv_pandarbareBoolean

Check evolve condition to evolve in Pangoro (Pandarbare)

Returns:

  • (Boolean)

    if the condition is valid

#elv_sepiatroceBoolean

Note:

uses :DOWN to validate the evolve condition

Check evolve condition to evolve in Malamar (Sepiatroce)

Returns:

  • (Boolean)

    if the condition is valid

#elv_tygnonBoolean

Check evolve condition to evolve in Hitmonchan (tygnon)

Returns:

  • (Boolean)

    if the condition is valid

#encodeString

Encode the Pokemon to a String in order to send it to the GTS system

Returns:

#ev_atk_textString

Return the EV ATK text

Returns:

#ev_ats_textString

Return the EV ATS text

Returns:

#ev_check(index, apply = false) ⇒ Integer, false

Automatic ev adder using an index

Parameters:

  • index (Integer)

    ev index (see GameData::EV), should add 10. If index > 10 take index % 10 and add only 1 EV.

  • apply (Boolean) (defaults to: false)

    if the ev change is applied

Returns:

  • (Integer, false)

    if not false, the value of the current EV depending on the index

#ev_dfe_textString

Return the EV DFE text

Returns:

#ev_dfs_textString

Return the EV DFS text

Returns:

#ev_hp_textString

Return the EV HP text

Returns:

#ev_spd_textString

Return the EV SPD text

Returns:

#ev_var(index, evs, value = 0) ⇒ Integer

Get and add EV

Parameters:

  • index (Integer)

    ev index (see GameData::EV)

  • evs (Integer)

    the total ev

  • value (Integer) (defaults to: 0)

    the quantity of EV to add (if 0 no add)

Returns:

#eva_stageInteger

Return the evasion stage

Returns:

#evolve_check(reason = :level_up, extend_data = nil) ⇒ Array<Integer, nil>, false

Check if the Pokemon can evolve and return the evolve id if possible

Parameters:

  • reason (Symbol) (defaults to: :level_up)

    evolve check reason (:level_up, :trade, :stone)

  • extend_data (Hash, nil) (defaults to: nil)

    extend_data generated by an item

Returns:

  • (Array<Integer, nil>, false)

    if the Pokemon can evolve, the evolve id, otherwise false

#exp_listArray<Integer>

Return the exp curve

Returns:

#exp_lvlInteger

Return the required exp to increase the Pokemon's level

Returns:

#exp_remaining_textString

Return the text of the amount of exp the pokemon needs to go to the next level

Returns:

#exp_textString

Return the text of the current pokemon experience

Returns:

#exp_typeInteger

Return the exp curve type ID

Returns:

#female?Boolean

Tell if the Pokemon is a female

Returns:

  • (Boolean)

#find_last_skill_positionInteger

Find the last skill used position in the moveset of the Pokemon

Returns:

#find_skill(id) ⇒ PFM::Skill, false

Find a skill in the moveset of the Pokemon

Parameters:

  • id (Integer, Symbol)

    ID of the skill in the database

Returns:

#flagsInteger

Get Pokemon flags

Returns:

#flags=(flag)

Set the captured_in flags (to know from which game the pokemon came from)

Parameters:

#forget_skill(id)

Forget a skill by its id

Parameters:

  • id (Integer, Symbol)

    ID of the skill in the database

#forget_skill_index(index)

Forget a skill at a specific index

Parameters:

  • index (Integer)

    index of the skill to forget

#form_calibrate(reason = :menu) ⇒ Boolean

Note:

It calls the block stored in the hash FORM_CALIBRATE where the key is the Pokemon db_symbol & the block parameter is the reason. The block should change @form

Automatically calibrate the form of the Pokemon

Parameters:

  • reason (Symbol) (defaults to: :menu)

    what called form_calibrate (:menu, :evolve, :load, …)

Returns:

  • (Boolean)

    if the Pokemon's form has changed

#form_generation(form, old_value = nil) ⇒ Integer

Note:

It calls the block stored in the hash FORM_GENERATION where the key is the Pokemon db_symbol

Automatically generate the form index of the Pokemon

Parameters:

  • form (Integer)

    if form != 0 does not generate the form (protection)

Returns:

#from_past?Boolean

Tell if the pokemon is from a past version

Returns:

  • (Boolean)

#from_player?Boolean

Return if the Pokemon is from the player (he caught it)

Returns:

  • (Boolean)

#front_offset_yInteger

Return the front offset y of the Pokemon

Returns:

#froze_checkBoolean

Check if the Pokemon is still frozen

Returns:

  • (Boolean)

#frozen?Boolean

Is the Pokemon frozen?

Returns:

  • (Boolean)

#genderless?Boolean

Tell if the Pokemon is genderless

Returns:

  • (Boolean)

#get_dv_value(value, old) ⇒ Integer

Get the adjusted IV

Parameters:

Returns:

  • (Integer)

    something between old and 31 (value in most case)

#get_skill_position(skill) ⇒ Integer

Return the skill index of a skill in the moveset of the Pokemon

Parameters:

Returns:

  • (Integer)

    the index of the skill

#gif_back::Yuki::GifReader?

Return the GifReader back of the Pokemon

Returns:

#gif_face::Yuki::GifReader?

Return the GifReader face of the Pokemon

Returns:

#heightNumeric

Return the height of the Pokemon

Returns:

  • (Numeric)

#hp_pokemon_numberString

Returns the HP text (to_pokemon_number)

Returns:

#hp_textString

Returns the HP text

Returns:

#iconBitmap

Return the icon of the Pokemon

Returns:

  • (Bitmap)

#id_textString

Return the text of the Pokemon ID

Returns:

#id_text2String

Return the text of the Pokemon ID with N°

Returns:

#id_text3String

Return the text of the Pokemon ID to pokemon number

Returns:

#item_db_symbolSymbol

Return the db_symbol of the Pokemon's item held

Returns:

  • (Symbol)

#item_holdInteger

Alias for item_holding

Returns:

#item_nameString

Return the name of the item the Pokemon is holding

Returns:

#iv_atk_textString

Return the IV ATK text

Returns:

#iv_ats_textString

Return the IV ATS text

Returns:

#iv_dfe_textString

Return the IV DFE text

Returns:

#iv_dfs_textString

Return the IV DFS text

Returns:

#iv_hp_textString

Return the IV HP text

Returns:

#iv_spd_textString

Return the IV SPD text

Returns:

#learn_skill(id) ⇒ Boolean?

Learn a new skill

Parameters:

  • id (Integer, Symbol)

    ID of the skill in the database

Returns:

  • (Boolean, nil)

    true = learnt, false = already learnt, nil = couldn't learn

#level_pokemon_numberString

Return the level text (to_pokemon_number)

Returns:

#level_textString

Returns the level text

Returns:

#level_text2String

Return the level text with “Level: ” inside

Returns:

#level_upBoolean

Increase the level of the Pokemon

Returns:

  • (Boolean)

    if the level has successfully been increased

#level_up_stat_refreshArray<Array<Integer>>

Generate the level up stat list for the level up window

Returns:

  • (Array<Array<Integer>>)

    list0, list1 : old, new basis value

#level_up_window_call(list0, list1, z_level)

Show the level up window

Parameters:

  • list0 (Array<Integer>)

    old basis stat list

  • list1 (Array<Integer>)

    new basis stat list

  • z_level (Integer)

    z superiority of the Window

#load_skill_from_array(skills)

Load the skill from an Array

Parameters:

  • skills (Array)

    the skills array (containing IDs or Symbols)

#male?Boolean

Tell if the Pokemon is a male

Returns:

  • (Boolean)

#max_hpInteger

Return the max HP of the Pokemon

Returns:

#max_levelInteger

Give the maximum level of the Pokemon

Returns:

#max_level=(level)

Set the maximum level of the Pokemon

Parameters:

#mega_evolve

Mega evolve the Pokemon (if possible)

#mega_evolved?Boolean

Is the Pokemon mega evolved ?

Returns:

  • (Boolean)

#modifier_stage(stage) ⇒ Float

Return the stage modifier (multiplier)

Parameters:

  • stage (Integer)

    the value of the stage

Returns:

  • (Float)

    the multiplier

#morph(target)

Apply the effect of Transform (Morphing) on this Pokemon by using a target

Parameters:

#nameString

Return the Pokemon name in the Pokedex

Returns:

#name_upperString

Return the Pokemon name upcase in the Pokedex

Returns:

#nature_idInteger

Return the nature id of the Pokemon

Returns:

#nature_textString

Return the text of the nature

Returns:

#paralysis_checkBoolean

Check if the Pokemon cannot move

Returns:

  • (Boolean)

#paralyzed?Boolean

Is the Pokemon paralyzed?

Returns:

  • (Boolean)

#poison_effectInteger

Return the Poison effect on HP of the Pokemon

Returns:

  • (Integer)

    number of HP loosen

#poisoned?Boolean

Is the Pokemon poisoned?

Returns:

  • (Boolean)

#primary_dataGameData::Pokemon

Get the primary data of the Pokemon

Returns:

#rarenessInteger

Return the Pokemon rareness

Returns:

#rareness=(v)

Change the Pokemon rareness

Parameters:

  • v (Integer, nil)

    the new rareness of the Pokemon

#remindable_skills(mode = 0) ⇒ Array<Integer>

Get the list of all the skill the Pokemon can learn again

Parameters:

  • mode (Integer) (defaults to: 0)

    Define the moves that can be learnt again : 1 = breed_moves + learnt + potentially_learnt 2 = all moves other = learnt + potentially_learnt

Returns:

#replace_skill_index(index, id)

Replace the skill at a specific index

Parameters:

  • index (Integer)

    index of the skill to replace by a new skill

  • id (Integer, Symbol)

    id of the new skill in the database

#reset_stat_stage

Reset the battle stat stage and stuff related to battle

#ribbon_got?(id) ⇒ Boolean

Has the pokemon got a ribbon ?

Returns:

  • (Boolean)

#shiny=(shiny)

Set the shiny attribut

Parameters:

  • shiny (Boolean)

#shiny?Boolean Also known as: shiny

Get the shiny attribute

Returns:

  • (Boolean)

#shiny_rateInteger

Give the shiny rate for the Pokemon, The number should be between 0 & 0xFFFF. 0 means absolutely no chance to be shiny, 0xFFFF means always shiny

Returns:

#skill_category_amount(atk_class) ⇒ Integer

Get the number of skill of a specific category

Parameters:

  • atk_class (Integer)

    1 = atk, 2 = spe, 3 = status

Returns:

#skill_learnt?(id, only_in_moveset = true) ⇒ Boolean Also known as: has_skill?

Has the pokemon already learnt a skill ?

Parameters:

  • id (Integer, Symbol)

    id of the skill

  • only_in_moveset (Boolean) (defaults to: true)

    if the function only check in the current moveset

Returns:

  • (Boolean)

#skillsArray<Integer>

Return the list of skill/move ID of the Pokemon

Returns:

#sleep_checkBoolean

Check if the Pokemon is still asleep

Returns:

  • (Boolean)

    true = the Pokemon is still asleep

#spdInteger

Return the current spd

Returns:

#spd_basisInteger

Return the spd stat without battle modifier

Returns:

#spd_modifierFloat

Return the spd modifier

Returns:

  • (Float)

    the multiplier

#spd_stageInteger

Return the spd stage

Returns:

#ss(index) ⇒ PFM::Skill?

Return the skill at an index in the moveset of the Pokemon

Returns:

#status_burn(forcing = false) ⇒ Boolean

Burn the Pokemon

Parameters:

  • forcing (Boolean) (defaults to: false)

    force the new status

Returns:

  • (Boolean)

    if the pokemon has been burnt

#status_confuse(forcing = false) ⇒ Boolean

Confuse the Pokemon

Parameters:

  • forcing (Boolean) (defaults to: false)

    force the new status

Returns:

  • (Boolean)

    if the pokemon has been confused

#status_frozen(forcing = false) ⇒ Boolean

Freeze the Pokemon

Parameters:

  • forcing (Boolean) (defaults to: false)

    force the new status

Returns:

  • (Boolean)

    if the pokemon has been frozen

#status_paralyze(forcing = false) ⇒ Boolean

Paralyze the Pokemon

Parameters:

  • forcing (Boolean) (defaults to: false)

    force the new status

Returns:

  • (Boolean)

    if the pokemon has been paralyzed

#status_poison(forcing = false) ⇒ Boolean

Empoison the Pokemon

Parameters:

  • forcing (Boolean) (defaults to: false)

    force the new status

Returns:

  • (Boolean)

    if the pokemon has been empoisoned

#status_sleep(forcing = false, nb_turn = nil) ⇒ Boolean

Put the Pokemon to sleep

Parameters:

  • forcing (Boolean) (defaults to: false)

    force the new status

  • nb_turn (Integer, nil) (defaults to: nil)

    number of turn the Pokemon will sleep

Returns:

  • (Boolean)

    if the pokemon has been put to sleep

#status_toxic(forcing = true) ⇒ Boolean

Intoxicate the Pokemon

Parameters:

  • forcing (Boolean) (defaults to: true)

    force the new status

Returns:

  • (Boolean)

    if the pokemon has been intoxicated

#swap_skills_index(index1, index2)

Swap the position of two skills in the skills_set

Parameters:

  • index1 (Integer)

    Index of the first skill to swap

  • index2 (Integer)

    Index of the second skill to swap

#to_sString

Convert the Pokemon to a string (battle debug)

Returns:

#total_evInteger

Return the total amount of EV

Returns:

#toxic?Boolean

Is the Pokemon in toxic state ?

Returns:

  • (Boolean)

#toxic_effect(no_count = false) ⇒ Integer

Return the number of HP the Pokemon looses

Parameters:

  • no_count (Boolean) (defaults to: false)

    if the toxic counter doesn't increase

Returns:

  • (Integer)

    number of HP loosen

#trainer_id_textString

Return the normalized text trainer id of the Pokemon

Returns:

#type?(type) ⇒ Boolean

Check the Pokemon type by the type ID

Parameters:

  • type (Integer)

    ID of the type in the database

Returns:

  • (Boolean)

#type_bug?Boolean Also known as: type_insect?

Is the Pokemon type insect/bug ?

Returns:

  • (Boolean)

#type_dark?Boolean Also known as: type_tenebre?

Is the Pokemon type dark ?

Returns:

  • (Boolean)

#type_dragon?Boolean

Is the Pokemon type dragon ?

Returns:

  • (Boolean)

#type_electric?Boolean Also known as: type_electrique?

Is the Pokemon type electric ?

Returns:

  • (Boolean)

#type_fairy?Boolean Also known as: type_fee?

Is the Pokemon type fairy ?

Returns:

  • (Boolean)

#type_fighting?Boolean Also known as: type_combat?

Is the Pokemon type fighting ?

Returns:

  • (Boolean)

#type_fire?Boolean Also known as: type_feu?

Is the Pokemon type fire ?

Returns:

  • (Boolean)

#type_flying?Boolean Also known as: type_vol?, type_fly?

Is the Pokemon type fly ?

Returns:

  • (Boolean)

#type_ghost?Boolean Also known as: type_spectre?

Is the Pokemon type ghost ?

Returns:

  • (Boolean)

#type_grass?Boolean Also known as: type_plante?

Is the Pokemon type grass ?

Returns:

  • (Boolean)

#type_ground?Boolean Also known as: type_sol?

Is the Pokemon type ground ?

Returns:

  • (Boolean)

#type_ice?Boolean Also known as: type_glace?

Is the Pokemon type ice ?

Returns:

  • (Boolean)

#type_normal?Boolean

Is the Pokemon type normal ?

Returns:

  • (Boolean)

#type_poison?Boolean

Is the Pokemon type poison ?

Returns:

  • (Boolean)

#type_psychic?Boolean Also known as: type_psy?

Is the Pokemon type psy ?

Returns:

  • (Boolean)

#type_rock?Boolean Also known as: type_roche?

Is the Pokemon type rock ?

Returns:

  • (Boolean)

#type_steel?Boolean Also known as: type_acier?

Is the Pokemon type steel ?

Returns:

  • (Boolean)

#type_water?Boolean Also known as: type_eau?

Is the Pokemon type water ?

Returns:

  • (Boolean)

#unmega_evolve

Reset the Pokemon to its normal form after mega evolution

#update_ability

Update the Pokemon Ability

#weightNumeric

Return the weight of the Pokemon

Returns:

  • (Numeric)

#zone_id(special_zone = nil)

Get the zone id where the Pokemon has been found

Parameters:

  • special_zone (Integer, nil) (defaults to: nil)

    if you want to use this function for stuff like egg_zone_id