Class: GamePlay::Party_Menu

Inherits:
BaseCleanUpdate::FrameBalanced show all
Includes:
PartyMenuMixin, Util::GiveTakeItem
Defined in:
docs/4_Systems_102_Party.rb

Overview

Class that display the Party Menu interface and manage user inputs

This class has several modes

  • :map => Used to select a Pokemon in order to perform stuff
  • :menu => The normal mode when opening this interface from the menu
  • :battle => Select a Pokemon to send to battle
  • :item => Select a Pokemon in order to use an item on it (require extend data : hash)
  • :hold => Give an item to the Pokemon (requires extend data : item_id)
  • :select => Select a number of Pokemon for a temporary team. (Number defined by $game_variables and possible list of excluded Pokemon requires extend data : array)

This class can also show an other party than the player party, the party paramter is an array of Pokemon upto 6 Pokemon

Constant Summary collapse

ON_POKEMON_CHOICE_COLOR_MAPPING =

Color mapping for the result of on_creature_choice

{true => 1, false => 2, nil => 3}
ON_POKEMON_CHOICE_MESSAGE_MAPPING =

Message mapping for the result of on_creature_choice in apt detect

{true => 143, false => 144, nil => 142}
SelectorRect =

Selector Rect info

Returns:

  • (Array)
[[0, 0, 132, 52], [0, 64, 132, 52]]
FRAME_HEIGHT =

Height of the frame Image to actually display (to prevent button from being hidden / shadowed). Set nil to keep the full height

214
Actions =

rubocop:disable Naming/MethodName Array of actions to do according to the pressed button

%i[action_A action_X action_Y action_B]
CHOICE_METHODS =

List of all choice method to call according to the current mode

{menu: :show_menu_mode_choice, choice: :show_choice_mode_choice, battle: :show_battle_mode_choice, item: :show_item_mode_choice, hold: :show_hold_mode_choice, select: :show_select_mode_choice, absofusion: :process_absofusion_mode, separate: :process_separate_mode, revival_blessing: :show_revival_menu_choice}

Constants inherited from BaseCleanUpdate

BaseCleanUpdate::AIU_KEY2METHOD

Constants inherited from Base

Base::DEFAULT_TRANSITION, Base::DEFAULT_TRANSITION_PARAMETER

Constants included from Input

Input::ALIAS_KEYS, Input::AXIS_MAPPING, Input::AXIS_SENSITIVITY, Input::DEAD_ZONE, Input::Keyboard, Input::Keys, Input::NON_TRIGGER_ZONE, Input::REPEAT_COOLDOWN, Input::REPEAT_SPACE

Constants included from DisplayMessage

DisplayMessage::MESSAGE_ERROR, DisplayMessage::MESSAGE_PROCESS_ERROR

Instance Attribute Summary

Attributes included from PartyMenuMixin

#call_skill_process, #return_data

Attributes inherited from Base

#__last_scene, #__result_process, #clock, #running, #viewport

Attributes included from DisplayMessage

#message_window

Instance Method Summary collapse

Methods included from Util::GiveTakeItem

#givetake_give_egg_message, #givetake_give_item, #givetake_give_item_message, #givetake_give_item_update_state, #givetake_take_item

Methods included from PartyMenuMixin

#party_selected?, #pokemon_selected?, #selected_pokemons

Methods inherited from BaseCleanUpdate::FrameBalanced

#update

Methods included from Graphics::FPSBalancer::Marker

#frame_balanced?

Methods inherited from BaseCleanUpdate

#automatic_input_update, #update

Methods inherited from Base

#add_disposable, #call_scene, #dispose, #find_parent, #main, #return_to_scene, #snap_to_bitmap, #update, #visible, #visible=

Methods included from Input

clear, close_virtual_keyboard, dir4, dir8, get_text, joy_axis_position, load_touch_screen, open_virtual_keyboard, press?, register_events, released?, repeat?, swap_states, trigger?

Methods included from DisplayMessage

#can_display_message_be_called?, #close_message_window, #display_message, #display_message_and_wait, #message_class, #message_processing?, #message_visible, #message_visible=

Constructor Details

#initialize(party, mode = :map, extend_data = nil, no_leave: false) ⇒ Party_Menu

Create a new Party_Menu

Parameters:

  • party (Array<PFM::Pokemon>) —

    list of Pokemon in the party

  • mode (Symbol) (defaults to: :map) —

    :map => from map (select), :menu => from menu, :battle => from Battle, :item => Use an item, :hold => Hold an item, :choice => processing a choice related proc (do not use)

  • extend_data (Integer, PFM::ItemDescriptor::Wrapper, Array, Symbol) (defaults to: nil) —

    extend_data informations

  • no_leave (Boolean) (defaults to: false) —

    tells the interface to disallow leaving without choosing



