Class: PFM::Pokemon

Inherits:
Object show all
Includes:
ShedinjaSpecialEvolutionCase
Defined in:
docs/4_Systems_901_GTS.rb,
docs/4_Systems_000_General_1_PFM.rb

Overview

The InGame Pokemon management

Author:

  • Nuri Yuri

Direct Known Subclasses

ContestCreature, PokemonBattler

Defined Under Namespace

Modules: ShedinjaSpecialEvolutionCase Classes: ExpList

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
EGG_FILENAMES =
TODO:

Change this later

All possible attempt of finding an egg (for legacy)

['egg_%<id>03d_%<form>02d', 'egg_%<id>03d', 'egg_%<name>s_%<form>02d', 'egg_%<name>s', 'egg']
BATTLER_SIZE =

Size of a battler

96
ICON_SIZE =

Size of an icon

32
FOOT_SIZE =

Size of a footprint

16
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]
FORM_CALIBRATE =

List of form calibration hook for Creatures that needs form calibration (when switching items, being place in computer or when team changes)

{}
FORM_GENERATION =

List of form generation hook for Creatures that needs an initial form when the PFM::Pokemon object is generated.

{}
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]
OGERPONMASK =

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

%i[__undef__ wellspring_mask hearthflame_mask cornerstone_mask]
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

  • :force_pokerus (Boolean) —

    The Pokemon will be infected with pokerus

  • :force_pokerus_cured (Boolean) —

    The Pokemon will be infected with the cured version of the pokerus (override force_pokerus)

  • :strain (Integer) —

    If force_pokerus or force_pokerus_cured is true, this force the pokerus strain (clamped between 1 and 15)

  • :no_pokerus (Boolean) —

    If the Pokemon has 0% chance to have pokerus (override force_pokerus and force_pokerus_cured)

  • :conditions (Array<Integer>) —

    contest conditions array ([coolness, beauty, cuteness, cleverness, toughness, sheen])



344
345
# File 'docs/4_Systems_000_General_1_PFM.rb', line 344

def initialize(id, level, force_shiny = false, no_shiny = false, form = -1, opts = {})
end

Class Attribute Details

.evolution_criteria ⇒ Hash{ Symbol => Proc } (readonly)

List of evolution criteria

Returns:

  • (Hash{ Symbol => Proc })


1030
1031
1032
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1030

def evolution_criteria
  @evolution_criteria
end

.evolution_reason_required_criteria ⇒ Hash{ Symbol => Array<Symbol> } (readonly)

List of evolution criteria required for specific reason

Returns:

  • (Hash{ Symbol => Array<Symbol> })


1033
1034
1035
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1033

def evolution_reason_required_criteria
  @evolution_reason_required_criteria
end

Instance Attribute Details

#ability ⇒ Integer

Return the current ability of the Pokemon

Returns:

  • (Integer)


804
805
# File 'docs/4_Systems_000_General_1_PFM.rb', line 804

def ability
end

#ability_index ⇒ Integer?

Index of the ability in the Pokemon data

Returns:

  • (Integer, nil)


549
550
551
# File 'docs/4_Systems_000_General_1_PFM.rb', line 549

def ability_index
  @ability_index
end

#ability_used ⇒ Boolean

Check whether the ability has been already used in battle

Returns:

  • (Boolean)


543
544
545
# File 'docs/4_Systems_000_General_1_PFM.rb', line 543

def ability_used
  @ability_used
end

#attack_order ⇒ Integer

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

Returns:

  • (Integer)


606
607
608
# File 'docs/4_Systems_000_General_1_PFM.rb', line 606

def attack_order
  @attack_order
end

#battle_item ⇒ Integer?

ID of the item the Pokemon is holding in battle

Returns:

  • (Integer, nil)


621
622
623
# File 'docs/4_Systems_000_General_1_PFM.rb', line 621

def battle_item
  @battle_item
end

#battle_item_data ⇒ Array?

Various data information of the item during battle

Returns:

  • (Array, nil)


624
625
626
# File 'docs/4_Systems_000_General_1_PFM.rb', line 624

def battle_item_data
  @battle_item_data
end

#battle_stage ⇒ Array(Integer, Integer, Integer, Integer, Integer, Integer, Integer)

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

Returns:

  • (Array(Integer, Integer, Integer, Integer, Integer, Integer, Integer))


589
590
591
# File 'docs/4_Systems_000_General_1_PFM.rb', line 589

def battle_stage
  @battle_stage
end

#battle_turns ⇒ Integer

Number of turn the Pokemon has fought

Returns:

  • (Integer)


603
604
605
# File 'docs/4_Systems_000_General_1_PFM.rb', line 603

def battle_turns
  @battle_turns
end

#beauty ⇒ Integer Also known as: beautiful

Return the beauty condition

Returns:

  • (Integer)


568
569
570
# File 'docs/4_Systems_000_General_1_PFM.rb', line 568

def beauty
  @beauty
end

#captured_at ⇒ Integer

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

Returns:

  • (Integer)


438
439
440
# File 'docs/4_Systems_000_General_1_PFM.rb', line 438

def captured_at
  @captured_at
end

#captured_in ⇒ Integer

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

Returns:

  • (Integer)


435
436
437
# File 'docs/4_Systems_000_General_1_PFM.rb', line 435

def captured_in
  @captured_in
end

#captured_level ⇒ Integer

Level of the Pokemon when the Pokemon was caught

Returns:

  • (Integer)


441
442
443
# File 'docs/4_Systems_000_General_1_PFM.rb', line 441

def captured_level
  @captured_level
end

#captured_with ⇒ Integer

ID of the item used to catch the Pokemon

Returns:

  • (Integer)


432
433
434
# File 'docs/4_Systems_000_General_1_PFM.rb', line 432

def captured_with
  @captured_with
end

#character ⇒ String

Character filename of the Pokemon (FollowMe optimizations)

Returns:



528
529
530
# File 'docs/4_Systems_000_General_1_PFM.rb', line 528

def character
  @character
end

#cleverness ⇒ Integer Also known as: clever

Return the cleverness condition

Returns:

  • (Integer)


574
575
576
# File 'docs/4_Systems_000_General_1_PFM.rb', line 574

def cleverness
  @cleverness
end

#code ⇒ Integer

Code of the pokemon

Returns:

  • (Integer)


426
427
428
# File 'docs/4_Systems_000_General_1_PFM.rb', line 426

def code
  @code
end

#confuse ⇒ Boolean

If the pokemon is confused

Returns:

  • (Boolean)


600
601
602
# File 'docs/4_Systems_000_General_1_PFM.rb', line 600

def confuse
  @confuse
end

#coolness ⇒ Integer Also known as: cool

Return the coolness condition

Returns:

  • (Integer)


565
566
567
# File 'docs/4_Systems_000_General_1_PFM.rb', line 565

def coolness
  @coolness
end

#critical_modifier



593
594
# File 'docs/4_Systems_000_General_1_PFM.rb', line 593

def critical_modifier
end

#cuteness ⇒ Integer Also known as: cute

Return the cuteness condition

Returns:

  • (Integer)


571
572
573
# File 'docs/4_Systems_000_General_1_PFM.rb', line 571

def cuteness
  @cuteness
end

#egg_at ⇒ Integer

Time when the Egg has been obtained

Returns:

  • (Integer)


447
448
449
# File 'docs/4_Systems_000_General_1_PFM.rb', line 447

def egg_at
  @egg_at
end

#egg_how_obtained ⇒ Symbol (readonly)

How the egg was obtained

Returns:

  • (Symbol)


450
451
452
# File 'docs/4_Systems_000_General_1_PFM.rb', line 450

def egg_how_obtained
  @egg_how_obtained
end

#egg_in ⇒ Integer

Zone (id) where the Egg has been obtained

Returns:

  • (Integer)


444
445
446
# File 'docs/4_Systems_000_General_1_PFM.rb', line 444

def egg_in
  @egg_in
end

#ev_atk ⇒ Integer

ATK Effort Value

Returns:

  • (Integer)


474
475
476
# File 'docs/4_Systems_000_General_1_PFM.rb', line 474

def ev_atk
  @ev_atk
end

#ev_ats ⇒ Integer

ATS Effort Value

Returns:

  • (Integer)


483
484
485
# File 'docs/4_Systems_000_General_1_PFM.rb', line 483

def ev_ats
  @ev_ats
end

#ev_dfe ⇒ Integer

DFE Effort Value

Returns:

  • (Integer)


477
478
479
# File 'docs/4_Systems_000_General_1_PFM.rb', line 477

def ev_dfe
  @ev_dfe
end

#ev_dfs ⇒ Integer

DFS Effort Value

Returns:

  • (Integer)


486
487
488
# File 'docs/4_Systems_000_General_1_PFM.rb', line 486

