Module: Util::GiveTakeItem

Included in:
GamePlay::Party_Menu, GamePlay::PokemonStorage
Defined in:
docs/4_Systems_102_Party.rb

Overview

Module adding the give / take item functionality to a scene

Instance Method Summary collapse

Instance Method Details

#givetake_give_egg_message(item)

Display the give item message to an egg

Parameters:

  • item (Integer)

    given item



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

def givetake_give_egg_message(item)
end

#givetake_give_item(pokemon, item = -1)) {|pokemon| ... } ⇒ Boolean

Give an item to a Pokemon

Parameters:

  • pokemon (PFM::Pokemon)

    pokemon that will receive the item

  • item (Integer, Symbol) (defaults to: -1))

    item to give, -1 to open the bag

Yield Parameters:

  • pokemon (PFM::Pokemon)

    block we call with pokemon before and after the form calibration

Returns:

  • (Boolean)

    if the item was given



9
10
# File 'docs/4_Systems_102_Party.rb', line 9

def givetake_give_item(pokemon, item = -1)
end

#givetake_give_item_message(item1, item2, pokemon)

Display the give item message

Parameters:

  • item1 (Integer)

    taken item

  • item2 (Integer)

    given item

  • pokemon (PFM::Pokemon)

    Pokemong getting the item



15
16
# File 'docs/4_Systems_102_Party.rb', line 15

def givetake_give_item_message(item1, item2, pokemon)
end

#givetake_give_item_update_state(item1, item2, pokemon)

Update the bag and pokemon state when giving an item

Parameters:

  • item1 (Integer)

    taken item

  • item2 (Integer)

    given item

  • pokemon (PFM::Pokemon)

    Pokemong getting the item



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

def givetake_give_item_update_state(item1, item2, pokemon)
end

#givetake_take_item(pokemon) {|pokemon| ... }

Action of taking the item from the Pokemon

Parameters:

Yield Parameters:

  • pokemon (PFM::Pokemon)

    block we call with pokemon before and after the form calibration



30
31
# File 'docs/4_Systems_102_Party.rb', line 30

def givetake_take_item(pokemon)
end