Class: PFM::PokemonBattler

Inherits:
Pokemon show all
Includes:
Hooks
Defined in:
docs/5_Battle_03_PokemonBattler.rb

Overview

Class defining a Pokemon during a battle, it aim to copy its properties but also to have the methods related to the battle.

Defined Under Namespace

Classes: DamageHistory, MoveHistory, StatHistory, SuccessfulMoveHistory

Constant Summary collapse

COPIED_PROPERTIES =

List of properties to copy

%i[@id @form @given_name @code @ability @nature @iv_hp @iv_atk @iv_dfe @iv_spd @iv_ats @iv_dfs @ev_hp @ev_atk @ev_dfe @ev_spd @ev_ats @ev_dfs @trainer_id @trainer_name @step_remaining @loyalty @exp @hp @status @status_count @item_holding @captured_with @captured_in @captured_at @captured_level @gender @skill_learnt @ribbons @character @exp_rate @hp_rate @egg_at @egg_in @evolve_var]
TRANSFORM_COPIED_PROPERTIES =

List of properties to copy with transform

%i[@id @form @nature @ev_hp @ev_atk @ev_dfe @ev_spd @ev_ats @ev_dfs]
TRANSFORM_BP_METHODS =

List of @battle_properties to copy with transform

%i[ability weight height type1 type2 gender shiny atk_basis dfe_basis ats_basis dfs_basis spd_basis atk_stage dfe_stage ats_stage dfs_stage spd_stage]
TRANSFORM_SETTER_CACHE =

Setter cache for the Transform properties to write

TRANSFORM_BP_METHODS.to_h { |key| [key, :"#{key}="] }
ILLUSION_COPIED_PROPERTIES =

List of properties to copy with Illusion

%i[@id @form @gender @given_name @code @captured_with]
BACK_PROPERTIES =

List of properties to copy back to original

%i[@id @form @trainer_id @trainer_name @step_remaining @loyalty @hp @status @status_count @item_holding @captured_with @captured_in @captured_at @captured_level @gender @character @hp_rate @evolve_var]
ABILITIES_IGNORING_ABILITIES =

List of abilities that ignore abilities

%i[mold_breaker teravolt turboblaze]
MOVES_IGNORING_ABILITIES =

List of moves that ignore abilities

%i[sunsteel_strike moongeist_beam photon_geyser]
ILLUSION_PROOF_SCENES =

List of the UIs able to omit the Illusion form of the Pokemon

Returns:

  • (Array<Class>)
[GamePlay::Party_Menu, GamePlay::Summary]
MIN_STAGE =

Minimal value of the stat modifier level (stage)

-6
# Maximal value of the stat modifier level (stage)
MAX_STAGE =

Maximal value of the stat modifier level (stage)

6

Constants inherited from Pokemon

PFM::Pokemon::ABILITY_CHANCES, PFM::Pokemon::ArceusItem, PFM::Pokemon::BATTLER_SIZE, PFM::Pokemon::EGG_FILENAMES, PFM::Pokemon::FLAG_CAUGHT_BY_PLAYER, PFM::Pokemon::FLAG_FROM_THIS_GAME, PFM::Pokemon::FLAG_PRESENT_TIME, PFM::Pokemon::FLAG_UNKOWN_USE, PFM::Pokemon::FOOT_SIZE, PFM::Pokemon::FORM_CALIBRATE, PFM::Pokemon::FORM_GENERATION, PFM::Pokemon::G_FORM, PFM::Pokemon::G_GR, PFM::Pokemon::G_ID, PFM::Pokemon::G_MOVE, PFM::Pokemon::G_NV, PFM::Pokemon::G_OBJ, PFM::Pokemon::G_SHINY, PFM::Pokemon::G_STAT, PFM::Pokemon::GenesectModules, PFM::Pokemon::ICON_SIZE, PFM::Pokemon::OGERPONMASK, PFM::Pokemon::SPECIAL_EVOLUTION_ID, PFM::Pokemon::Shiny_IV, PFM::Pokemon::SilvallyROM

Instance Attribute Summary collapse

Attributes inherited from Pokemon

#ability_index, #ability_used, #attack_order, #battle_stage, #captured_at, #captured_in, #captured_level, #character, #confuse, #critical_modifier, #egg_at, #egg_how_obtained, #egg_in, #ev_atk, #ev_ats, #ev_dfe, #ev_dfs, #ev_hp, #ev_spd, #evolve_var, #exp, #exp_rate, #game_code, #hp, #hp_rate, #item_holding, #iv_atk, #iv_ats, #iv_dfe, #iv_dfs, #iv_hp, #iv_spd, #level, #loyalty, #memo_text, #nature, #prepared_skill, #ribbons, #skill_learnt, #skills_set, #status, #status_count, #step_remaining, #sub_code, #sub_form, #sub_id, #trainer_id, #trainer_name

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Hooks

#exec_hooks, #force_return, included, register, remove, remove_without_name

Methods inherited from Pokemon

