Class: PFM::Pokedex

Inherits:
Object show all
Defined in:
docs/4_Systems_101_Dex.rb

Overview

The Pokedex informations

The main Pokedex object is stored in $pokedex or PFM.game_state.pokedex

All Creature are usually marked as seen or captured in the correct scripts using $pokedex.mark_seen(id) or $pokedex.mark_captured(id).

When the Pokedex is disabled, no Creature can be marked as seen (unless they’re added to the party). All caught Creature are marked as captured so if for scenaristic reason you need the trainer to catch Creature before having the Pokedex. Don’t forget to call $pokedex.unmark_captured(id) (as well $pokedex.unmark_seen(id))

Author:

  • Nuri Yuri

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(game_state = PFM.game_state) ⇒ Pokedex

Create a new Pokedex object

Parameters:

  • game_state (PFM::GameState) (defaults to: PFM.game_state)

    game state storing this instance



25
26
# File 'docs/4_Systems_101_Dex.rb', line 25

def initialize(game_state = PFM.game_state)
end

Instance Attribute Details

#game_statePFM::GameState

Get the game state responsive of the whole game state

Returns:



16
17
18
# File 'docs/4_Systems_101_Dex.rb', line 16

def game_state
  @game_state
end

#seen_variantsArray<Symbol> (readonly)

Get the list of seen variants

Returns:

  • (Array<Symbol>)


22
23
24
# File 'docs/4_Systems_101_Dex.rb', line 22

def seen_variants
  @seen_variants
end

#variantSymbol

Get the current dex variant

Returns:

  • (Symbol)


19
20
21
# File 'docs/4_Systems_101_Dex.rb', line 19

def variant
  @variant
end

Instance Method Details

#best_worldmap_for_creature(db_symbol) ⇒ Integer Also known as: best_worldmap_pokemon

Detect the best worldmap to display for the creature

Parameters:

  • db_symbol (Symbol)

    db_symbol of the creature we want the worldmap to display

Returns:

  • (Integer)


154
155
# File 'docs/4_Systems_101_Dex.rb', line 154

def best_worldmap_for_creature(db_symbol)
end

#calibrate

Calibrate the Pokedex information (seen/captured)



149
150
# File 'docs/4_Systems_101_Dex.rb', line 149

def calibrate
end

#convert_to_dot26

Convert the dex to .26 format



28
29
# File 'docs/4_Systems_101_Dex.rb', line 28

def convert_to_dot26
end

#creature_caughtInteger Also known as: pokemon_captured

Return the number of caught Creature

Returns:

  • (Integer)


63
64
# File 'docs/4_Systems_101_Dex.rb', line 63

def creature_caught
end

#creature_caught?(db_symbol, form = false) ⇒ Boolean Also known as: pokemon_caught?, has_captured?

Has the player caught this Creature

Parameters:

  • db_symbol (Symbol)

    db_symbol of the Creature in the database

  • form (Integer) (defaults to: false)

    the specific form of the Creature

Returns:

  • (Boolean)


128
129
# File 'docs/4_Systems_101_Dex.rb', line 128

def creature_caught?(db_symbol, form = false)
end

#creature_caught_count(db_symbol) ⇒ Integer

Return the number of Creature captured by specie

Parameters:

  • db_symbol (Symbol)

    db_symbol of the Creature in the database

Returns:

  • (Integer)


69
70
# File 'docs/4_Systems_101_Dex.rb', line 69

def creature_caught_count(db_symbol)
end

#creature_fought(db_symbol) ⇒ Integer

Return the number of Creature fought by specie

Parameters:

  • db_symbol (Symbol)

    db_symbol of the Creature in the database

Returns:

  • (Integer)


84
85
# File 'docs/4_Systems_101_Dex.rb', line 84

def creature_fought(db_symbol)
end

#creature_seenInteger Also known as: pokemon_seen

Return the number of Creature seen

Returns:

  • (Integer)


58
59
# File 'docs/4_Systems_101_Dex.rb', line 58

def creature_seen
end

#creature_seen?(db_symbol, form = false) ⇒ Boolean Also known as: pokemon_seen?, has_seen?

Has the player seen a Creature

Parameters:

  • db_symbol (Symbol)

    db_symbol of the Creature in the database

Returns:

  • (Boolean)


120
121
# File 'docs/4_Systems_101_Dex.rb', line 120

def creature_seen?(db_symbol, form = false)
end

#creature_unlocked?(db_symbol) ⇒ Boolean

Tell if the creature is unlocked in the current dex state

Parameters:

  • db_symbol (Symbol)

Returns:

  • (Boolean)


146
147
# File 'docs/4_Systems_101_Dex.rb', line 146

def creature_unlocked?(db_symbol)
end

#disable

Disable the Pokedex



41
42
# File 'docs/4_Systems_101_Dex.rb', line 41

def disable
end

#enable

Enable the Pokedex