def ev_dfs
  @ev_dfs
end

#ev_hp ⇒ Integer

HP Effort Value

Returns:

  • (Integer)


471
472
473
# File 'docs/4_Systems_000_General_1_PFM.rb', line 471

def ev_hp
  @ev_hp
end

#ev_spd ⇒ Integer

SPD Effort Value

Returns:

  • (Integer)


480
481
482
# File 'docs/4_Systems_000_General_1_PFM.rb', line 480

def ev_spd
  @ev_spd
end

#evolve_var ⇒ Integer?

Variable responsible of holding the value used for various evolution methods

Returns:

  • (Integer, nil)


558
559
560
# File 'docs/4_Systems_000_General_1_PFM.rb', line 558

def evolve_var
  @evolve_var
end

#exp ⇒ Integer

The total amount of exp the Pokemon got

Returns:

  • (Integer)


420
421
422
# File 'docs/4_Systems_000_General_1_PFM.rb', line 420

def exp
  @exp
end

#exp_rate ⇒ Float

The rate of exp point the Pokemon has in its level

Returns:

  • (Float)


513
514
515
# File 'docs/4_Systems_000_General_1_PFM.rb', line 513

def exp_rate
  @exp_rate
end

#form ⇒ Integer

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

Returns:

  • (Integer)


468
469
470
# File 'docs/4_Systems_000_General_1_PFM.rb', line 468

def form
  @form
end

#game_code ⇒ Integer?

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

Returns:

  • (Integer, nil)


312
313
314
# File 'docs/4_Systems_901_GTS.rb', line 312

def game_code
  @game_code
end

#gender ⇒ Integer

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

Returns:

  • (Integer)


462
463
464
# File 'docs/4_Systems_000_General_1_PFM.rb', line 462

def gender
  @gender
end

#given_name ⇒ String Also known as: nickname

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

Returns:



459
460
461
# File 'docs/4_Systems_000_General_1_PFM.rb', line 459

def given_name
  @given_name
end

#hp ⇒ Integer

The current HP the Pokemon has

Returns:

  • (Integer)


423
424
425
# File 'docs/4_Systems_000_General_1_PFM.rb', line 423

def hp
  @hp
end

#hp_rate ⇒ Float

The rate of HP the Pokemon has

Returns:

  • (Float)


510
511
512
# File 'docs/4_Systems_000_General_1_PFM.rb', line 510

def hp_rate
  @hp_rate
end

#id ⇒ Integer

ID of the Pokemon in the database

Returns:

  • (Integer)


414
415
416
# File 'docs/4_Systems_000_General_1_PFM.rb', line 414

def id
  @id
end

#item_holding ⇒ Integer

ID of the item the Pokemon is holding

Returns:

  • (Integer)


516
517
518
# File 'docs/4_Systems_000_General_1_PFM.rb', line 516

def item_holding
  @item_holding
end

#iv_atk ⇒ Integer

ATK Individual Value

Returns:

  • (Integer)


492
493
494
# File 'docs/4_Systems_000_General_1_PFM.rb', line 492

def iv_atk
  @iv_atk
end

#iv_ats ⇒ Integer

ATS Individual Value

Returns:

  • (Integer)


501
502
503
# File 'docs/4_Systems_000_General_1_PFM.rb', line 501

def iv_ats
  @iv_ats
end

#iv_dfe ⇒ Integer

DFE Individual Value

Returns:

  • (Integer)


495
496
497
# File 'docs/4_Systems_000_General_1_PFM.rb', line 495

def iv_dfe
  @iv_dfe
end

#iv_dfs ⇒ Integer

DFS Individual Value

Returns:

  • (Integer)


504
505
506
# File 'docs/4_Systems_000_General_1_PFM.rb', line 504

def iv_dfs
  @iv_dfs
end

#iv_hp ⇒ Integer

HP Individual Value

Returns:

  • (Integer)


489
490
491
# File 'docs/4_Systems_000_General_1_PFM.rb', line 489

def iv_hp
  @iv_hp
end

#iv_spd ⇒ Integer

SPD Individual Value

Returns:

  • (Integer)


498
499
500
# File 'docs/4_Systems_000_General_1_PFM.rb', line 498

def iv_spd
  @iv_spd
end

#level ⇒ Integer

Current Level of the Pokemon

Returns:

  • (Integer)


417
418
419
# File 'docs/4_Systems_000_General_1_PFM.rb', line 417

def level
  @level
end

#loyalty ⇒ Integer

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

Returns:

  • (Integer)


465
466
467
# File 'docs/4_Systems_000_General_1_PFM.rb', line 465

def loyalty
  @loyalty
end

#memo_text ⇒ Array<Integer>

Memo text [file_id, text_id]

Returns:

  • (Array<Integer>)


531
532
533
# File 'docs/4_Systems_000_General_1_PFM.rb', line 531

def memo_text
  @memo_text
end

#nature ⇒ Array<Integer>

Return the nature data of the Pokemon

Returns:

  • (Array<Integer>) —

    [text_id, atk%, dfe%, spd%, ats%, dfs%]



752
753
# File 'docs/4_Systems_000_General_1_PFM.rb', line 752

def nature
end

#pokerus ⇒ Byte

Represent the Pokerus caracteristics of the Pokemon



562
563
564
# File 'docs/4_Systems_000_General_1_PFM.rb', line 562

def pokerus
  @pokerus
end

#position ⇒ Integer?

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

Returns:

  • (Integer, nil)


597
598
599
# File 'docs/4_Systems_000_General_1_PFM.rb', line 597

def position
  @position
end

#prepared_skill ⇒ Integer

ID of the skill the Pokemon would like to use

Returns:

  • (Integer)


609
610
611
# File 'docs/4_Systems_000_General_1_PFM.rb', line 609

def prepared_skill
  @prepared_skill
end

#ribbons ⇒ Array<Ribbon>

List of Ribbons the Creature has

Returns:



534
535
536
# File 'docs/4_Systems_000_General_1_PFM.rb', line 534

def ribbons
  @ribbons
end

#sheen ⇒ Integer

Return the sheen

Returns:

  • (Integer)


580
581
582
# File 'docs/4_Systems_000_General_1_PFM.rb', line 580

def sheen
  @sheen
end

#skill_learnt ⇒ Array<Integer> (readonly)

List of Skill id the Pokemon learnt during its life

Returns:

  • (Array<Integer>)


537
538
539
# File 'docs/4_Systems_000_General_1_PFM.rb', line 537

def skill_learnt
  @skill_learnt
end

#skills_set ⇒ Array<PFM::Skill> Also known as: moveset

The current moveset of the Pokemon

Returns:



540
541
542
# File 'docs/4_Systems_000_General_1_PFM.rb', line 540

def skills_set
  @skills_set
end

#status ⇒ Integer

ID of the status of the Pokemon

Returns:

  • (Integer)


552
553
554
# File 'docs/4_Systems_000_General_1_PFM.rb', line 552

def status
  @status
end

#status_count ⇒ Integer

Internal status counter that helps some status to terminate or worsen

Returns:

  • (Integer)


555
556
557
# File 'docs/4_Systems_000_General_1_PFM.rb', line 555

def status_count
  @status_count
end

#step_remaining ⇒ Integer

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

Returns:

  • (Integer)


429
430
431
# File 'docs/4_Systems_000_General_1_PFM.rb', line 429

def step_remaining
  @step_remaining
end

#sub_code ⇒ Integer?

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

Returns:

  • (Integer, nil)


615
616
617
# File 'docs/4_Systems_000_General_1_PFM.rb', line 615

def sub_code
  @sub_code
end

#sub_form ⇒ Integer?

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

Returns:

  • (Integer, nil)


618
619
620
# File 'docs/4_Systems_000_General_1_PFM.rb', line 618

def sub_form
  @sub_form
end

#sub_id ⇒ Integer?

Real id of the Pokemon when used transform

Returns:

  • (Integer, nil)


612
613
614
# File 'docs/4_Systems_000_General_1_PFM.rb', line 612

def sub_id
  @sub_id
end

#title_ribbon ⇒ Symbol?

Symbol of the Ribbon giving the Creature a title

Returns:

  • (Symbol, nil)


583
584
585
# File 'docs/4_Systems_000_General_1_PFM.rb', line 583

def title_ribbon
  @title_ribbon
end

#toughness ⇒ Integer Also known as: tough

Return the toughness condition

Returns:

  • (Integer)


577
578
579
# File 'docs/4_Systems_000_General_1_PFM.rb', line 577

def toughness
  @toughness
end

#trainer_id ⇒ Integer

Return the normalized trainer id of the Pokemon

Returns:

  • (Integer)


788
789
# File 'docs/4_Systems_000_General_1_PFM.rb', line 788