#ability_descr, #ability_name, #absofusion, #absofusionned?, #add_bonus, #add_ev_atk, #add_ev_ats, #add_ev_dfe, #add_ev_dfs, #add_ev_hp, #add_ev_spd, add_evolution_criteria, #add_ribbon, #alive?, #asleep?, back_filename, back_gif_filename, #ball_color, #ball_image, #ball_sprite, #base_atk, #base_ats, #base_dfe, #base_dfs, #base_exp, #base_spd, #battle_list, #battler_back, #battler_face, #burn?, #calyrex_form, #can_be_asleep?, #can_be_burn?, #can_be_frozen?, #can_be_paralyzed?, #can_be_poisoned?, #can_learn?, #can_learn_skill_at_this_level?, #can_mega_evolve?, #captured_zone_name, #castform_form, #caught_by_player?, #character_name, #check_skill_and_learn, #cramorant_form, #cure, #current_deerling_form, #data, #db_symbol, #dead?, #dv_modifier, #edit_bonus, #egg?, #egg_finish, #egg_init, #egg_zone_name, #elv_1percent, #elv_99percent, #elv_annihilape, #elv_armulys, #elv_blindalys, #elv_demanta, #elv_kapoera, #elv_kicklee, #elv_nymphali, #elv_pandarbare, #elv_sepiatroce, #elv_sirfetchd, #elv_toxtricity_amped, #elv_toxtricity_low_key, #elv_tygnon, #encode, #ev_atk_text, #ev_ats_text, #ev_check, #ev_dfe_text, #ev_dfs_text, #ev_hp_text, #ev_spd_text, #ev_var, #evolve, #evolve_check, #exp_list, #exp_lvl, #exp_remaining_text, #exp_text, #exp_type, #female?, #find_skill, #flags, #flags=, #flavor_disliked?, #flavor_liked?, #forget_skill, #form_calibrate, #form_generation, #from_past?, #from_player?, front_filename, front_gif_filename, #front_offset_y, #frozen?, #fully_heal, #genderless?, generate_from_hash, #get_dv_value, #gif_back, #gif_face, #hp_pokemon_number, #hp_text, #icon, icon_filename, #id_text, #id_text2, #id_text3, #increase_evolve_var, #item_hold, #item_name, #iv_atk_text, #iv_ats_text, #iv_dfe_text, #iv_dfs_text, #iv_hp_text, #iv_spd_text, #kyurem_form, #learn_skill, #level_pokemon_number, #level_text, #level_text2, #level_up, #level_up_stat_refresh, #level_up_window_call, #load_skill_from_array, #male?, #max_hp, #max_level, #max_level=, #mega_evolve, #mega_evolved?, missing_resources_error, #modifier_stage, #name_upper, #nature_text, #necrozma_form, #no_preferences?, #paralyzed?, #poisoned?, #primary_data, #remindable_skills, #replace_skill_index, #reset_evolve_var, #ribbon_got?, #separate, #shaymin_form, #shiny=, #shiny?, #shiny_rate, #single_type?, #skill_learnt?, #sleep_check, #status?, #status_burn, #status_frozen, #status_paralyze, #status_poison, #status_sleep, #status_toxic, #swap_skills_index, #third_type?, #total_ev, #toxic?, #trainer_id_text, #type?, #type_bug?, #type_dark?, #type_dragon?, #type_electric?, #type_fairy?, #type_fighting?, #type_fire?, #type_flying?, #type_ghost?, #type_grass?, #type_ground?, #type_ice?, #type_normal?, #type_poison?, #type_psychic?, #type_rock?, #type_steel?, #type_water?, #unmega_evolve, #update_ability, #zone_id, #zygarde_form

Constructor Details

#initialize(original, scene, max_level = Float::INFINITY) ⇒ PokemonBattler

Create a new PokemonBattler from a Pokemon

Parameters:

  • original (PFM::Pokemon)

    original Pokemon (protected during the battle)

  • scene (Battle::Scene)

    current battle scene

  • max_level (Integer) (defaults to: Float::INFINITY)

    new max level for Online battle



95
96
# File 'docs/5_Battle_03_PokemonBattler.rb', line 95

def initialize(original, scene, max_level = Float::INFINITY)
end

Instance Attribute Details

#bagPFM::Bag

Get the bag of the battler

Returns:



63
64
65
# File 'docs/5_Battle_03_PokemonBattler.rb', line 63

def bag
  @bag
end

#bankInteger

Returns Bank where the Pokemon is supposed to be.

Returns:

  • (Integer)

    Bank where the Pokemon is supposed to be



35
36
37
# File 'docs/5_Battle_03_PokemonBattler.rb', line 35

def bank
  @bank
end

#battle_itemInteger

Get the item held during battle

Returns:

  • (Integer)


69
70
71
# File 'docs/5_Battle_03_PokemonBattler.rb', line 69

def battle_item
  @battle_item
end

#battle_item_dataArray (readonly)

Get the data associated to the item if needed

Returns:

  • (Array)


72
73
74
# File 'docs/5_Battle_03_PokemonBattler.rb', line 72

def battle_item_data
  @battle_item_data
end

#consumed_itemSymbol

Returns the symbol of the consumed item.

Returns:

  • (Symbol)

    the symbol of the consumed item



82
83
84
# File 'docs/5_Battle_03_PokemonBattler.rb', line 82

def consumed_item
  @consumed_item
end

#damage_historyArray<DamageHistory> (readonly)

Get the damage history

Returns:



48
49
50
# File 'docs/5_Battle_03_PokemonBattler.rb', line 48

def damage_history
  @damage_history
end

#effectsBattle::Effects::EffectsHandler (readonly)

Get the effect handler



702
703
704
# File 'docs/5_Battle_03_PokemonBattler.rb', line 702

def effects
  @effects
end

#encounter_listArray<PFM::PokemonBattler> (readonly)

Get the encounter list

Returns:



57
58
59
# File 'docs/5_Battle_03_PokemonBattler.rb', line 57

def encounter_list
  @encounter_list
end

#exp_distributedBoolean

Tell if the Pokemon already distributed its experience during the battle

Returns:

  • (Boolean)


66
67
68
# File 'docs/5_Battle_03_PokemonBattler.rb', line 66

def exp_distributed
  @exp_distributed
end

#illusionPFM::PokemonBattler

Get the Illusion pokemon

Returns:



90
91
92
# File 'docs/5_Battle_03_PokemonBattler.rb', line 90

def illusion
  @illusion
end

#is_followerBoolean

Get the information if the Pokemon is actually a follower or not (changing its go-in-out animation)