738
739
# File 'docs/4_Systems_102_Party.rb', line 738

def initialize(party, mode = :map, extend_data = nil, no_leave: false)
end

Instance Method Details

#action_A

Action triggered when A is pressed



809
810
# File 'docs/4_Systems_102_Party.rb', line 809

def action_A
end

#action_A_menu

Action when A is pressed and the mode is menu



812
813
# File 'docs/4_Systems_102_Party.rb', line 812

def action_A_menu
end

#action_B

Action triggered when B is pressed



815
816
# File 'docs/4_Systems_102_Party.rb', line 815

def action_B
end

#action_move_current_pokemon

Select the current pokemon to move with an other pokemon



840
841
# File 'docs/4_Systems_102_Party.rb', line 840

def action_move_current_pokemon
end

#action_X

Action triggered when X is pressed



822
823
# File 'docs/4_Systems_102_Party.rb', line 822

def action_X
end

#action_Y

Action triggered when Y is pressed



825
826
# File 'docs/4_Systems_102_Party.rb', line 825

def action_Y
end

#check_select_mon_var

Check if the $game_variables's value is between 1 and 6 If not, call action_B to exit to map return Boolean



934
935
# File 'docs/4_Systems_102_Party.rb', line 934

def check_select_mon_var
end

#current_pokemon_has_no_item ⇒ Boolean

Method telling if the Pokemon has no item or not

Returns:

  • (Boolean)


894
895
# File 'docs/4_Systems_102_Party.rb', line 894

def current_pokemon_has_no_item
end

#deselect_follower

Action of deselecting the follower



879
880
# File 'docs/4_Systems_102_Party.rb', line 879

def deselect_follower
end

#enough_pokemon?(caller = :validate) ⇒ Boolean

Check if the temporary team contains the right number of Pokemon return Boolean

Parameters:

  • caller (Symbol) (defaults to: :validate) —

    used to determine the caller of the method

Returns:

  • (Boolean)


929
930
# File 'docs/4_Systems_102_Party.rb', line 929

def enough_pokemon?(caller = :validate)
end

#get_choice_coordinates(choices) ⇒ Array(Integer, Integer)

Return the choice coordinates according to the current selected Pokemon

Parameters:

Returns:

  • (Array(Integer, Integer))


863
864
# File 'docs/4_Systems_102_Party.rb', line 863

def get_choice_coordinates(choices)
end

#give_item(item2 = -1))

Note:

if item2 is -1 it'll call the Bag interface to get the item

Action of giving an item to the Pokemon

Parameters:

  • item2 (Integer) (defaults to: -1)) —

    id of the item to give



887
888
# File 'docs/4_Systems_102_Party.rb', line 887

def give_item(item2 = -1)
end

#launch_reminder(mode = 0)

Action of launching the Pokemon Reminder

Parameters:

  • mode (Integer) (defaults to: 0) —

    mode used to launch the reminder



876
877
# File 'docs/4_Systems_102_Party.rb', line 876

def launch_reminder(mode = 0)
end

#launch_summary(mode = :view, extend_data = nil)

Action of launching the Pokemon Summary

Parameters:

  • mode (Symbol) (defaults to: :view) —

    mode used to launch the summary

  • extend_data (PFM::ItemDescriptor::Wrapper, nil) (defaults to: nil) —

    the extended data used to launch the summary



872
873
# File 'docs/4_Systems_102_Party.rb', line 872

def launch_summary(mode = :view, extend_data = nil)
end

#no_leave_B ⇒ Boolean

Function that detect no_leave and forbit the B action to process

Returns:

  • (Boolean) —

    true = no leave, false = process normally



819
820
# File 'docs/4_Systems_102_Party.rb', line 819

def no_leave_B
end

#on_item_give_choice

Event that triggers when the player choose on which pokemon to give the item



918
919
# File 'docs/4_Systems_102_Party.rb', line 918

def on_item_give_choice
end

#on_item_use_choice

Event that triggers when the player choose on which pokemon to use the item



912
913
# File 'docs/4_Systems_102_Party.rb', line 912

def on_item_use_choice
end

#on_map_choice

Event that triggers when the player has choosen a Pokemon



940
941
# File 'docs/4_Systems_102_Party.rb', line 940

def on_map_choice
end

#on_select

Event that triggers when a Pokemon is selected in :select mode



924
925
# File 'docs/4_Systems_102_Party.rb', line 924

def on_select
end

#on_send_pokemon

When the player want to send a specific Pokemon to battle



900
901
# File 'docs/4_Systems_102_Party.rb', line 900

def on_send_pokemon
end