def trainer_id
end

#trainer_name ⇒ String

Name of the original trainer

Returns:



456
457
458
# File 'docs/4_Systems_000_General_1_PFM.rb', line 456

def trainer_name
  @trainer_name
end

#type1 ⇒ Integer

Return the current first type of the Pokemon

Returns:

  • (Integer)


1875
1876
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1875

def type1
end

#type2 ⇒ Integer

Return the current second type of the Pokemon

Returns:

  • (Integer)


1879
1880
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1879

def type2
end

#type3 ⇒ Integer

Return the current third type of the Pokemon

Returns:

  • (Integer)


1883
1884
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1883

def type3
end

#unbound ⇒ Integer

Hoopa unbound value

Returns:

  • (Integer)


586
587
588
# File 'docs/4_Systems_000_General_1_PFM.rb', line 586

def unbound
  @unbound
end

Class Method Details

.add_evolution_criteria(key, reasons = nil, &block)

Add a new evolution criteria

Parameters:

  • key (Symbol) —

    hash key expected in special evolution

  • reasons (Array<Symbol>) (defaults to: nil) —

    evolution reasons that require this criteria in order to allow evolution

  • block (Proc) —

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



1038
1039
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1038

def add_evolution_criteria(key, reasons = nil, &block)
end

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

Return the back 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:



884
885
# File 'docs/4_Systems_000_General_1_PFM.rb', line 884

def back_filename(id, form, female, shiny, egg)
end

.back_gif_filename(id, form, female, shiny, egg) ⇒ String?

Return the back gif 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:



893
894
# File 'docs/4_Systems_000_General_1_PFM.rb', line 893

def back_gif_filename(id, form, female, shiny, egg)
end

.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:



866
867
# File 'docs/4_Systems_000_General_1_PFM.rb', line 866

def front_filename(id, form, female, shiny, egg)
end

.front_gif_filename(id, form, female, shiny, egg) ⇒ String?

Return the front gif 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:



875
876
# File 'docs/4_Systems_000_General_1_PFM.rb', line 875

def front_gif_filename(id, form, female, shiny, egg)
end

.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]) (file_id = csv - 100000; 103.csv = -99897; etc.)

  • :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:



2035
2036
# File 'docs/4_Systems_000_General_1_PFM.rb', line 2035

def generate_from_hash(hash)
end

.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:



857
858
# File 'docs/4_Systems_000_General_1_PFM.rb', line 857

def icon_filename(id, form, female, shiny, egg)
end

.missing_resources_error(id) ⇒ String

Display an error in case of missing resources and fallback to the default one

Parameters:

  • id (Integer, Symbol) —

    ID of the Pokemon

Returns:



898
899
# File 'docs/4_Systems_000_General_1_PFM.rb', line 898

def missing_resources_error(id)
end

Instance Method Details

#ability_db_symbol ⇒ Symbol

Return the db_symbol of the Pokemon's Ability

Returns:

  • (Symbol)


808
809
# File 'docs/4_Systems_000_General_1_PFM.rb', line 808

def ability_db_symbol
end

#ability_descr ⇒ String

Reture the description of the current ability of the Pokemon

Returns:



2099
2100
# File 'docs/4_Systems_000_General_1_PFM.rb', line 2099

def ability_descr
end

#ability_name ⇒ String

Return the name of the current ability of the Pokemon

Returns:



2095
2096
# File 'docs/4_Systems_000_General_1_PFM.rb', line 2095

def ability_name
end

#absofusion(pokemon)

Absofusion of the Pokemon (if possible)

Parameters:

  • pokemon —

    PFM::Pokemon The Pokemon used in the fusion



1315
1316
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1315

def absofusion(pokemon)
end

#absofusionned? ⇒ Boolean

If the Pokemon is a absofusion

Returns:

  • (Boolean)


1321
1322
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1321

def absofusionned?
end

#acc_stage ⇒ Integer

Return the accuracy stage

Returns:

  • (Integer)


1568
1569
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1568

def acc_stage
end

#add_bonus(list) ⇒ Boolean?

Add ev bonus to a Pokemon

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)



956
957
# File 'docs/4_Systems_000_General_1_PFM.rb', line 956

def add_bonus(list)
end

#add_ev_atk(n, evs) ⇒ Boolean

Safely add ATK EV

Parameters:

  • n (Integer) —

    amount of EV to add

  • evs (Integer) —

    total ev

Returns:

  • (Boolean) —

    if the ev has successfully been added



995
996
# File 'docs/4_Systems_000_General_1_PFM.rb', line 995

def add_ev_atk(n, evs)
end

#add_ev_ats(n, evs) ⇒ Boolean

Safely add ATS EV

Parameters:

  • n (Integer) —

    amount of EV to add

  • evs (Integer) —

    total ev

Returns:

  • (Boolean) —

    if the ev has successfully been added



1013
1014
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1013

def add_ev_ats(n, evs)
end

#add_ev_dfe(n, evs) ⇒ Boolean

Safely add DFE EV

Parameters:

  • n (Integer) —

    amount of EV to add

  • evs (Integer) —

    total ev

Returns:

  • (Boolean) —

    if the ev has successfully been added



1001
1002
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1001

def add_ev_dfe(n, evs)
end

#add_ev_dfs(n, evs) ⇒ Boolean

Safely add DFS EV

Parameters:

  • n (Integer) —

    amount of EV to add

  • evs (Integer) —

    total ev

Returns:

  • (Boolean) —

    if the ev has successfully been added



1019
1020
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1019

def add_ev_dfs(n, evs)
end

#add_ev_hp(n, evs) ⇒ Boolean

Safely add HP EV

Parameters:

  • n (Integer) —

    amount of EV to add

  • evs (Integer) —

    total ev

Returns:

  • (Boolean) —

    if the ev has successfully been added



989
990
# File 'docs/4_Systems_000_General_1_PFM.rb', line 989

def add_ev_hp(n, evs)
end

#add_ev_spd(n, evs) ⇒ Boolean

Safely add SPD EV

Parameters:

  • n (Integer) —

    amount of EV to add

  • evs (Integer) —

    total ev

Returns:

  • (Boolean) —

    if the ev has successfully been added



1007
1008
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1007

def add_ev_spd(n, evs)
end

#add_ribbon(symbol)

Add a ribbon to the Creature

Parameters:

  • symbol (Symbol) —

    Symbol of the ribbon



812
813
# File 'docs/4_Systems_000_General_1_PFM.rb', line 812

def add_ribbon(symbol)
end

#adjust_hp_to_max_hp

Recompute the current HP against the current max HP, preserving the HP ratio. Used after a max HP change (e.g. HP EV gain) so a full Pokemon stays full.



1673
1674
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1673

def adjust_hp_to_max_hp
end

#alive? ⇒ Boolean

Is the Pokemon able to fight

Returns:

  • (Boolean)


1780
1781
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1780

def alive?
end

#asleep? ⇒ Boolean

Is the Pokemon asleep?

Returns:

  • (Boolean)


1834
1835
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1834

def asleep?
end

#atk ⇒ Integer

Return the current atk

Returns:

  • (Integer)


1524
1525
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1524

def atk
end

#atk_basis ⇒ Integer

Return the atk stat without battle modifier

Returns:

  • (Integer)


1648
1649
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1648

def atk_basis
end

#atk_modifier ⇒ Float

Return the atk modifier

Returns:

  • (Float) —

    the multiplier



1618
1619
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1618

def atk_modifier
end

#atk_stage ⇒ Integer

Return the atk stage

Returns:

  • (Integer)


1544
1545
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1544

def atk_stage
end

#ats ⇒ Integer

Return the current ats

Returns:

  • (Integer)


1536
1537
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1536

def ats
end

#ats_basis ⇒ Integer

Return the ats stat without battle modifier

Returns:

  • (Integer)


1660
1661
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1660

def ats_basis
end

#ats_modifier ⇒ Float

Return the ats modifier

Returns:

  • (Float) —

    the multiplier



1630
1631
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1630

def ats_modifier
end

#ats_stage ⇒ Integer

Return the ats stage

Returns:

  • (Integer)


1556
1557
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1556

def ats_stage
end

#ball_color ⇒ Color

Return the ball color of the Pokemon (flash)

Returns:



784
785
# File 'docs/4_Systems_000_General_1_PFM.rb', line 784

def ball_color
end

#ball_image ⇒ Texture

Return the ball image of the Pokemon

Returns:



847
848
# File 'docs/4_Systems_000_General_1_PFM.rb', line 847

def ball_image
end

#ball_sprite ⇒ String

Return the ball sprite name of the Pokemon

Returns:

  • (String) —

    Sprite to load in Graphics/ball/



