Module: PFM::ItemDescriptor

Includes:
GameData::SystemTags
Defined in:
docs/3_Studio.rb

Overview

Module that help item to be used by returning an “extend_data” that every interface can understand

Structure of the extend_data returned
  no_effect: opt Boolean # The item has no effect
  chen: opt Boolean # The stalker also called Prof. CHEN that tells you the item cannot be used there
  open_party: opt Boolean # If the item require the Party menu to be opened in selection mode
  on_creature_choice: opt Proc # The proc to check when the player select a Pokemon(parameter) (return a value usefull to the interface)
  on_creature_use: opt Proc # The proc executed on a Pokemon(parameter) when the item is used
  open_skill: opt Boolean # If the item require the Skill selection interface to be open
  open_skill_learn: opt Integer # ID of the skill to learn if the item require to Open the Skill learn interface
  on_skill_choice: opt Proc # Proc to call to validate the choice of the skill(parameter)
  on_skill_use: opt Proc # Proc to call when a skill(parameter) is validated and choosen 
  on_use: opt Proc # The proc to call when the item is used.
  action_to_push: opt Proc # The proc to call to push the specific action when the item is used in battle
  stone_evolve: opt Boolean # If a Pokemon evolve by stone
  use_before_telling: opt Boolean # If :on_use proc is called before telling the item is used
  skill_message_id: opt Integer # ID of the message to show in the win_text in the Summary

Author:

  • Nuri Yuri

Defined Under Namespace

Classes: Wrapper

Constant Summary collapse

LVL_SOUND =

Sound played when a Pokemon levels up and when an item is used

['audio/me/rosa_levelup', 100, 100]
NO_CONDITION =

Proc executed when there’s no condition (returns true)

proc {true }
COMMON_EVENT_CONDITIONS =

Common event condition procs to call before calling event (common_event_id => proc { conditions })

Hash.new(NO_CONDITION)
CommonEventConditions =

Fallback for old users

COMMON_EVENT_CONDITIONS
NO_EFFECT =

No effect Hash descriptor

{no_effect: true}
CHEN =

You cannot use this item here Hash descriptor

{chen: true}
BOOST =

Stage boost method Symbol in PFM::Pokemon

%i[change_atk change_dfe change_spd change_ats change_dfs change_eva change_acc]
BagStatesHeal =

Message text id of the various item heals (index => text_id)

[116, 110, 111, 112, 120, 113, 116, 116, 110]
EVStat =

Message text id of the various EV change (index => text_id)

[134, 129, 130, 133, 131, 132]
EXTEND_DATAS =

Constant containing all the default extend_data

Returns:

Hash.new {Wrapper.new }
CHEN_PREVENTIONS =

Constant containing all the chen prevention

{}

Constants included from GameData::SystemTags

GameData::SystemTags::AcroBike, GameData::SystemTags::AcroBikeRL, GameData::SystemTags::AcroBikeUD, GameData::SystemTags::BridgeRL, GameData::SystemTags::BridgeUD, GameData::SystemTags::CrackedSoil, GameData::SystemTags::DeepSwamp, GameData::SystemTags::Empty, GameData::SystemTags::HeadButt, GameData::SystemTags::Hole, GameData::SystemTags::JumpD, GameData::SystemTags::JumpL, GameData::SystemTags::JumpR, GameData::SystemTags::JumpU, GameData::SystemTags::MachBike, GameData::SystemTags::Puddle, GameData::SystemTags::RClimb, GameData::SystemTags::RapidsD, GameData::SystemTags::RapidsL, GameData::SystemTags::RapidsR, GameData::SystemTags::RapidsU, GameData::SystemTags::Road, GameData::SystemTags::RocketD, GameData::SystemTags::RocketL, GameData::SystemTags::RocketR, GameData::SystemTags::RocketRD, GameData::SystemTags::RocketRL, GameData::SystemTags::RocketRR, GameData::SystemTags::RocketRU, GameData::SystemTags::RocketU, GameData::SystemTags::SlopesL, GameData::SystemTags::SlopesR, GameData::SystemTags::StairsD, GameData::SystemTags::StairsL, GameData::SystemTags::StairsR, GameData::SystemTags::StairsU, GameData::SystemTags::StopSlide, GameData::SystemTags::SwampBorder, GameData::SystemTags::TCave, GameData::SystemTags::TGrass, GameData::SystemTags::TIce, GameData::SystemTags::TMount, GameData::SystemTags::TPond, GameData::SystemTags::TSand, GameData::SystemTags::TSea, GameData::SystemTags::TSnow, GameData::SystemTags::TTallGrass, GameData::SystemTags::TUnderWater, GameData::SystemTags::TWetSand, GameData::SystemTags::WaterFall, GameData::SystemTags::Whirlpool, GameData::SystemTags::ZTag