#on_skill_choice

Event that triggers when the player choose on which pokemon to apply the move



906
907
# File 'docs/4_Systems_102_Party.rb', line 906

def on_skill_choice
end

#process_absofusion_mode

Process the fusion when the party is in mode :absofusion



949
950
# File 'docs/4_Systems_102_Party.rb', line 949

def process_absofusion_mode
end

#process_item_switch

Process the switch between the items of two pokemon



946
947
# File 'docs/4_Systems_102_Party.rb', line 946

def process_item_switch
end

#process_separate_mode

Process the separation when the party is in mode :separate



952
953
# File 'docs/4_Systems_102_Party.rb', line 952

def process_separate_mode
end

#process_switch

Process the switch between two pokemon



943
944
# File 'docs/4_Systems_102_Party.rb', line 943

def process_switch
end

#select_follower

Action of selecting the follower



882
883
# File 'docs/4_Systems_102_Party.rb', line 882

def select_follower
end

#show_battle_mode_choice

Show the choice when the party is in mode :battle



897
898
# File 'docs/4_Systems_102_Party.rb', line 897

def show_battle_mode_choice
end

#show_choice

Show the proper choice



847
848
# File 'docs/4_Systems_102_Party.rb', line 847

def show_choice
end

#show_choice_mode_choice

Show the choice when the party is in mode :choice



903
904
# File 'docs/4_Systems_102_Party.rb', line 903

def show_choice_mode_choice
end

#show_hold_mode_choice

Show the choice when the party is in mode :hold



915
916
# File 'docs/4_Systems_102_Party.rb', line 915

def show_hold_mode_choice
end

#show_item_mode_choice

Show the choice when the party is in mode :item



909
910
# File 'docs/4_Systems_102_Party.rb', line 909

def show_item_mode_choice
end

#show_map_mode_choice

Show the choice when the party is in mode :map



937
938
# File 'docs/4_Systems_102_Party.rb', line 937

def show_map_mode_choice
end

#show_menu_mode_choice

Show the choice when party is in mode :menu



854
855
# File 'docs/4_Systems_102_Party.rb', line 854

def show_menu_mode_choice
end

#show_revival_menu_choice

Process the separation when the party is in mode :show_revival_menu_choice



958
959
# File 'docs/4_Systems_102_Party.rb', line 958

def show_revival_menu_choice
end

#show_select_mode_choice

Show the choice when the party is in mode :select



921
922
# File 'docs/4_Systems_102_Party.rb', line 921

def show_select_mode_choice
end

#skill_color ⇒ Integer

Return the skill color

Returns:

  • (Integer)


851
852
# File 'docs/4_Systems_102_Party.rb', line 851

def skill_color
end

#take_item

Action of taking the item from the Pokemon



890
891
# File 'docs/4_Systems_102_Party.rb', line 890

def take_item
end

#update_graphics Also known as: update_during_process

Update the scene graphics during an animation or something else



748
749
# File 'docs/4_Systems_102_Party.rb', line 748

def update_graphics
end

#update_inputs

Update the inputs



741
742
# File 'docs/4_Systems_102_Party.rb', line 741

def update_inputs
end

#update_menu_choice(choices)

Update the scene during a choice

Parameters:



858
859
# File 'docs/4_Systems_102_Party.rb', line 858

def update_menu_choice(choices)
end

#update_mouse(_moved)

Update the mouse

Parameters:

  • _moved (Boolean) —

    if the mouse moved



745
746
# File 'docs/4_Systems_102_Party.rb', line 745

def update_mouse(_moved)
end

#update_mouse_ctrl

Update the mouse interaction with the ctrl buttons



828
829
# File 'docs/4_Systems_102_Party.rb', line 828

def update_mouse_ctrl
end

#update_mouse_selector_move

Update the movement of the selector with the mouse



834
835
# File 'docs/4_Systems_102_Party.rb', line 834

def update_mouse_selector_move
end

#update_pokemon_form(reason)

Handle form change when using an item such as Reveal Glass



955
956
# File 'docs/4_Systems_102_Party.rb', line 955

def update_pokemon_form(reason)
end

#update_selector_coordinates

Update the selector coordinates



837
838
# File 'docs/4_Systems_102_Party.rb', line 837

def update_selector_coordinates(*)
end

#update_selector_move

Update the movement of the Cursor



831
832
# File 'docs/4_Systems_102_Party.rb', line 831

def update_selector_move
end

#use_pokemon_skill(move_index)

Action of using a move of the current Pokemon

Parameters:

  • move_index (Integer) —

    index of the move in the Pokemon moveset



867
868
# File 'docs/4_Systems_102_Party.rb', line 867

def use_pokemon_skill(move_index)
end