780
781
# File 'docs/4_Systems_000_General_1_PFM.rb', line 780

def ball_sprite
end

#base_atk ⇒ Integer

Return the base ATK

Returns:

  • (Integer)


1500
1501
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1500

def base_atk
end

#base_ats ⇒ Integer

Return the base ATS

Returns:

  • (Integer)


1512
1513
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1512

def base_ats
end

#base_dfe ⇒ Integer

Return the base DFE

Returns:

  • (Integer)


1504
1505
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1504

def base_dfe
end

#base_dfs ⇒ Integer

Return the base DFS

Returns:

  • (Integer)


1516
1517
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1516

def base_dfs
end

#base_exp ⇒ Integer

Return the base experience of the Pokemon

Returns:

  • (Integer)


1043
1044
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1043

def base_exp
end

#base_hp ⇒ Integer

Return the base HP

Returns:

  • (Integer)


1496
1497
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1496

def base_hp
end

#base_spd ⇒ Integer

Return the base SPD

Returns:

  • (Integer)


1508
1509
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1508

def base_spd
end

#battle_list ⇒ Array<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]



951
952
# File 'docs/4_Systems_000_General_1_PFM.rb', line 951

def battle_list
end

#battler_back ⇒ Texture

Return the back battle of the Pokemon

Returns:



926
927
# File 'docs/4_Systems_000_General_1_PFM.rb', line 926

def battler_back
end

#battler_face ⇒ Texture Also known as: battler_front

Return the front battler of the Pokemon

Returns:



921
922
# File 'docs/4_Systems_000_General_1_PFM.rb', line 921

def battler_face
end

#burn? ⇒ Boolean Also known as: burnt?

Is the Pokemon burnt?

Returns:

  • (Boolean)


1820
1821
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1820

def burn?
end

#calyrex_form(reason)

Determine the form of the Calyrex

Parameters:

  • reason (Symbol) —

    The db_symbol of the Pokemon used for the fusion



1371
1372
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1371

def calyrex_form(reason)
end

#can_be_asleep? ⇒ Boolean

Can the Pokemon be asleep?

Returns:

  • (Boolean)


1844
1845
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1844

def can_be_asleep?
end

#can_be_burn? ⇒ Boolean

Can the Pokemon be burnt?

Returns:

  • (Boolean)


1830
1831
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1830

def can_be_burn?
end

#can_be_frozen?(skill_type = 0) ⇒ Boolean

Can the Pokemon be frozen?

Returns:

  • (Boolean)


1861
1862
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1861

def can_be_frozen?(skill_type = 0)
end

#can_be_paralyzed? ⇒ Boolean

Can the Pokemon be paralyzed?

Returns:

  • (Boolean)


1816
1817
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1816

def can_be_paralyzed?
end

#can_be_poisoned? ⇒ Boolean

Can the Pokemon be poisoned ?

Returns:

  • (Boolean)


1803
1804
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1803

def can_be_poisoned?
end

#can_learn?(db_symbol) ⇒ Boolean?

Check if the Pokemon can learn a skill

Parameters:

  • db_symbol (Integer, Symbol) —

    id or db_symbol of the move

Returns:

  • (Boolean, nil) —

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



1478
1479
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1478

def can_learn?(db_symbol)
end

#can_learn_skill_at_this_level?(level = @level) ⇒ Boolean

Can learn skill at this level

Parameters:

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

Returns:

  • (Boolean)


1473
1474
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1473

def can_learn_skill_at_this_level?(level = @level)
end

#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



1299
1300
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1299

def can_mega_evolve?
end

#captured_zone_name ⇒ String

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

Returns:



2083
2084
# File 'docs/4_Systems_000_General_1_PFM.rb', line 2083

def captured_zone_name
end

#castform_form(reason)

Determine the form of Castform

Parameters:

  • reason (Symbol)


1375
1376
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1375

def castform_form(reason)
end

#caught_by_player? ⇒ Boolean

Tell if the Pokemon is caught by the trainer

Returns:

  • (Boolean)


723
724
# File 'docs/4_Systems_000_General_1_PFM.rb', line 723

def caught_by_player?
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



1609
1610
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1609

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



1579
1580
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1579

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



1594
1595
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1594

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



1584
1585
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1584

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



1599
1600
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1599

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



1604
1605
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1604

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



1589
1590
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1589

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



1574
1575
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1574

def change_stat(stat_id, amount)
end

#character_name ⇒ String

Return the character name of the Pokemon

Returns:



934
935
# File 'docs/4_Systems_000_General_1_PFM.rb', line 934

def character_name
end

#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 (<= 0 = evolution)



1469
1470
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1469

def check_skill_and_learn(silent = false, level = @level)
end

#cherrim_form(reason) ⇒ Integer

Determine Cherrim's form

Parameters:

  • reason (Symbol)

Returns:

  • (Integer) —

    Cherrim's form number



1380
1381
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1380

def cherrim_form(reason)
end

#contest_conditions ⇒ Array<Integer>

Return the conditions related to contests

Returns:

  • (Array<Integer>)


1771
1772
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1771

def contest_conditions
end

#cramorant_form(reason)

Determine the form of Cramorant

Parameters:

  • reason (Symbol)


1367
1368
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1367

def cramorant_form(reason)
end

#cry ⇒ String

Return the cry file name of the Pokemon

Returns:



938
939
# File 'docs/4_Systems_000_General_1_PFM.rb', line 938

def cry
end

#cure

Cure the Pokemon from its statues modifications



1787
1788
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1787

def cure
end

#current_deerling_form ⇒ Integer

Calculate the form of deerling & sawsbuck

Returns:

  • (Integer) —

    the right form



1338
1339
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1338

def current_deerling_form
end

#data ⇒ Studio::CreatureForm Also known as: get_data

Get the current data of the Pokemon



631
632
# File 'docs/4_Systems_000_General_1_PFM.rb', line 631

def data
end

#db_symbol ⇒ Symbol

Return the db_symbol of the Pokemon in the database

Returns:

  • (Symbol)


702
703
# File 'docs/4_Systems_000_General_1_PFM.rb', line 702

def db_symbol
end

#dead? ⇒ Boolean

Is the Pokemon not able to fight

Returns:

  • (Boolean)


1776
1777
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1776

def dead?
end

#decrease_hoopa_days

Note:

If 0 is reached, Hoopa goes back to base form.

Note:

If the pokemon is not infected or is already cured, does nothing.

Decrease by one day the Hoopa unbound counter.



698
699
# File 'docs/4_Systems_000_General_1_PFM.rb', line 698

def decrease_hoopa_days
end

#decrease_pokerus_days

Note:

If 0 is reached, the Pokerus is cured.

Note:

If the pokemon is not infected or is already cured, does nothing.

Decrease by one day the Pokerus counter.



687
688
# File 'docs/4_Systems_000_General_1_PFM.rb', line 687

def decrease_pokerus_days
end

#dfe ⇒ Integer

Return the current dfe

Returns:

  • (Integer)


1528
1529
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1528

def dfe
end

#dfe_basis ⇒ Integer

Return the dfe stat without battle modifier

Returns:

  • (Integer)


1652
1653
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1652

def dfe_basis
end

#dfe_modifier ⇒ Float

Return the dfe modifier

Returns:

  • (Float) —

    the multiplier



1622
1623
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1622

def dfe_modifier
end

#dfe_stage ⇒ Integer

Return the dfe stage

Returns:

  • (Integer)


1548
1549
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1548

def dfe_stage
end

#dfs ⇒ Integer

Return the current dfs

Returns:

  • (Integer)


1540
1541
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1540

def dfs
end

#dfs_basis ⇒ Integer

Return the dfs stat without battle modifier

Returns:

  • (Integer)


1664
1665
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1664

def dfs_basis
end

#dfs_modifier ⇒ Float

Return the dfs modifier

Returns:

  • (Float) —

    the multiplier



1634
1635
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1634

def dfs_modifier
end

#dfs_stage ⇒ Integer

Return the dfs stage

Returns:

  • (Integer)


1560
1561
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1560

def dfs_stage
end

#dv_modifier(list)

Change the IV and update the statistics

Parameters:

  • list (Array<Integer>) —

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



1638
1639
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1638

def dv_modifier(list)
end

#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)



965
966
# File 'docs/4_Systems_000_General_1_PFM.rb', line 965

def edit_bonus(list)
end

#egg? ⇒ Boolean Also known as: egg

Tell if the Pokemon is an egg or not

Returns:

  • (Boolean)


706
707
# File 'docs/4_Systems_000_General_1_PFM.rb', line 706

def egg?
end

#egg_finish

Ends the egg process of the Pokemon



351
352
# File 'docs/4_Systems_000_General_1_PFM.rb', line 351

def egg_finish
end