Returns:

  • (Boolean)


60
61
62
# File 'docs/5_Battle_03_PokemonBattler.rb', line 60

def is_follower
  @is_follower
end

#item_consumedBoolean

Tell if the Pokemon has its item consumed

Returns:

  • (Boolean)


80
81
82
# File 'docs/5_Battle_03_PokemonBattler.rb', line 80

def item_consumed
  @item_consumed
end

#ko_countInteger

Returns number of times the pokémon has been knocked out.

Returns:

  • (Integer)

    number of times the pokémon has been knocked out



84
85
86
# File 'docs/5_Battle_03_PokemonBattler.rb', line 84

def ko_count
  @ko_count
end

#last_battle_turnInteger

Last turn the Pokemon fought

Returns:

  • (Integer)


24
25
26
# File 'docs/5_Battle_03_PokemonBattler.rb', line 24

def last_battle_turn
  @last_battle_turn
end

#last_hit_by_moveBattle::Move

Returns last move that hit the pokemon.

Returns:



29
30
31
# File 'docs/5_Battle_03_PokemonBattler.rb', line 29

def last_hit_by_move
  @last_hit_by_move
end

#last_sent_turnInteger

Last turn the pokemon was sent out

Returns:

  • (Integer)


27
28
29
# File 'docs/5_Battle_03_PokemonBattler.rb', line 27

def last_sent_turn
  @last_sent_turn
end

#mimic_moveArray<Battle::Move, Integer>

Mimic move that was replace by another move with its index

Returns:



77
78
79
# File 'docs/5_Battle_03_PokemonBattler.rb', line 77

def mimic_move
  @mimic_move
end

#move_historyArray<MoveHistory> (readonly)

Get the move history

Returns:



45
46
47
# File 'docs/5_Battle_03_PokemonBattler.rb', line 45

def move_history
  @move_history
end

#movesetArray<Battle::Move> (readonly)

Returns the moveset of the Pokemon.

Returns:



18
19
20
# File 'docs/5_Battle_03_PokemonBattler.rb', line 18

def moveset
  @moveset
end

#originalPFM::Pokemon (readonly)

Get the original Pokemon

Returns:



42
43
44
# File 'docs/5_Battle_03_PokemonBattler.rb', line 42

def original
  @original
end

#party_idInteger

Returns the ID of the party that control the Pokemon in the bank.

Returns:

  • (Integer)

    the ID of the party that control the Pokemon in the bank



33
34
35
# File 'docs/5_Battle_03_PokemonBattler.rb', line 33

def party_id
  @party_id
end

#place_in_partyInteger

Returns Place in the team of the Pokemon.

Returns:

  • (Integer)

    Place in the team of the Pokemon



39
40
41
# File 'docs/5_Battle_03_PokemonBattler.rb', line 39

def place_in_party
  @place_in_party
end

#positionInteger

Returns Position of the Pokemon in the bank.

Returns:

  • (Integer)

    Position of the Pokemon in the bank



37
38
39
# File 'docs/5_Battle_03_PokemonBattler.rb', line 37

def position
  @position
end

#stat_historyArray<StatHistory> (readonly)

Get the stat history

Returns:



54
55
56
# File 'docs/5_Battle_03_PokemonBattler.rb', line 54

def stat_history
  @stat_history
end

#successful_move_historyArray<SuccessfulMoveHistory> (readonly)

Get the successful move history

Returns:



51
52
53
# File 'docs/5_Battle_03_PokemonBattler.rb', line 51

def successful_move_history
  @successful_move_history
end

#switching=(value) ⇒ Boolean (writeonly)

Returns set switching state.

Returns:

  • (Boolean)

    set switching state



74
75
76
# File 'docs/5_Battle_03_PokemonBattler.rb', line 74

def switching=(value)
  @switching = value
end

#transformPFM::PokemonBattler

Get the transform pokemon

Returns:



87
88
89
# File 'docs/5_Battle_03_PokemonBattler.rb', line 87

def transform
  @transform
end

#turn_countInteger Also known as: battle_turns

Returns number of turn the Pokemon is in battle.

Returns:

  • (Integer)

    number of turn the Pokemon is in battle



20
21
22
# File 'docs/5_Battle_03_PokemonBattler.rb', line 20

def turn_count
  @turn_count
end

#type3Integer

Return the battler’s combat property

Returns:

  • (Integer)


31
32
33
# File 'docs/5_Battle_03_PokemonBattler.rb', line 31

def type3
  @type3
end

Class Method Details

.register_force_flying_hook(reason) {|pokemon, scene| ... }

Register a hook forcing Pokemon to be flying (ie not grounded)

Parameters:

  • reason (String)

    reason of the force_flying hook

Yield Parameters:

Yield Returns:

  • (Boolean)

    if the Pokemon is forced to be “flying”



689
690
# File 'docs/5_Battle_03_PokemonBattler.rb', line 689

def register_force_flying_hook(reason)
end

.register_force_grounded_hook(reason) {|pokemon, scene| ... }

Register a hook forcing Pokemon to be grounded

Parameters:

  • reason (String)

    reason of the force_grounded hook

Yield Parameters:

Yield Returns:

  • (Boolean)

    if the Pokemon is forced to be grounded



682
683
# File 'docs/5_Battle_03_PokemonBattler.rb', line 682

def register_force_grounded_hook(reason)
end

Instance Method Details

#abilityInteger

Return the battler’s combat property

Returns:

  • (Integer)


417
418
# File 'docs/5_Battle_03_PokemonBattler.rb', line 417

def ability
end

#ability=(value)

Set the battler’s combat property

Parameters:

  • value (Integer)


421
422
# File 'docs/5_Battle_03_PokemonBattler.rb', line 421

def ability=(value)
end