Class Method Summary collapse

Methods included from GameData::SystemTags

gen, system_tag_db_symbol

Class Method Details

.actions(item_id) ⇒ Wrapper

Describe an item with a Hash descriptor

Parameters:

  • item_id (Integer)

    ID of the item in the database

Returns:

  • (Wrapper)

    the Wrapper helping to use the item



1534
1535
# File 'docs/3_Studio.rb', line 1534

def actions(item_id)
end

.define_bag_use(klass, use_before_telling = false) {|item, scene| ... }

Define a usage of item from the bag

Parameters:

  • klass (Class<Studio::Item>, Symbol)

    class or db_symbol of the item

  • use_before_telling (Boolean) (defaults to: false)

    if the item should be used before showing the message

Yield Parameters:

Yield Returns:

  • (:unused)

    if block returns :unused, the item is considered as not used and not consumed



1547
1548
# File 'docs/3_Studio.rb', line 1547

def define_bag_use(klass, use_before_telling = false, &block)
end

.define_chen_prevention(klass) {|item| ... }

Define a chen prevention for an item (It’s not time to use this item)

Parameters:

  • klass (Class<Studio::Item>, Symbol)

    class or db_symbol of the item

Yield Parameters:

Yield Returns:

  • (Boolean)

    if chen tells it’s not time for that!



1553
1554
# File 'docs/3_Studio.rb', line 1553

def define_chen_prevention(klass, &block)
end

.define_event_condition(event_id, &block)

Define an event condition

Parameters:

  • event_id (Integer)

    ID of the common event that will be called if the condition validates

Yield Returns:

  • (Boolean)

    if the event can be called



1539
1540
# File 'docs/3_Studio.rb', line 1539

def define_event_condition(event_id, &block)
end

.define_on_battle_move_use(klass) {|item, creature, skill, scene| ... }

Define the actions of the item on a specific move in battle

Parameters:

  • klass (Class<Studio::Item>, Symbol)

    class or db_symbol of the item

Yield Parameters:

Yield Returns:

  • (Boolean)

    if the item can be used on the Pokemon



1603
1604
# File 'docs/3_Studio.rb', line 1603

def define_on_battle_move_use(klass, &block)
end

.define_on_creature_battler_use(klass) {|item, creature, scene| ... }

Define the actions performed on a Pokemon in battle

Parameters:

  • klass (Class<Studio::Item>, Symbol)

    class or db_symbol of the item

Yield Parameters:

Yield Returns:

  • (Boolean)

    if the item can be used on the Pokemon



1576
1577
# File 'docs/3_Studio.rb', line 1576

def define_on_creature_battler_use(klass, &block)
end

.define_on_creature_usability(klass) {|item, creature| ... }

Define if an item can be used on a specific Pokemon

Parameters:

  • klass (Class<Studio::Item>, Symbol)

    class or db_symbol of the item

Yield Parameters:

Yield Returns:

  • (Boolean)

    if the item can be used on the Pokemon



1560
1561
# File 'docs/3_Studio.rb', line 1560

def define_on_creature_usability(klass, &block)
end

.define_on_creature_use(klass) {|item, creature, scene| ... }

Define the actions performed on a Pokemon on map

Parameters:

  • klass (Class<Studio::Item>, Symbol)

    class or db_symbol of the item

Yield Parameters:

Yield Returns:

  • (Boolean)

    if the item can be used on the Pokemon



1568
1569
# File 'docs/3_Studio.rb', line 1568

def define_on_creature_use(klass, &block)
end

.define_on_move_usability(klass, skill_message_id = nil) {|item, skill, scene| ... }

Define if an item can be used on a specific Move

Parameters:

  • klass (Class<Studio::Item>, Symbol)

    class or db_symbol of the item

  • skill_message_id (Integer, nil) (defaults to: nil)

    ID of the message shown in the summary UI

Yield Parameters:

Yield Returns:

  • (Boolean)

    if the item can be used on the Pokemon



1585
1586
# File 'docs/3_Studio.rb', line 1585

def define_on_move_usability(klass, skill_message_id = nil, &block)
end

.define_on_move_use(klass) {|item, creature, skill, scene| ... }

Define the actions of the item on a specific move on map

Parameters:

  • klass (Class<Studio::Item>, Symbol)

    class or db_symbol of the item

Yield Parameters:

Yield Returns:

  • (Boolean)

    if the item can be used on the Pokemon



1594
1595
# File 'docs/3_Studio.rb', line 1594

def define_on_move_use(klass, &block)
end