#egg_init(egg_how_obtained = :received)

Initialize the egg process of the Pokemon

Parameters:

  • egg_how_obtained (Symbol) (defaults to: :received) —

    :reveived => When you received the egg (ex: Daycare), :found => When you found the egg (ex: On the map)



348
349
# File 'docs/4_Systems_000_General_1_PFM.rb', line 348

def egg_init(egg_how_obtained = :received)
end

#egg_zone_name ⇒ String

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

Returns:



2087
2088
# File 'docs/4_Systems_000_General_1_PFM.rb', line 2087

def egg_zone_name
end

#elv_1000steps ⇒ Boolean

Check evolve condition to evolve after 1000 steps (Bramblin, Pawmo and Rellor)

Returns:

  • (Boolean) —

    if the condition is valid



1223
1224
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1223

def elv_1000steps
end

#elv_1percent ⇒ Boolean

Check evolve condition for 1% of creatures

Returns:

  • (Boolean) —

    if the condition is valid



1200
1201
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1200

def elv_1percent
end

#elv_99percent ⇒ Boolean

Note:

Modulo returns a number between 0 and 99

Check evolve condition for 99% of creatures

Returns:

  • (Boolean) —

    if the condition is valid



1196
1197
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1196

def elv_99percent
end

#elv_annihilape

Check evolve condition for Primeape into Annihilape



1207
1208
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1207

def elv_annihilape
end

#elv_armulys ⇒ Boolean

Check evolve condition to evolve in Silcoon (Armulys)

Returns:

  • (Boolean) —

    if the condition is valid



1162
1163
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1162

def elv_armulys
end

#elv_basculin ⇒ Boolean

Check evolve condition to evolve Basculin into Basculegion

Returns:

  • (Boolean) —

    if the condition is valid



1219
1220
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1219

def elv_basculin
end

#elv_blindalys ⇒ Boolean

Check evolve condition to evolve in Cascoon (Blindalys)

Returns:

  • (Boolean) —

    if the condition is valid



1166
1167
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1166

def elv_blindalys
end

#elv_demanta ⇒ Boolean

Check evolve condition to evolve in Mantine

Returns:

  • (Boolean) —

    if the condition is valid



1170
1171
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1170

def elv_demanta
end

#elv_gimmighoul ⇒ Boolean

Check evolve condition to evolve into Gholdengo

Returns:

  • (Boolean) —

    if the condition is valid



1215
1216
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1215

def elv_gimmighoul
end

#elv_kapoera ⇒ Boolean

Check evolve condition to evolve in Hitmontop (Kapoera)

Returns:

  • (Boolean) —

    if the condition is valid



1158
1159
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1158

def elv_kapoera
end

#elv_kicklee ⇒ Boolean

Check evolve condition to evolve in Hitmonlee (kicklee)

Returns:

  • (Boolean) —

    if the condition is valid



1150
1151
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1150

def elv_kicklee
end

#elv_kingambit ⇒ Boolean

Check evolve condition to evolve Bisharp into Kingambit

Returns:

  • (Boolean) —

    if the condition is valid



1211
1212
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1211

def elv_kingambit
end

#elv_nymphali ⇒ Boolean

Check evolve condition to evolve in Sylveon (Nymphali)

Returns:

  • (Boolean) —

    if the condition is valid



1183
1184
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1183

def elv_nymphali
end

#elv_pandarbare ⇒ Boolean

Check evolve condition to evolve in Pangoro (Pandarbare)

Returns:

  • (Boolean) —

    if the condition is valid



1174
1175
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1174

def elv_pandarbare
end

#elv_sepiatroce ⇒ Boolean

Note:

uses :DOWN to validate the evolve condition

Check evolve condition to evolve in Malamar (Sepiatroce)

Returns:

  • (Boolean) —

    if the condition is valid



1179
1180
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1179

def elv_sepiatroce
end

#elv_sirfetchd ⇒ Boolean

Check evolve condition to evolve Farfetch'd-G into Sirfetch'd

Returns:

  • (Boolean) —

    if the condition is valid



1204
1205
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1204

def elv_sirfetchd
end

#elv_toxtricity_amped

Check evolve condition to evolve in Toxtricity-amped (Salarsen-aigüe) [0, 2, 3, 4, 6, 8, 9, 11, 13, 14, 19, 22, 24] return [Boolean] if the condition is valid



1188
1189
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1188

def elv_toxtricity_amped
end

#elv_toxtricity_low_key

Check evolve condition when not in Toxtricity-low-key (Salarsen-grave)



1191
1192
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1191

def elv_toxtricity_low_key
end

#elv_tygnon ⇒ Boolean

Check evolve condition to evolve in Hitmonchan (tygnon)

Returns:

  • (Boolean) —

    if the condition is valid



1154
1155
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1154

def elv_tygnon
end

#elv_ursaring ⇒ Boolean

Check evolve condition to evolve Ursaring into Ursaluna

Returns:

  • (Boolean) —

    if the condition is valid



1227
1228
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1227

def elv_ursaring
end

#encode ⇒ String

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

Returns:



315
316
# File 'docs/4_Systems_901_GTS.rb', line 315

def encode
end

#ev_atk_text ⇒ String

Return the EV ATK text

Returns:



1681
1682
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1681

def ev_atk_text
end

#ev_ats_text ⇒ String

Return the EV ATS text

Returns:



1693
1694
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1693

def ev_ats_text
end

#ev_check(index, apply = false, count = 1) ⇒ 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

  • count (Integer) (defaults to: 1) —

    number of EV to add

Returns:

  • (Integer, false) —

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



976
977
# File 'docs/4_Systems_000_General_1_PFM.rb', line 976

def ev_check(index, apply = false, count = 1)
end

#ev_dfe_text ⇒ String

Return the EV DFE text

Returns:



1685
1686
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1685

def ev_dfe_text
end

#ev_dfs_text ⇒ String

Return the EV DFS text

Returns:



1697
1698
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1697

def ev_dfs_text
end

#ev_hp_text ⇒ String

Return the EV HP text

Returns:



1677
1678
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1677

def ev_hp_text
end

#ev_modifier ⇒ Integer

Return the EV modifier depending on some conditions

Returns:

  • (Integer) —

    the EV modifier



960
961
# File 'docs/4_Systems_000_General_1_PFM.rb', line 960

def ev_modifier
end

#ev_spd_text ⇒ String

Return the EV SPD text

Returns:



1689
1690
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1689

def ev_spd_text
end

#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:

  • (Integer)


983
984
# File 'docs/4_Systems_000_General_1_PFM.rb', line 983

def ev_var(index, evs, value = 0)
end

#eva_stage ⇒ Integer

Return the evasion stage

Returns:

  • (Integer)


1564
1565
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1564

def eva_stage
end

#evolution_condition_function?(function_name) ⇒ Symbol

Returns if the creature has a custom evolution condition

Returns:

  • (Symbol) —

    the custom evolution method name or nil if none exists



1092
1093
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1092

def evolution_condition_function?(function_name)
end

#evolve(id, form)

Method that actually make a Pokemon evolve

Parameters:

  • id (Integer) —

    ID of the Pokemon that evolve

  • form (Integer, nil) —

    form of the Pokemon that evolve



1126
1127
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1126

def evolve(id, form)
end

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

Check if the creature 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



1098
1099
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1098

def evolve_check(reason = :level_up, extend_data = nil)
end

#exp_list ⇒ ExpList

Return the exp curve

Returns:



1051
1052
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1051

def exp_list
end

#exp_lvl ⇒ Integer

Return the required total exp (so including old levels) to increase the Pokemon's level

Returns:

  • (Integer)


1055
1056
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1055

def exp_lvl
end

#exp_remaining_text ⇒ String

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

Returns:



1059
1060
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1059

def exp_remaining_text
end

#exp_text ⇒ String

Return the text of the current pokemon experience

Returns:



1063
1064
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1063

def exp_text
end

#exp_type ⇒ Integer

Return the exp curve type ID

Returns:

  • (Integer)


1047
1048
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1047

def exp_type
end

#female? ⇒ Boolean

Tell if the Pokemon is a female

Returns:

  • (Boolean)


744
745
# File 'docs/4_Systems_000_General_1_PFM.rb', line 744

def female?
end

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

Find a skill in the moveset of the Pokemon

Parameters:

  • db_symbol (Symbol) —

    db_symbol of the skill in the database

Returns:



1464
1465
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1464

def find_skill(db_symbol)
end

#flags ⇒ Integer

Get Pokemon flags

Returns:

  • (Integer)


715
716
# File 'docs/4_Systems_000_General_1_PFM.rb', line 715

def flags
end

#flags=(flag)

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

Parameters:

  • flag (Integer) —

    the new flag