#ability_db_symbolSymbol

Return the db_symbol of the current ability of the Pokemon

Returns:

  • (Symbol)


114
115
# File 'docs/5_Battle_03_PokemonBattler.rb', line 114

def ability_db_symbol
end

#ability_effectBattle::Effects::Ability

Get the ability effect



716
717
# File 'docs/5_Battle_03_PokemonBattler.rb', line 716

def ability_effect
end

#acc_stageInteger

Return the accuracy stage

Returns:

  • (Integer)


577
578
# File 'docs/5_Battle_03_PokemonBattler.rb', line 577

def acc_stage
end

#acc_stage=(value) ⇒ Integer

Set the acc stage

Parameters:

  • value (Integer)

    the new value of the stat stage

Returns:

  • (Integer)

    the new stat stage value



639
640
# File 'docs/5_Battle_03_PokemonBattler.rb', line 639

def acc_stage=(value)
end

#add_battler_to_encounter_list(battler)

Note:

The battler is not added if it is already present in the list

Add a battler to the encounter list

Parameters:



173
174
# File 'docs/5_Battle_03_PokemonBattler.rb', line 173

def add_battler_to_encounter_list(battler)
end

#add_damage_to_history(damage, launcher, move, ko)

Note:

This method should only be used for successful damages!!!

Add a damage to the damage history

Parameters:



154
155
# File 'docs/5_Battle_03_PokemonBattler.rb', line 154

def add_damage_to_history(damage, launcher, move, ko)
end

#add_move_to_history(move, targets)

Add a move to the move history

Parameters:



146
147
# File 'docs/5_Battle_03_PokemonBattler.rb', line 146

def add_move_to_history(move, targets)
end

#add_stat_to_history(stat, power, target, launcher, move)

Add a stat to the stat history

Parameters:

  • stat (Symbol)

    :atk, :dfe, :spd, :ats, :dfs, :acc, :eva

  • power (Integer)

    power of the stat change

  • target (PFM::PokemonBattler)

    target of the stat change

  • launcher (PFM::PokemonBattler, nil)

    launcher of the stat change

  • move (Battle::Move, nil)

    move that cause the stat change



168
169
# File 'docs/5_Battle_03_PokemonBattler.rb', line 168

def add_stat_to_history(stat, power, target, launcher, move)
end

#add_successful_move_to_history(move, targets)

Note:

This method should only be used for successful moves!!!

Add a successful move to the successful move history

Parameters:



160
161
# File 'docs/5_Battle_03_PokemonBattler.rb', line 160

def add_successful_move_to_history(move, targets)
end

#affected_by_terrain?Boolean

Is the pokemon affected by the terrain ?

Returns:

  • (Boolean)


260
261
# File 'docs/5_Battle_03_PokemonBattler.rb', line 260

def affected_by_terrain?
end

#apply_flinch(forced = false)

Apply the flinch effect

Parameters:

  • forced (Boolean) (defaults to: false)

    this parameter is ignored since flinch effect is volatile



249
250
# File 'docs/5_Battle_03_PokemonBattler.rb', line 249

def apply_flinch(forced = false)
end

#atkInteger

Return the current atk

Returns:

  • (Integer)


513
514
# File 'docs/5_Battle_03_PokemonBattler.rb', line 513

def atk
end

#atk_basisInteger

Return the battler’s combat property

Returns:

  • (Integer)


351
352
# File 'docs/5_Battle_03_PokemonBattler.rb', line 351

def atk_basis
end

#atk_basis=(value)

Set the battler’s combat property

Parameters:

  • value (Integer)


355
356
# File 'docs/5_Battle_03_PokemonBattler.rb', line 355

def atk_basis=(value)
end

#atk_modifierFloat

Return the atk modifier

Returns:

  • (Float)

    the multiplier



533
534
# File 'docs/5_Battle_03_PokemonBattler.rb', line 533

def atk_modifier
end

#atk_stageInteger

Return the atk stage

Returns:

  • (Integer)


553
554
# File 'docs/5_Battle_03_PokemonBattler.rb', line 553

def atk_stage
end

#atk_stage=(value) ⇒ Integer

Set the atk stage

Parameters:

  • value (Integer)

    the new value of the stat stage

Returns:

  • (Integer)

    the new stat stage value



649
650
# File 'docs/5_Battle_03_PokemonBattler.rb', line 649

def atk_stage=(value)
end

#atsInteger

Return the current ats

Returns:

  • (Integer)


525
526
# File 'docs/5_Battle_03_PokemonBattler.rb', line 525

def ats
end

#ats_basisInteger

Return the battler’s combat property

Returns:

  • (Integer)


362
363
# File 'docs/5_Battle_03_PokemonBattler.rb', line 362

def ats_basis
end

#ats_basis=(value)

Set the battler’s combat property

Parameters:

  • value (Integer)


366
367
# File 'docs/5_Battle_03_PokemonBattler.rb', line 366

def ats_basis=(value)
end

#ats_modifierFloat

Return the ats modifier

Returns:

  • (Float)

    the multiplier



545
546
# File 'docs/5_Battle_03_PokemonBattler.rb', line 545

def ats_modifier
end

#ats_stageInteger

Return the ats stage

Returns:

  • (Integer)


565
566
# File 'docs/5_Battle_03_PokemonBattler.rb', line 565

def ats_stage
end

#ats_stage=(value) ⇒ Integer

Set the ats stage

Parameters:

  • value (Integer)

    the new value of the stat stage

Returns:

  • (Integer)

    the new stat stage value



654
655
# File 'docs/5_Battle_03_PokemonBattler.rb', line 654

def ats_stage=(value)
end

#base_hpInteger

Return the base HP

Returns:

  • (Integer)


226
227
# File 'docs/5_Battle_03_PokemonBattler.rb', line 226

