Module: GamePlay::PokemonTradeStorageMixin

Included in:
PokemonTradeStorage
Defined in:
scripts/01450 Systems/00200 Storage/00003 GamePlay_Storage/00099 TradeMixin.rb

Overview

Mixin definin the Input/Output of the PokemonTradeStorage class

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#return_dataInteger? (readonly)

Get the selected Pokemon index (1~30) = current box, (31~36) = party

Returns:



6
7
8
# File 'scripts/01450 Systems/00200 Storage/00003 GamePlay_Storage/00099 TradeMixin.rb', line 6

def return_data
  @return_data
end

Instance Method Details

#pokemon_selected?Boolean

Tell if a Pokemon was selected

Returns:

  • (Boolean)


10
11
12
13
14
# File 'scripts/01450 Systems/00200 Storage/00003 GamePlay_Storage/00099 TradeMixin.rb', line 10

def pokemon_selected?
  return false unless return_data

  return !selected_pokemon.nil?
end

#pokemon_selected_in_box?Boolean

Tell if the selected Pokemon is from box

Returns:

  • (Boolean)


27
28
29
30
31
# File 'scripts/01450 Systems/00200 Storage/00003 GamePlay_Storage/00099 TradeMixin.rb', line 27

def pokemon_selected_in_box?
  return false unless return_data

  return return_data.to_i.between?(1, 30)
end

#pokemon_selected_in_party?Boolean

Tell if the selected Pokemon is from party

Returns:

  • (Boolean)


35
36
37
38
39
# File 'scripts/01450 Systems/00200 Storage/00003 GamePlay_Storage/00099 TradeMixin.rb', line 35

def pokemon_selected_in_party?
  return false unless return_data

  return return_data.to_i.between?(31, 36)
end

#selected_pokemonPFM::Pokemon?

Get the selected Pokemon

Returns:



18
19
20
21
22
23
# File 'scripts/01450 Systems/00200 Storage/00003 GamePlay_Storage/00099 TradeMixin.rb', line 18

def selected_pokemon
  return $storage.info(return_data - 1) if pokemon_selected_in_box?
  return $actors[return_data - 31] if pokemon_selected_in_party?

  return nil
end