34
35
# File 'docs/4_Systems_101_Dex.rb', line 34

def enable
end

#enabled?Boolean

Test if the Pokedex is enabled

Returns:

  • (Boolean)


38
39
# File 'docs/4_Systems_101_Dex.rb', line 38

def enabled?
end

#form_caught(db_symbol) ⇒ Integer

Get the caught forms informations of a Creature

Parameters:

  • db_symbol (Symbol)

    db_symbol of the Creature in the database

Returns:

  • (Integer)

    An integer where int == 1 mean the form has been caught



141
142
# File 'docs/4_Systems_101_Dex.rb', line 141

def form_caught(db_symbol)
end

#form_seen(db_symbol) ⇒ Integer Also known as: get_forms

Get the seen forms informations of a Creature

Parameters:

  • db_symbol (Symbol)

    db_symbol of the Creature in the database

Returns:

  • (Integer)

    An integer where int == 1 mean the form has been seen



135
136
# File 'docs/4_Systems_101_Dex.rb', line 135

def form_seen(db_symbol)
end

#increase_creature_caught_count(db_symbol) Also known as: pokemon_captured_inc

Increase the number of Creature captured by specie

Parameters:

  • db_symbol (Symbol)

    db_symbol of the Creature in the database



78
79
# File 'docs/4_Systems_101_Dex.rb', line 78

def increase_creature_caught_count(db_symbol)
end

#increase_creature_fought(db_symbol) Also known as: pokemon_fought_inc

Increase the number of Creature fought by specie

Parameters:

  • db_symbol (Symbol)

    db_symbol of the Creature in the database



93
94
# File 'docs/4_Systems_101_Dex.rb', line 93

def increase_creature_fought(db_symbol)
end

#mark_captured(db_symbol, form = 0)

Mark a Creature as captured

Parameters:

  • db_symbol (Symbol)

    db_symbol of the Creature in the database

  • form (Integer) (defaults to: 0)

    the specific form of the Creature



111
112
# File 'docs/4_Systems_101_Dex.rb', line 111

def mark_captured(db_symbol, form = 0)
end

#mark_seen(db_symbol, form = 0, forced: false)

Mark a creature as seen

Parameters:

  • db_symbol (Symbol)

    db_symbol of the Creature in the database

  • form (Integer) (defaults to: 0)

    the specific form of the Creature

  • forced (Boolean) (defaults to: false)

    if the Creature is marked seen even if the Pokedex is disabled (Giving Creature before givin the Pokedex).



101
102
# File 'docs/4_Systems_101_Dex.rb', line 101

def mark_seen(db_symbol, form = 0, forced: false)
end

#national=(mode) Also known as: set_national

Set the national flag of the Pokedex

Parameters:

  • mode (Boolean)

    the flag



45
46
# File 'docs/4_Systems_101_Dex.rb', line 45

def national=(mode)
end

#national?Boolean

Is the Pokedex showing national Creature

Returns:

  • (Boolean)


54
55
# File 'docs/4_Systems_101_Dex.rb', line 54

def national?
end

#set_creature_caught_count(db_symbol, number)

Change the number of Creature captured by specie

Parameters:

  • db_symbol (Symbol)

    db_symbol of the Creature in the database

  • number (Integer)

    the new number



74
75
# File 'docs/4_Systems_101_Dex.rb', line 74

def set_creature_caught_count(db_symbol, number)
end

#set_creature_fought(db_symbol, number)

Change the number of Creature fought by specie

Parameters:

  • db_symbol (Symbol)

    db_symbol of the Creature in the database

  • number (Integer)

    the number of Creature fought in the specified specie



89
90
# File 'docs/4_Systems_101_Dex.rb', line 89

def set_creature_fought(db_symbol, number)
end

#set_form_caught

Create a Hash for form caught



31
32
# File 'docs/4_Systems_101_Dex.rb', line 31

def set_form_caught
end

#spawn_zones(db_symbol) ⇒ Array<Symbol>

Return the list of the zone id where the creature spawns

Parameters:

  • db_symbol (Symbol)

    db_symbol of the creature we want to know where it spawns

Returns:

  • (Array<Symbol>)


160
161
# File 'docs/4_Systems_101_Dex.rb', line 160

def spawn_zones(db_symbol)
end

#unmark_captured(db_symbol, form = false)

Unmark a Creature as captured

Parameters:

  • db_symbol (Symbol)

    db_symbol of the Creature in the database



115
116
# File 'docs/4_Systems_101_Dex.rb', line 115

def unmark_captured(db_symbol, form = false)
end

#unmark_seen(db_symbol, form: false)

Unmark a creature as seen

Parameters:

  • db_symbol (Symbol)

    db_symbol of the Creature in the database

  • form (Integer, false) (defaults to: false)

    if false, all form will be unseen, otherwise the specific form will be unseen



106
107
# File 'docs/4_Systems_101_Dex.rb', line 106

def unmark_seen(db_symbol, form: false)
end