def base_hp
end

#battle_ability_db_symbolSymbol

Return the db_symbol of the current ability of the Pokemon for battle

Returns:

  • (Symbol)


118
119
# File 'docs/5_Battle_03_PokemonBattler.rb', line 118

def battle_ability_db_symbol
end

#battle_item_db_symbolSymbol

Get the item for battle

Returns:

  • (Symbol)


131
132
# File 'docs/5_Battle_03_PokemonBattler.rb', line 131

def battle_item_db_symbol
end

#can_be_lowered_or_canceled?(test = true) ⇒ Boolean

Test if the Pokemon can have a lowering stat or have its move canceled (return false if the Pokemon has mold breaker)

List of ability that should be affected: :battle_armor|:clear_body|:damp|:dry_skin|:filter|:flash_fire|:flower_gift|:heatproof|:hyper_cutter|:immunity|:inner_focus|:insomnia| :keen_eye|:leaf_guard|:levitate|:lightning_rod|:limber|:magma_armor|:marvel_scale|:motor_drive|:oblivious|:own_tempo|:sand_veil|:shell_armor| :shield_dust|:simple|:snow_cloak|:solid_rock|:soundproof|:sticky_hold|:storm_drain|:sturdy|:suction_cups|:tangled_feet|:thick_fat|:unaware|:vital_spirit| :volt_absorb|:water_absorb|:water_veil|:white_smoke|:wonder_guard|:big_pecks|:contrary|:friend_guard|:heavy_metal|:light_metal|:magic_bounce|:multiscale| :sap_sipper|:telepathy|:wonder_skin|:aroma_veil|:bulletproof|:flower_veil|:fur_coat|:overcoat|:sweet_veil|:dazzling|:disguise|:fluffy|:queenly_majesty| :water_bubble|:mirror_armor|:punk_rock|:ice_scales|:ice_face|:pastel_veil||:armor_tail|:earth_eater|:good_as_gold|:purifying_salt|:well_backed_body|:wind_rider

Parameters:

  • test (Boolean) (defaults to: true)

    if the test should be done

Returns:

  • (Boolean)

    potential changed result



210
211
# File 'docs/5_Battle_03_PokemonBattler.rb', line 210

def can_be_lowered_or_canceled?(test = true)
end

#can_fight?Boolean

Is the Pokemon able to fight ?

Returns:

  • (Boolean)


99
100
# File 'docs/5_Battle_03_PokemonBattler.rb', line 99

def can_fight?
end

#can_move?Boolean

Test if the Pokemon can use a move

Returns:

  • (Boolean)


193
194
# File 'docs/5_Battle_03_PokemonBattler.rb', line 193

def can_move?
end

#captured_withInteger

Return the current ball ID the Pokemon was captured with If the current UI is one defined in PFM::PokemonBattler::ILLUSION_PROOF_SCENES then it’ll send the ball id saved before Illusion was triggered

Returns:

  • (Integer)


342
343
# File 'docs/5_Battle_03_PokemonBattler.rb', line 342

def captured_with
end

#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



628
629
# File 'docs/5_Battle_03_PokemonBattler.rb', line 628

def change_acc(amount)
end

#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



598
599
# File 'docs/5_Battle_03_PokemonBattler.rb', line 598

def change_atk(amount)
end

#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



613
614
# File 'docs/5_Battle_03_PokemonBattler.rb', line 613

def change_ats(amount)
end

#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



603
604
# File 'docs/5_Battle_03_PokemonBattler.rb', line 603

def change_dfe(amount)
end

#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



618
619
# File 'docs/5_Battle_03_PokemonBattler.rb', line 618

def change_dfs(amount)
end

#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



623
624
# File 'docs/5_Battle_03_PokemonBattler.rb', line 623

def change_eva(amount)
end

#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



608
609
# File 'docs/5_Battle_03_PokemonBattler.rb', line 608

def change_spd(amount)
end

#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



593
594
# File 'docs/5_Battle_03_PokemonBattler.rb', line 593

def change_stat(stat_id, amount)
end

#change_types(*types)

Change the type of the pokemons

Parameters:

  • types (Array<Integer>)


269
270
# File 'docs/5_Battle_03_PokemonBattler.rb', line 269

def change_types(*types)
end

#codeInteger

Return the current code of the Pokemon If the current UI is one defined in PFM::PokemonBattler::ILLUSION_PROOF_SCENES then it’ll send the code saved before Illusion was triggered

Returns:

  • (Integer)


336
337
# File 'docs/5_Battle_03_PokemonBattler.rb', line 336

def code
end

#confused?Boolean

Is the Pokemon confused?

Returns:

  • (Boolean)


245
246
# File 'docs/5_Battle_03_PokemonBattler.rb', line 245

def confused?
end

#copy_properties_back_to_original

Copy all the properties back to the original pokemon



229
230
# File 'docs/5_Battle_03_PokemonBattler.rb', line 229

def copy_properties_back_to_original
end

#cryString

Return the cry file name of the Pokemon If the Pokemon is under the effect of Illusion, returns the cry from the target of the ability

Returns:



347
348
# File 'docs/5_Battle_03_PokemonBattler.rb', line 347

def cry
end

#current_ability_ignoring_ability?Boolean

Tell if the Pokémon has a ability ignoring ability

Returns:

  • (Boolean)


214
215
# File 'docs/5_Battle_03_PokemonBattler.rb', line 214

def current_ability_ignoring_ability?
end

#current_move_ignoring_ability?Boolean

Tell if the Pokemon uses a move ignoring abilities

Returns:

  • (Boolean)


218
219
# File 'docs/5_Battle_03_PokemonBattler.rb', line 218

def current_move_ignoring_ability?
end

#delete_battler_to_encounter_list(battler)

