Class: PFM::Storage

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

Overview

Player PC storage

The main object is stored in $storage and PFM.game_state.storage

Author:

  • Nuri Yuri

Defined Under Namespace

Classes: BattleBox, Box

Constant Summary collapse

MAX_BOXES =

Maximum amount of box

15
MAX_BATTLE_BOX =

Maximum amount of battle box

16
BOX_SIZE =

Size of a box

30
NB_THEMES =

Number of box theme (background : Graphics/PC/f_id, title : Graphics/PC/title_id

16
HEAL_AND_CURE_POKEMON =

Tell if the Pokemon gets healed & cured when stored

true

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(game_state) ⇒ Storage

Create a new storage

Parameters:

  • game_state (PFM::GameState)

    variable responsive of containing the whole game state for easier access



37
38
# File 'docs/4_Systems_200_Storage.rb', line 37

def initialize(game_state)
end

Instance Attribute Details

#battle_boxesArray<BattleBox>

Get the battle boxes

Returns:



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

def battle_boxes
  @battle_boxes
end

#current_battle_boxInteger

The id of the current battle box

Returns:

  • (Integer)


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

def current_battle_box
  @current_battle_box
end

#current_boxInteger

The id of the current box

Returns:

  • (Integer)


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

def current_box
  @current_box
end

#game_statePFM::GameState

Get the game state responsive of the whole game state

Returns:



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

def game_state
  @game_state
end

#lets_go_followerPFM::Pokemon

The Let’s Go Follower

Returns:



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

def lets_go_follower
  @lets_go_follower
end

#other_partyArray<PFM::Pokemon>

The party of the other actor (friend)

Returns:



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

def other_party
  @other_party
end

Class Method Details

.box_sizeInteger

Get the box size

Returns:

  • (Integer)


155
156
# File 'docs/4_Systems_200_Storage.rb', line 155

def box_size
end

Instance Method Details

#add_box(name)

Add a new box

Parameters:

  • name (String)

    name of the new box



134
135
# File 'docs/4_Systems_200_Storage.rb', line 134

def add_box(name)
end

#any_pokemon? {|pokemon| ... } ⇒ Boolean

Yield a block on each Pokemon of storage and check if any answers to the block

Yield Parameters:

Returns:

  • (Boolean)


126
127
# File 'docs/4_Systems_200_Storage.rb', line 126

def any_pokemon?
end

#any_pokemon_alive?Boolean Also known as: any_pokemon_alive

Check if there’s a Pokemon alive in the box (egg or not)

Returns:

  • (Boolean)


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

def any_pokemon_alive?
end

#auto_convert

Auto convert the data to the new format



40
41
# File 'docs/4_Systems_200_Storage.rb', line 40

def auto_convert
end

#box_countInteger Also known as: max_box

Return the amount of box in the storage

Returns:

  • (Integer)


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

def box_count
end

#box_name_init(index)

Get the name of a box (initialize)

Parameters:

  • index (Integer)

    the index of the box



70
71
# File 'docs/4_Systems_200_Storage.rb', line 70

def box_name_init(index)
end

#count_pokemon(include_dead = true) ⇒ Integer

Count the number of Pokemon available in the box

Parameters:

  • include_dead (Boolean) (defaults to: true)

    if the counter include the “dead” Pokemon

Returns:

  • (Integer)


117
118
# File 'docs/4_Systems_200_Storage.rb', line 117

def count_pokemon(include_dead = true)
end

#current_box_objectPFM::Storage::Box

Note:

Any modification will be ignored

Get the current box object

Returns:



50
51
# File 'docs/4_Systems_200_Storage.rb', line 50

def current_box_object
end

#delete_box(index)

Delete a box

Parameters:

  • index (Integer)

    index of the box to delete



130
131
# File 'docs/4_Systems_200_Storage.rb', line 130

def delete_box(index)
end

#each_pokemon {|pokemon| ... }

Yield a block on each Pokemon of storage

Yield Parameters:



121
122
# File 'docs/4_Systems_200_Storage.rb', line 121

def each_pokemon
end

#get_box_content(index) ⇒ Array<PFM::Pokemon, nil> Also known as: get_box

Retrieve a box content

Parameters:

  • index (Integer)

    the index of the box

Returns:



55
56
# File 'docs/4_Systems_200_Storage.rb', line 55

def get_box_content(index)
end

#get_box_name(index) ⇒ String

Return a box name

Parameters:

  • index (Integer)

    the index of the box

Returns:



61
62
# File 'docs/4_Systems_200_Storage.rb', line 61

def get_box_name(index)
end

#get_box_theme(index) ⇒ Integer

Get a box theme

Parameters:

  • index (Integer)

    the index of the box

Returns:

  • (Integer)

    the id of the box theme



75
76
# File 'docs/4_Systems_200_Storage.rb', line 75

def get_box_theme(index)
end

#info(index) ⇒ PFM::Pokemon?

Return the Pokemon at an index in the current box

Parameters:

  • index (Integer)

    index of the Pokemon in the current box

Returns:



96
97
# File 'docs/4_Systems_200_Storage.rb', line 96

def info(index)
end

#remove_pokemon_at(index) ⇒ PFM::Pokemon? Also known as: remove

Remove a Pokemon in the current box and return what whas removed at the index

Parameters:

  • index (Integer)

    index of the Pokemon in the current box

Returns:



85
86
# File 'docs/4_Systems_200_Storage.rb', line 85

def remove_pokemon_at(index)
end

#set_box_name(index, name)

Change the name of a box

Parameters:

  • index (Integer)

    the index of the box

  • name (String)

    the new name



66
67
# File 'docs/4_Systems_200_Storage.rb', line 66

def set_box_name(index, name)
end

#set_box_theme(index, theme)

Change the theme of a box

Parameters:

  • index (Integer)

    the index of the box

  • theme (Integer)

    the id of the box theme



80
81
# File 'docs/4_Systems_200_Storage.rb', line 80

def set_box_theme(index, theme)
end

#slot_contain_pokemon?(index) ⇒ Boolean

Is the slot “index” containing a Pokemon ?

Parameters:

  • index (Integer)

    index of the entity in the current box

Returns:

  • (Boolean)


91
92
# File 'docs/4_Systems_200_Storage.rb', line 91

def slot_contain_pokemon?(index)
end

#store(pokemon) ⇒ Boolean

Store a pokemon to the PC

Parameters:

Returns:

  • (Boolean)

    if the Pokemon has been stored



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

def store(pokemon)
end

#store_pokemon_at(pokemon, index)

Note:

The pokemon is healed when stored

Store a Pokemon at a specific index in the current box

Parameters:

  • pokemon (PFM::Pokemon)

    the Pokemon to store

  • index (Integer)

    index of the Pokemon in the current box



102
103
# File 'docs/4_Systems_200_Storage.rb', line 102

def store_pokemon_at(pokemon, index)
end