711
712
# File 'docs/4_Systems_000_General_1_PFM.rb', line 711

def flags=(flag)
end

#flavor_disliked?(flavor) ⇒ Boolean

Tell if the Creature dislikes flavor

Parameters:

  • flavor (Symbol)

Returns:

  • (Boolean)


2149
2150
# File 'docs/4_Systems_000_General_1_PFM.rb', line 2149

def flavor_disliked?(flavor)
end

#flavor_liked?(flavor) ⇒ Boolean

Tell if the Creature likes flavor

Parameters:

  • flavor (Symbol)

Returns:

  • (Boolean)


2145
2146
# File 'docs/4_Systems_000_General_1_PFM.rb', line 2145

def flavor_liked?(flavor)
end

#forget_skill(db_symbol, delete_from_learnt: false)

Forget a skill by its id

Parameters:

  • db_symbol (Symbol) —

    db_symbol of the move in the database

  • delete_from_learnt (Boolean) (defaults to: false) —

    if the skill should be deleted from the skill_learnt attribute of the Pokemon



1442
1443
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1442

def forget_skill(db_symbol, delete_from_learnt: false)
end

#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



1334
1335
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1334

def form_calibrate(reason = :menu)
end

#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:

  • (Integer) —

    the form index



1327
1328
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1327

def form_generation(form, old_value = nil)
end

#form_name ⇒ String

Return the Pokemon form name in the Pokedex

Returns:



2052
2053
# File 'docs/4_Systems_000_General_1_PFM.rb', line 2052

def form_name
end

#form_name_upper ⇒ String

Return the Pokemon form name upcase in the Pokedex

Returns:



2056
2057
# File 'docs/4_Systems_000_General_1_PFM.rb', line 2056

def form_name_upper
end

#from_past? ⇒ Boolean

Tell if the pokemon is from a past version

Returns:

  • (Boolean)


719
720
# File 'docs/4_Systems_000_General_1_PFM.rb', line 719

def from_past?
end

#from_player? ⇒ Boolean

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

Returns:

  • (Boolean)


792
793
# File 'docs/4_Systems_000_General_1_PFM.rb', line 792

def from_player?
end

#front_offset_y ⇒ Integer

Return the front offset y of the Pokemon

Returns:

  • (Integer)


930
931
# File 'docs/4_Systems_000_General_1_PFM.rb', line 930

def front_offset_y
end

#frozen? ⇒ Boolean

Is the Pokemon frozen?

Returns:

  • (Boolean)


1852
1853
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1852

def frozen?
end

#fully_heal

Heal the pokemon when it is captured with a Heal Ball



1790
1791
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1790

def fully_heal
end

#genderless? ⇒ Boolean

Tell if the Pokemon is genderless

Returns:

  • (Boolean)


736
737
# File 'docs/4_Systems_000_General_1_PFM.rb', line 736

def genderless?
end

#get_dv_value(value, old) ⇒ Integer

Get the adjusted IV

Parameters:

  • value (Integer) —

    the new value

  • old (Integer) —

    the old value

Returns:

  • (Integer) —

    something between old and 31 (value in most case)



1644
1645
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1644

def get_dv_value(value, old)
end

#gif_back ⇒ ::Yuki::GifReader?

Return the GifReader back of the Pokemon

Returns:



946
947
# File 'docs/4_Systems_000_General_1_PFM.rb', line 946

def gif_back
end

#gif_face ⇒ ::Yuki::GifReader?

Return the GifReader face of the Pokemon

Returns:



942
943
# File 'docs/4_Systems_000_General_1_PFM.rb', line 942

def gif_face
end

#given_name_with_title ⇒ String

Return the name of the Pokemon with its title if it has one

Returns:



2070
2071
# File 'docs/4_Systems_000_General_1_PFM.rb', line 2070

def given_name_with_title
end

#handle_gimmighoul_post_evolution_event(previous_evolutions)

Handle Gimmighoul post evolution event

Parameters:

  • previous_evolutions (Array<PokemonEvolution>) —

    previous creature evolution methods



1146
1147
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1146

def handle_gimmighoul_post_evolution_event(previous_evolutions)
end

#handle_item_removing_post_evolution_event(previous_evolutions)

Handle item removing post evolution event

Parameters:

  • previous_evolutions (Array<PokemonEvolution>) —

    previous creature evolution methods



1142
1143
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1142

def handle_item_removing_post_evolution_event(previous_evolutions)
end

#handle_post_evolution_events(old_evolution_db_symbol, old_evolution_form)

Function that handles the events that must take place after an evolution ends

Parameters:

  • old_evolution_db_symbol (Symbol) —

    the db_symbol of the creature before evolution

  • old_evolution_form (Integer) —

    the form of the creature before evolution



1138
1139
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1138

def handle_post_evolution_events(old_evolution_db_symbol, old_evolution_form)
end

#height ⇒ Numeric

Return the height of the Pokemon

Returns:

  • (Numeric)


772
773
# File 'docs/4_Systems_000_General_1_PFM.rb', line 772

def height
end

#hoopa_form(reason)

Determine the form of Hoopa

Parameters:

  • reason (Symbol)


1350
1351
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1350

def hoopa_form(reason)
end

#hoopa_unbound? ⇒ Boolean

Returns:

  • (Boolean)


693
694
# File 'docs/4_Systems_000_General_1_PFM.rb', line 693

def hoopa_unbound?
end

#hp_pokemon_number ⇒ String

Returns the HP text (to_pokemon_number)

Returns:



2123
2124
# File 'docs/4_Systems_000_General_1_PFM.rb', line 2123

def hp_pokemon_number
end

#hp_text ⇒ String

Returns the HP text

Returns:



2119
2120
# File 'docs/4_Systems_000_General_1_PFM.rb', line 2119

def hp_text
end

#icon ⇒ Texture

Return the icon of the Pokemon

Returns:



917
918
# File 'docs/4_Systems_000_General_1_PFM.rb', line 917

def icon
end

#id_text ⇒ String

Return the text of the Pokemon ID

Returns:



2127
2128
# File 'docs/4_Systems_000_General_1_PFM.rb', line 2127

def id_text
end

#id_text2 ⇒ String

Return the text of the Pokemon ID with N°

Returns:



2131
2132
# File 'docs/4_Systems_000_General_1_PFM.rb', line 2131

def id_text2
end

#id_text3 ⇒ String

Return the text of the Pokemon ID to pokemon number

Returns:



2135
2136
# File 'docs/4_Systems_000_General_1_PFM.rb', line 2135

def id_text3
end

#increase_evolve_var(amount = 1)

Method responsible of increasing the evolve_var by a given amount.

Parameters:

  • amount (Integer, nil) (defaults to: 1) —

    by how much the evolve_var attribute is increased



829
830
# File 'docs/4_Systems_000_General_1_PFM.rb', line 829

def increase_evolve_var(amount = 1)
end

#infect_with_pokerus(opts = {})

Note:

Can be used to force the cured version of the Pokerus.

Infect the pokemon with Pokerus. If the pokemon already has the Pokerus or is already cured, does nothing.

Parameters:

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

    Hash describing optional value you want to assign to the Pokemon (for the Pokerus properties)



663
664
# File 'docs/4_Systems_000_General_1_PFM.rb', line 663

def infect_with_pokerus(opts = {})
end

#item_db_symbol ⇒ Symbol

Return the db_symbol of the Pokemon's item held

Returns:

  • (Symbol)


796
797
# File 'docs/4_Systems_000_General_1_PFM.rb', line 796

def item_db_symbol
end

#item_hold ⇒ Integer

Alias for item_holding

Returns:

  • (Integer)


800
801
# File 'docs/4_Systems_000_General_1_PFM.rb', line 800

def item_hold
end

#item_name ⇒ String

Return the name of the item the Pokemon is holding

Returns:



2091
2092
# File 'docs/4_Systems_000_General_1_PFM.rb', line 2091

def item_name
end

#iv_atk_text ⇒ String

Return the IV ATK text

Returns:



1705
1706
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1705

def iv_atk_text
end

#iv_ats_text ⇒ String

Return the IV ATS text

Returns:



1717
1718
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1717

def iv_ats_text
end

#iv_dfe_text ⇒ String

Return the IV DFE text

Returns:



1709
1710
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1709

def iv_dfe_text
end

#iv_dfs_text ⇒ String

Return the IV DFS text

Returns:



1721
1722
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1721

def iv_dfs_text
end

#iv_hp_text ⇒ String

Return the IV HP text

Returns:



1701
1702
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1701

def iv_hp_text
end

#iv_spd_text ⇒ String

Return the IV SPD text

Returns:



1713
1714
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1713

def iv_spd_text
end

#kami_form(reason)

Determine the form of the kami quartet

Parameters:

  • reason (Symbol)