Delete a battler to the encounter list

Parameters:



177
178
# File 'docs/5_Battle_03_PokemonBattler.rb', line 177

def delete_battler_to_encounter_list(battler)
end

#dfeInteger

Return the current dfe

Returns:

  • (Integer)


517
518
# File 'docs/5_Battle_03_PokemonBattler.rb', line 517

def dfe
end

#dfe_basisInteger

Return the battler’s combat property

Returns:

  • (Integer)


373
374
# File 'docs/5_Battle_03_PokemonBattler.rb', line 373

def dfe_basis
end

#dfe_basis=(value)

Set the battler’s combat property

Parameters:

  • value (Integer)


377
378
# File 'docs/5_Battle_03_PokemonBattler.rb', line 377

def dfe_basis=(value)
end

#dfe_modifierFloat

Return the dfe modifier

Returns:

  • (Float)

    the multiplier



537
538
# File 'docs/5_Battle_03_PokemonBattler.rb', line 537

def dfe_modifier
end

#dfe_stageInteger

Return the dfe stage

Returns:

  • (Integer)


557
558
# File 'docs/5_Battle_03_PokemonBattler.rb', line 557

def dfe_stage
end

#dfe_stage=(value) ⇒ Integer

Set the dfe stage

Parameters:

  • value (Integer)

    the new value of the stat stage

Returns:

  • (Integer)

    the new stat stage value



659
660
# File 'docs/5_Battle_03_PokemonBattler.rb', line 659

def dfe_stage=(value)
end

#dfsInteger

Return the current dfs

Returns:

  • (Integer)


529
530
# File 'docs/5_Battle_03_PokemonBattler.rb', line 529

def dfs
end

#dfs_basisInteger

Return the battler’s combat property

Returns:

  • (Integer)


384
385
# File 'docs/5_Battle_03_PokemonBattler.rb', line 384

def dfs_basis
end

#dfs_basis=(value)

Set the battler’s combat property

Parameters:

  • value (Integer)


388
389
# File 'docs/5_Battle_03_PokemonBattler.rb', line 388

def dfs_basis=(value)
end

#dfs_modifierFloat

Return the dfs modifier

Returns:

  • (Float)

    the multiplier



549
550
# File 'docs/5_Battle_03_PokemonBattler.rb', line 549

def dfs_modifier
end

#dfs_stageInteger

Return the dfs stage

Returns:

  • (Integer)


569
570
# File 'docs/5_Battle_03_PokemonBattler.rb', line 569

def dfs_stage
end

#dfs_stage=(value) ⇒ Integer

Set the dfs stage

Parameters:

  • value (Integer)

    the new value of the stat stage

Returns:

  • (Integer)

    the new stat stage value



664
665
# File 'docs/5_Battle_03_PokemonBattler.rb', line 664

def dfs_stage=(value)
end

#encountered?(battler) ⇒ Boolean

Test if the Pokemon has encountered the battler

Parameters:

Returns:

  • (Boolean)


181
182
# File 'docs/5_Battle_03_PokemonBattler.rb', line 181

def encountered?(battler)
end

#eva_stageInteger

Return the evasion stage

Returns:

  • (Integer)


573
574
# File 'docs/5_Battle_03_PokemonBattler.rb', line 573

def eva_stage
end

#eva_stage=(value) ⇒ Integer

Set the eva stage

Parameters:

  • value (Integer)

    the new value of the stat stage

Returns:

  • (Integer)

    the new stat stage value



669
670
# File 'docs/5_Battle_03_PokemonBattler.rb', line 669

def eva_stage=(value)
end

#evaluate_effects(yielder)

Evaluate all the effects related to this Pokemon

Parameters:

  • yielder (Proc)

    proc to call with the effect



708
709
# File 'docs/5_Battle_03_PokemonBattler.rb', line 708

def evaluate_effects(yielder)
end

#formInteger

Return the current form of the Pokemon If the current UI is one defined in PFM::PokemonBattler::ILLUSION_PROOF_SCENES then it’ll send the form saved before Illusion was triggered

Returns:

  • (Integer)


318
319
# File 'docs/5_Battle_03_PokemonBattler.rb', line 318

def form
end

#from_party?Boolean

Returns:

  • (Boolean)


106
107
# File 'docs/5_Battle_03_PokemonBattler.rb', line 106

def from_party?
end

#from_player_party?Boolean

Return if the Pokemon is in the player current team @ Return [Boolean]

Returns:

  • (Boolean)


110
111
# File 'docs/5_Battle_03_PokemonBattler.rb', line 110

def from_player_party?
end

#genderInteger

Return the battler’s combat property

Returns:

  • (Integer)


450
451
# File 'docs/5_Battle_03_PokemonBattler.rb', line 450

def gender
end

#gender=(value)

Set the battler’s combat property

Parameters:

  • value (Integer)


454
455
# File 'docs/5_Battle_03_PokemonBattler.rb', line 454

def gender=(value)
end

#given_nameString

Return the current given name of the Pokemon If the current UI is one defined in PFM::PokemonBattler::ILLUSION_PROOF_SCENES then it’ll send the given_name saved before Illusion was triggered

Returns:



324
325
# File 'docs/5_Battle_03_PokemonBattler.rb', line 324

def given_name
end

#grounded?Boolean

Check if the pokemon is grounded

Returns:

  • (Boolean)


674
675
# File 'docs/5_Battle_03_PokemonBattler.rb', line 674

def grounded?
end

#has_ability?(db_symbol) ⇒ Boolean

Tell if the pokemon has an ability

Parameters:

  • db_symbol (Symbol)

    db_symbol of the ability

Returns:

  • (Boolean)


123
124
# File 'docs/5_Battle_03_PokemonBattler.rb', line 123

def has_ability?(db_symbol)
end

#heightInteger

Return the battler’s combat property

Returns:

  • (Integer)


428
429
# File 'docs/5_Battle_03_PokemonBattler.rb', line 428

def height
end

#height=(value)

Set the battler’s combat property

Parameters:

  • value (Integer)


432
433
# File 'docs/5_Battle_03_PokemonBattler.rb', line 432

def height=(value)
end

#hold_berry?(db_symbol) ⇒ Boolean

Tell if the pokemon hold a berry

Parameters:

  • db_symbol (Symbol)

    db_symbol of the item

Returns:

  • (Boolean)


141
142
# File 'docs/5_Battle_03_PokemonBattler.rb', line 141

def hold_berry?(db_symbol)
end

#hold_item?(db_symbol) ⇒ Boolean

Tell if the pokemon hold an item

Parameters:

  • db_symbol (Symbol)

    db_symbol of the item

Returns:

  • (Boolean)


136
137
# File 'docs/5_Battle_03_PokemonBattler.rb', line 136

def hold_item?(db_symbol)
end

#idInteger

Return the current ID of the Pokemon If the current UI is one defined in PFM::PokemonBattler::ILLUSION_PROOF_SCENES then it’ll send the id saved before Illusion was triggered

Returns:

  • (Integer)


312
313
# File 'docs/5_Battle_03_PokemonBattler.rb', line 312

def id
end

#ignore_types(*types, default: data_type(:normal).id)

Neutralize a type on the Pokemon

Parameters:

  • types (Array<Integer>)
  • default (Integer) (defaults to: data_type(:normal).id)

    (default: id of :normal) type applied when no other types are defined



265
266
# File 'docs/5_Battle_03_PokemonBattler.rb', line 265

def ignore_types(*types, default: data_type(:normal).id)
end

#item_db_symbolSymbol

Return the db_symbol of the current item the Pokemon is holding

Returns:

  • (Symbol)


127
128
# File 'docs/5_Battle_03_PokemonBattler.rb', line 127

def item_db_symbol
end

#item_effectBattle::Effects::Item

Get the item effect



720
721
# File 'docs/5_Battle_03_PokemonBattler.rb', line 720

def item_effect
end

#last_move_is?(db_symbol) ⇒ Boolean

Test if the last move was of a certain symbol

Parameters:

  • db_symbol (Symbol)

    symbol of the move

Returns:

  • (Boolean)


185
186
# File 'docs/5_Battle_03_PokemonBattler.rb', line 185

def last_move_is?(db_symbol)
end

#last_successful_move_is?(db_symbol) ⇒ Boolean

Test if the last successful move was of a certain symbol

Parameters:

  • db_symbol (Symbol)

    symbol of the move

Returns:

  • (Boolean)


189
190
# File 'docs/5_Battle_03_PokemonBattler.rb', line 189

def last_successful_move_is?(db_symbol)
end

#level_up_copy

Copy some important data upon level up



280
281
# File 'docs/5_Battle_03_PokemonBattler.rb', line 280

def level_up_copy
end

#level_up_copy_moveset(moveset_before)

Copy the moveset upon level up

Parameters:



277
278
# File 'docs/5_Battle_03_PokemonBattler.rb', line 277

def level_up_copy_moveset(moveset_before)
end

#nameString

Return the current name of the Pokemon If the current UI is one defined in PFM::PokemonBattler::ILLUSION_PROOF_SCENES then it’ll send the name of the original

Returns:



330
331
# File 'docs/5_Battle_03_PokemonBattler.rb', line 330

def name
end

#nature_idInteger

Return the battler’s combat property

Returns:

  • (Integer)


406
407
# File 'docs/5_Battle_03_PokemonBattler.rb', line 406

def nature_id
end

#nature_id=(value)

Set the battler’s combat property

Parameters:

  • value (Integer)


410
411
# File 'docs/5_Battle_03_PokemonBattler.rb', line 410

def nature_id=(value)
end

#rarenessInteger

Return the battler’s combat property

Returns:

  • (Integer)


222
223
# File 'docs/5_Battle_03_PokemonBattler.rb', line 222

def rareness
end

#rareness=(value)

Set the battler’s combat property

Parameters:

  • value (Integer)


465
466
# File 'docs/5_Battle_03_PokemonBattler.rb', line 465

def rareness=(value)
end

#reset_states

Function that resets everything from the pokemon once it got switched out of battle



232
233
# File 'docs/5_Battle_03_PokemonBattler.rb', line 232

def reset_states
end

#restore_ability

Restore the battler’s property original value



424
425
# File 'docs/5_Battle_03_PokemonBattler.rb', line 424

def restore_ability
end

#restore_atk_basis

Restore the battler’s property original value



358
359
# File 'docs/5_Battle_03_PokemonBattler.rb', line 358

def restore_atk_basis
end

#restore_ats_basis

Restore the battler’s property original value



369
370
# File 'docs/5_Battle_03_PokemonBattler.rb', line 369

def restore_ats_basis
end

#restore_dfe_basis

Restore the battler’s property original value



380
381
# File 'docs/5_Battle_03_PokemonBattler.rb', line 380

def restore_dfe_basis
end

#restore_dfs_basis

Restore the battler’s property original value



391
392
# File 'docs/5_Battle_03_PokemonBattler.rb', line 391

def restore_dfs_basis
end

#restore_gender

Restore the battler’s property original value



457
458
# File 'docs/5_Battle_03_PokemonBattler.rb', line 457

def restore_gender
end

#restore_height

Restore the battler’s property original value



435
436
# File 'docs/5_Battle_03_PokemonBattler.rb', line 435

def restore_height
end

#restore_nature_id

Restore the battler’s property original value



413
414
# File 'docs/5_Battle_03_PokemonBattler.rb', line 413