1346
1347
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1346

def kami_form(reason)
end

#kyurem_form(reason)

Determine the form of the Kyurem

Parameters:

  • reason (Symbol) —

    The db_symbol of the Pokemon used for the fusion



1354
1355
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1354

def kyurem_form(reason)
end

#learn_skill(db_symbol) ⇒ Boolean?

Learn a new skill

Parameters:

  • db_symbol (Symbol) —

    db_symbol of the move in the database

Returns:

  • (Boolean, nil) —

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



1437
1438
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1437

def learn_skill(db_symbol)
end

#level_pokemon_number ⇒ String

Return the level text (to_pokemon_number)

Returns:



2111
2112
# File 'docs/4_Systems_000_General_1_PFM.rb', line 2111

def level_pokemon_number
end

#level_text ⇒ String

Returns the level text

Returns:



2107
2108
# File 'docs/4_Systems_000_General_1_PFM.rb', line 2107

def level_text
end

#level_text2 ⇒ String

Return the level text with "Level: " inside

Returns:



2115
2116
# File 'docs/4_Systems_000_General_1_PFM.rb', line 2115

def level_text2
end

#level_up ⇒ Boolean

Increase the level of the Pokemon

Returns:

  • (Boolean) —

    if the level has successfully been increased



1071
1072
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1071

def level_up
end

#level_up_stat_refresh ⇒ Array<Array<Integer>>

Generate the level up stat list for the level up window

Returns:

  • (Array<Array<Integer>>) —

    list0, list1 : old, new basis value



1078
1079
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1078

def level_up_stat_refresh
end

#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



1084
1085
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1084

def level_up_window_call(list0, list1, z_level)
end

#load_skill_from_array(skills)

Load the skill from an Array

Parameters:

  • skills (Array) —

    the skills array (containing IDs or Symbols)



1490
1491
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1490

def load_skill_from_array(skills)
end

#male? ⇒ Boolean

Tell if the Pokemon is a male

Returns:

  • (Boolean)


740
741
# File 'docs/4_Systems_000_General_1_PFM.rb', line 740

def male?
end

#max_hp ⇒ Integer

Return the max HP of the Pokemon

Returns:

  • (Integer)


1520
1521
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1520

def max_hp
end

#max_level ⇒ Integer

Give the maximum level of the Pokemon

Returns:

  • (Integer)


636
637
# File 'docs/4_Systems_000_General_1_PFM.rb', line 636

def max_level
end

#max_level=(level)

Set the maximum level of the Pokemon

Parameters:

  • level (Integer, nil)


640
641
# File 'docs/4_Systems_000_General_1_PFM.rb', line 640

def max_level=(level)
end

#mega_evolve

Mega evolve the Pokemon (if possible)



1302
1303
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1302

def mega_evolve
end

#mega_evolved? ⇒ Boolean

Is the Pokemon mega evolved ?

Returns:

  • (Boolean)


1308
1309
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1308

def mega_evolved?
end

#modifier_stage(stage) ⇒ Float

Return the stage modifier (multiplier)

Parameters:

  • stage (Integer) —

    the value of the stage

Returns:

  • (Float) —

    the multiplier



1614
1615
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1614

def modifier_stage(stage)
end

#name ⇒ String

Return the Pokemon name in the Pokedex

Returns:



2044
2045
# File 'docs/4_Systems_000_General_1_PFM.rb', line 2044

def name
end

#name_upper ⇒ String

Return the Pokemon name upcase in the Pokedex

Returns:



2048
2049
# File 'docs/4_Systems_000_General_1_PFM.rb', line 2048

def name_upper
end

#nature_db_symbol ⇒ Symbol

Return the nature db_symbol of the Pokemon

Returns:

  • (Symbol)


760
761
# File 'docs/4_Systems_000_General_1_PFM.rb', line 760

def nature_db_symbol
end

#nature_id ⇒ Integer

Return the nature id of the Pokemon

Returns:

  • (Integer)


756
757
# File 'docs/4_Systems_000_General_1_PFM.rb', line 756

def nature_id
end

#nature_text ⇒ String Also known as: nature_name

Return the text of the nature

Returns:



2078
2079
# File 'docs/4_Systems_000_General_1_PFM.rb', line 2078

def nature_text
end

#necrozma_form(reason)

Determine the form of the Necrozma

Parameters:

  • reason (Symbol) —

    The db_symbol of the Pokemon used for the fusion



1358
1359
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1358

def necrozma_form(reason)
end

#no_preferences? ⇒ Boolean

Check if the Creature has a nature with no preferences

Returns:

  • (Boolean)


2152
2153
# File 'docs/4_Systems_000_General_1_PFM.rb', line 2152

def no_preferences?
end

#paralyzed? ⇒ Boolean

Is the Pokemon paralyzed?

Returns:

  • (Boolean)


1807
1808
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1807

def paralyzed?
end

#poisoned? ⇒ Boolean

Is the Pokemon poisoned?

Returns:

  • (Boolean)


1794
1795
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1794

def poisoned?
end

#pokerus_affected? ⇒ Boolean

Return true if the pokemon is infected by the Pokerus or has been cured.

Returns:

  • (Boolean)


691
692
# File 'docs/4_Systems_000_General_1_PFM.rb', line 691

def pokerus_affected?
end

#pokerus_check? ⇒ Boolean

Return true if the Pokemon must catch the Pokerus randomly. A Pokemon has a 3 in 65536 chance of getting the Pokerus.

Returns:

  • (Boolean) —

    true if the pokemon must catch the Pokerus



658
659
# File 'docs/4_Systems_000_General_1_PFM.rb', line 658

def pokerus_check?
end

#pokerus_cured? ⇒ Boolean

Note:

Return true if the 4 higher bits of Pokerus are not 0 and the 4 lower bits are 0.

True if the pokemon has been cured from the Pokerus.

Returns:

  • (Boolean)


682
683
# File 'docs/4_Systems_000_General_1_PFM.rb', line 682

def pokerus_cured?
end

#pokerus_infected? ⇒ Boolean

Tell if the pokemon has the Pokerus and is not yet cured

Returns:

  • (Boolean)


667
668
# File 'docs/4_Systems_000_General_1_PFM.rb', line 667

def pokerus_infected?
end

#pokerus_remaining_days ⇒ Integer

Note:

Return the lower 4 bits of Pokerus, as an integer value. 0 Means the Pokerus is cured (or the pokemon never had it).

Return the number of remaining days before the Pokerus is cured.

Returns:

  • (Integer)


672
673
# File 'docs/4_Systems_000_General_1_PFM.rb', line 672

def pokerus_remaining_days
end

#pokerus_strain ⇒ Integer

Note:

Return the 4 higher bits of Pokerus as an integer value. 0 means the pokemon never got the Pokerus.

Return the strain of the Pokerus.

Returns:

  • (Integer)


677
678
# File 'docs/4_Systems_000_General_1_PFM.rb', line 677

def pokerus_strain
end

#primal_evolve

Primal Reversion of the Pokemon



1311
1312
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1311

def primal_evolve
end

#primary_data ⇒ Studio::CreatureForm

Get the primary data of the Pokemon



627
628
# File 'docs/4_Systems_000_General_1_PFM.rb', line 627

def primary_data
end

#rareness ⇒ Integer

Return the Pokemon rareness

Returns:

  • (Integer)


764
765
# File 'docs/4_Systems_000_General_1_PFM.rb', line 764

def rareness
end

#rareness=(v)

Change the Pokemon rareness

Parameters:

  • v (Integer, nil) —

    the new rareness of the Pokemon



768
769
# File 'docs/4_Systems_000_General_1_PFM.rb', line 768

def rareness=(v)
end

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

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:

  • (Array<Symbol>)


1486
1487
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1486

def remindable_skills(mode = 0)
end

#remove_ribbon(symbol)

Remove a ribbon from the Creature

Parameters:

  • symbol (Symbol) —

    Symbol of the ribbon



816
817
# File 'docs/4_Systems_000_General_1_PFM.rb', line 816

def remove_ribbon(symbol)
end

#replace_skill_index(index, db_symbol)

Replace the skill at a specific index

Parameters:

  • index (Integer) —

    index of the skill to replace by a new skill

  • db_symbol (Symbol) —

    db_symbol of the move in the database



1452
1453
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1452

def replace_skill_index(index, db_symbol)
end

#reset_evolve_var(value = 0)

Method resetting the evolve var to a given value.

Parameters:

  • value (Integer, nil) (defaults to: 0)


833
834
# File 'docs/4_Systems_000_General_1_PFM.rb', line 833

def reset_evolve_var(value = 0)
end

#ribbon?(symbol) ⇒ Boolean

Does the Creature have a specific ribbon?