def restore_nature_id
end

#restore_rareness

Restore the battler’s property original value



468
469
# File 'docs/5_Battle_03_PokemonBattler.rb', line 468

def restore_rareness
end

#restore_spd_basis

Restore the battler’s property original value



402
403
# File 'docs/5_Battle_03_PokemonBattler.rb', line 402

def restore_spd_basis
end

#restore_type1

Restore the battler’s property original value



479
480
# File 'docs/5_Battle_03_PokemonBattler.rb', line 479

def restore_type1
end

#restore_type2

Restore the battler’s property original value



490
491
# File 'docs/5_Battle_03_PokemonBattler.rb', line 490

def restore_type2
end

#restore_type3

Restore the battler’s property original value



501
502
# File 'docs/5_Battle_03_PokemonBattler.rb', line 501

def restore_type3
end

#restore_types

Restore all Pokemon types



504
505
# File 'docs/5_Battle_03_PokemonBattler.rb', line 504

def restore_types
end

#restore_weight

Restore the battler’s property original value



446
447
# File 'docs/5_Battle_03_PokemonBattler.rb', line 446

def restore_weight
end

#set_stat_stage(stat_id, value) ⇒ Integer

Set 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

  • value (Integer)

    the new value of the stat stage

Returns:

  • (Integer)

    the new stat stage value



634
635
# File 'docs/5_Battle_03_PokemonBattler.rb', line 634

def set_stat_stage(stat_id, value)
end

#spdInteger

Return the current spd

Returns:

  • (Integer)


521
522
# File 'docs/5_Battle_03_PokemonBattler.rb', line 521

def spd
end

#spd_basisInteger

Return the battler’s combat property

Returns:

  • (Integer)


395
396
# File 'docs/5_Battle_03_PokemonBattler.rb', line 395

def spd_basis
end

#spd_basis=(value)

Set the battler’s combat property

Parameters:

  • value (Integer)


399
400
# File 'docs/5_Battle_03_PokemonBattler.rb', line 399

def spd_basis=(value)
end

#spd_modifierFloat

Return the spd modifier

Returns:

  • (Float)

    the multiplier



541
542
# File 'docs/5_Battle_03_PokemonBattler.rb', line 541

def spd_modifier
end

#spd_stageInteger

Return the spd stage

Returns:

  • (Integer)


561
562
# File 'docs/5_Battle_03_PokemonBattler.rb', line 561

def spd_stage
end

#spd_stage=(value) ⇒ Integer

Set the spd stage

Parameters:

  • value (Integer)

    the new value of the stat stage

Returns:

  • (Integer)

    the new stat stage value



644
645
# File 'docs/5_Battle_03_PokemonBattler.rb', line 644

def spd_stage=(value)
end

#stat_multiplier_acceva(stage) ⇒ Float

Return the accuracy related stat multiplier

Parameters:

  • stage (Integer)

    the value of the stage

Returns:

  • (Float)

    the multiplier



587
588
# File 'docs/5_Battle_03_PokemonBattler.rb', line 587

def stat_multiplier_acceva(stage)
end

#stat_multiplier_regular(stage) ⇒ Float

Return the regular stat multiplier

Parameters:

  • stage (Integer)

    the value of the stage

Returns:

  • (Float)

    the multiplier



582
583
# File 'docs/5_Battle_03_PokemonBattler.rb', line 582

def stat_multiplier_regular(stage)
end

#status_confuse(_ = false) ⇒ Boolean

Confuse the Pokemon

Parameters:

  • _ (Boolean) (defaults to: false)

    (ignored)

Returns:

  • (Boolean)

    if the pokemon has been confused



241
242
# File 'docs/5_Battle_03_PokemonBattler.rb', line 241

def status_confuse(_ = false)
end

#status_effectBattle::Effects::Status

Get the status effect



712
713
# File 'docs/5_Battle_03_PokemonBattler.rb', line 712

def status_effect
end

#switching?Boolean

if the pokemon is switching during this turn

Returns:

  • (Boolean)


236
237
# File 'docs/5_Battle_03_PokemonBattler.rb', line 236

def switching?
end

#to_sString Also known as: inspect

Format the Battler for logging purpose

Returns:



103
104
# File 'docs/5_Battle_03_PokemonBattler.rb', line 103

def to_s
end

#type1Integer

Return the battler’s combat property

Returns:

  • (Integer)


472
473
# File 'docs/5_Battle_03_PokemonBattler.rb', line 472

def type1
end

#type1=(value)

Set the battler’s combat property

Parameters:

  • value (Integer)


476
477
# File 'docs/5_Battle_03_PokemonBattler.rb', line 476

def type1=(value)
end

#type2Integer

Return the battler’s combat property

Returns:

  • (Integer)


483
484
# File 'docs/5_Battle_03_PokemonBattler.rb', line 483

def type2
end

#type2=(value)

Set the battler’s combat property

Parameters:

  • value (Integer)


487
488
# File 'docs/5_Battle_03_PokemonBattler.rb', line 487

def type2=(value)
end

#typeless?Boolean

Is the Pokemon typeless?

Returns:

  • (Boolean)


273
274
# File 'docs/5_Battle_03_PokemonBattler.rb', line 273

def typeless?
end

#update_loyalty

Update the PFM::PokemonBattler loyalty when level up



283
284
# File 'docs/5_Battle_03_PokemonBattler.rb', line 283

def update_loyalty
end

#weightInteger

Return the battler’s combat property

Returns:

  • (Integer)


439
440
# File 'docs/5_Battle_03_PokemonBattler.rb', line 439

def weight
end

#weight=(value)

Set the battler’s combat property

Parameters:

  • value (Integer)


443
444
# File 'docs/5_Battle_03_PokemonBattler.rb', line 443

def weight=(value)
end