Parameters:

  • symbol (Symbol) —

    Symbol of the ribbon

Returns:

  • (Boolean)


821
822
# File 'docs/4_Systems_000_General_1_PFM.rb', line 821

def ribbon?(symbol)
end

#separate

Separate (if possible) the Pokemon and restore the Pokemon used in the fusion



1318
1319
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1318

def separate
end

#shaymin_form(reason)

Determine the form of Shaymin

Parameters:

  • reason (Symbol)


1342
1343
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1342

def shaymin_form(reason)
end

#shiny=(shiny)

Set the shiny attribut

Parameters:

  • shiny (Boolean)


649
650
# File 'docs/4_Systems_000_General_1_PFM.rb', line 649

def shiny=(shiny)
end

#shiny? ⇒ Boolean Also known as: shiny

Get the shiny attribute

Returns:

  • (Boolean)


644
645
# File 'docs/4_Systems_000_General_1_PFM.rb', line 644

def shiny?
end

#shiny_rate ⇒ Integer

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:

  • (Integer)


654
655
# File 'docs/4_Systems_000_General_1_PFM.rb', line 654

def shiny_rate
end

#single_type? ⇒ Boolean

Is the user single typed ?

Returns:

  • (Boolean)


1984
1985
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1984

def single_type?
end

#skill_learnt?(db_symbol, only_in_move_set: true) ⇒ Boolean Also known as: has_skill?

Has the pokemon already learnt a skill ?

Parameters:

  • db_symbol (Symbol) —

    db_symbol of the move

  • only_in_move_set (Boolean) (defaults to: true) —

    if the function only check in the current move set

Returns:

  • (Boolean)


1458
1459
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1458

def skill_learnt?(db_symbol, only_in_move_set: true)
end

#sleep_check ⇒ Boolean

Check if the Pokemon is still asleep

Returns:

  • (Boolean) —

    true = the Pokemon is still asleep



1848
1849
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1848

def sleep_check
end

#spd ⇒ Integer

Return the current spd

Returns:

  • (Integer)


1532
1533
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1532

def spd
end

#spd_basis ⇒ Integer

Return the spd stat without battle modifier

Returns:

  • (Integer)


1656
1657
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1656

def spd_basis
end

#spd_modifier ⇒ Float

Return the spd modifier

Returns:

  • (Float) —

    the multiplier



1626
1627
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1626

def spd_modifier
end

#spd_stage ⇒ Integer

Return the spd stage

Returns:

  • (Integer)


1552
1553
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1552

def spd_stage
end

#status? ⇒ Boolean

Is the pokemon affected by a status

Returns:

  • (Boolean)


1784
1785
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1784

def status?
end

#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



1826
1827
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1826

def status_burn(forcing = false)
end

#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



1857
1858
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1857

def status_frozen(forcing = false)
end

#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



1812
1813
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1812

def status_paralyze(forcing = false)
end

#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



1799
1800
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1799

def status_poison(forcing = false)
end

#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



1840
1841
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1840

def status_sleep(forcing = false, nb_turn = nil)
end

#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



1870
1871
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1870

def status_toxic(forcing = true)
end

#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



1447
1448
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1447

def swap_skills_index(index1, index2)
end

#third_type? ⇒ Boolean

Has the user a third type ?

Returns:

  • (Boolean)


1988
1989
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1988

def third_type?
end

#title? ⇒ Boolean

Does the Creature have a title?

Returns:

  • (Boolean)


825
826
# File 'docs/4_Systems_000_General_1_PFM.rb', line 825

def title?
end

#to_s ⇒ String

Convert the Pokemon to a string (battle debug)

Returns:



2074
2075
# File 'docs/4_Systems_000_General_1_PFM.rb', line 2074

def to_s
end

#total_ev ⇒ Integer

Return the total amount of EV

Returns:

  • (Integer)


969
970
# File 'docs/4_Systems_000_General_1_PFM.rb', line 969

def total_ev
end

#toxic? ⇒ Boolean

Is the Pokemon in toxic state ?

Returns:

  • (Boolean)


1865
1866
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1865

def toxic?
end

#trainer_id_text ⇒ String

Return the normalized text trainer id of the Pokemon

Returns:



2103
2104
# File 'docs/4_Systems_000_General_1_PFM.rb', line 2103

def trainer_id_text
end

#type?(type) ⇒ Boolean

Check the Pokemon type by the type ID

Parameters:

  • type (Integer) —

    ID of the type in the database

Returns:

  • (Boolean)


1976
1977
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1976

def type?(type)
end

#type_bug? ⇒ Boolean Also known as: type_insect?

Is the Pokemon type insect/bug ?

Returns:

  • (Boolean)


1941
1942
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1941

def type_bug?
end

#type_dark? ⇒ Boolean Also known as: type_tenebre?

Is the Pokemon type dark ?

Returns:

  • (Boolean)


1965
1966
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1965

def type_dark?
end

#type_dragon? ⇒ Boolean

Is the Pokemon type dragon ?

Returns:

  • (Boolean)


1956
1957
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1956

def type_dragon?
end

#type_electric? ⇒ Boolean Also known as: type_electrique?

Is the Pokemon type electric ?

Returns:

  • (Boolean)


1901
1902
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1901

def type_electric?
end

#type_fairy? ⇒ Boolean Also known as: type_fee?

Is the Pokemon type fairy ?

Returns:

  • (Boolean)


1970
1971
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1970

def type_fairy?
end

#type_fighting? ⇒ Boolean Also known as: type_combat?

Is the Pokemon type fighting ?

Returns:

  • (Boolean)


1916
1917
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1916

def type_fighting?
end

#type_fire? ⇒ Boolean Also known as: type_feu?

Is the Pokemon type fire ?

Returns:

  • (Boolean)


1891
1892
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1891

def type_fire?
end

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

Is the Pokemon type fly ?

Returns:

  • (Boolean)


1930
1931
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1930

def type_flying?
end

#type_ghost? ⇒ Boolean Also known as: type_spectre?

Is the Pokemon type ghost ?

Returns:

  • (Boolean)


1951
1952
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1951

def type_ghost?
end

#type_grass? ⇒ Boolean Also known as: type_plante?

Is the Pokemon type grass ?

Returns:

  • (Boolean)


1906
1907
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1906

def type_grass?
end

#type_ground? ⇒ Boolean Also known as: type_sol?

Is the Pokemon type ground ?

Returns:

  • (Boolean)


1925
1926
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1925

def type_ground?
end

#type_ice? ⇒ Boolean Also known as: type_glace?

Is the Pokemon type ice ?

Returns:

  • (Boolean)


1911
1912
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1911

def type_ice?
end

#type_normal? ⇒ Boolean

Is the Pokemon type normal ?

Returns:

  • (Boolean)


1887
1888
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1887

def type_normal?
end

#type_poison? ⇒ Boolean

Is the Pokemon type poison ?

Returns:

  • (Boolean)


1921
1922
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1921

def type_poison?
end

#type_psychic? ⇒ Boolean Also known as: type_psy?

Is the Pokemon type psy ?

Returns:

  • (Boolean)


1936
1937
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1936

def type_psychic?
end

#type_rock? ⇒ Boolean Also known as: type_roche?

Is the Pokemon type rock ?

Returns:

  • (Boolean)


1946
1947
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1946

def type_rock?
end

#type_steel? ⇒ Boolean Also known as: type_acier?

Is the Pokemon type steel ?

Returns:

  • (Boolean)


1960
1961
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1960

def type_steel?
end

#type_water? ⇒ Boolean Also known as: type_eau?

Is the Pokemon type water ?

Returns:

  • (Boolean)


1896
1897
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1896

def type_water?
end

#typeless? ⇒ Boolean

Is the Pokemon typeless ?

Returns:

  • (Boolean)


1980
1981
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1980

def typeless?
end

#unmega_evolve

Reset the Pokemon to its normal form after mega evolution



1305
1306
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1305

def unmega_evolve
end

#update_ability

Update the Pokemon Ability



1133
1134
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1133

def update_ability
end

#update_loyalty

Update the PFM::Pokemon loyalty



1074
1075
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1074

def update_loyalty
end

#weight ⇒ Numeric

Return the weight of the Pokemon

Returns:

  • (Numeric)


776
777
# File 'docs/4_Systems_000_General_1_PFM.rb', line 776

def weight
end

#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



727
728
# File 'docs/4_Systems_000_General_1_PFM.rb', line 727

def zone_id(special_zone = nil)
end

#zygarde_form(reason) ⇒ Integer

Determine the form of the Zygarde

Parameters:

  • reason (Symbol)

Returns:

  • (Integer) —

    form of zygarde



1363
1364
# File 'docs/4_Systems_000_General_1_PFM.rb', line 1363

def zygarde_form(reason)
end