Class: PFM::Bag
Overview
InGame Bag management
The global Bag object is stored in $bag and PFM.game_state.bag
Constant Summary collapse
- SHORTCUT_AMOUNT =
Number of shortcut
4
Instance Attribute Summary collapse
-
#alpha_sorted ⇒ Boolean
Tell if the bag is alpha sorted.
-
#game_state ⇒ PFM::GameState
Get the game state responsive of the whole game state.
-
#last_ball_used_db_symbol ⇒ Symbol
Set the last ball used.
-
#last_battle_item_db_symbol ⇒ Symbol
Set the last battle item.
-
#last_index ⇒ Integer
Last index in the socket.
-
#last_socket ⇒ Integer
Last socket used in the bag.
-
#locked ⇒ Boolean
If the bag is locked (and react as being empty).
Instance Method Summary collapse
-
#add_item(db_symbol, nb = 1)
(also: #store_item)
Add items in the bag and trigger the right quest objective.
-
#contain_item?(db_symbol) ⇒ Boolean
(also: #has_item?)
If the bag contain a specific item.
-
#convert_to_dot26
Convert bag to .26 format.
-
#empty? ⇒ Boolean
Tell if the bag is empty.
-
#get_order(socket) ⇒ Array
Get the order of items in a socket.
-
#initialize(game_state = PFM.game_state) ⇒ Bag
constructor
Create a new Bag.
-
#item_quantity(db_symbol) ⇒ Integer
The quantity of an item in the bag.
-
#last_battle_item ⇒ Studio::Item
Get the last battle item.
-
#remove_item(db_symbol, nb = 999)
(also: #drop_item)
Remove items from the bag.
-
#reset_order(socket) ⇒ Array
(also: #sort_ids)
Reset the order of items in a socket.
-
#shortcuts ⇒ Array<Symbol>
(also: #get_shortcuts)
Get the shortcuts.
-
#sort_alpha(socket, reverse = false)
Sort the item of a socket by their names.
Constructor Details
#initialize(game_state = PFM.game_state) ⇒ Bag
Create a new Bag
56 57 |
# File 'docs/4_Systems_103_Bag.rb', line 56 def initialize(game_state = PFM.game_state) end |
Instance Attribute Details
#alpha_sorted ⇒ Boolean
Tell if the bag is alpha sorted
48 49 50 |
# File 'docs/4_Systems_103_Bag.rb', line 48 def alpha_sorted @alpha_sorted end |
#game_state ⇒ PFM::GameState
Get the game state responsive of the whole game state
51 52 53 |
# File 'docs/4_Systems_103_Bag.rb', line 51 def game_state @game_state end |
#last_ball_used_db_symbol ⇒ Symbol
Set the last ball used
45 46 47 |
# File 'docs/4_Systems_103_Bag.rb', line 45 def last_ball_used_db_symbol @last_ball_used_db_symbol end |
#last_battle_item_db_symbol ⇒ Symbol
Set the last battle item
42 43 44 |
# File 'docs/4_Systems_103_Bag.rb', line 42 def last_battle_item_db_symbol @last_battle_item_db_symbol end |
#last_index ⇒ Integer
Last index in the socket
36 37 38 |
# File 'docs/4_Systems_103_Bag.rb', line 36 def last_index @last_index end |
#last_socket ⇒ Integer
Last socket used in the bag
33 34 35 |
# File 'docs/4_Systems_103_Bag.rb', line 33 def last_socket @last_socket end |
#locked ⇒ Boolean
If the bag is locked (and react as being empty)
39 40 41 |
# File 'docs/4_Systems_103_Bag.rb', line 39 def locked @locked end |
Instance Method Details
#add_item(db_symbol, nb = 1) Also known as: store_item
Add items in the bag and trigger the right quest objective
79 80 |
# File 'docs/4_Systems_103_Bag.rb', line 79 def add_item(db_symbol, nb = 1) end |
#contain_item?(db_symbol) ⇒ Boolean Also known as: has_item?
If the bag contain a specific item
64 65 |
# File 'docs/4_Systems_103_Bag.rb', line 64 def contain_item?(db_symbol) end |
#convert_to_dot26
Convert bag to .26 format
59 60 |
# File 'docs/4_Systems_103_Bag.rb', line 59 def convert_to_dot26 end |
#empty? ⇒ Boolean
Tell if the bag is empty
69 70 |
# File 'docs/4_Systems_103_Bag.rb', line 69 def empty? end |
#get_order(socket) ⇒ Array
Get the order of items in a socket
91 92 |
# File 'docs/4_Systems_103_Bag.rb', line 91 def get_order(socket) end |
#item_quantity(db_symbol) ⇒ Integer
The quantity of an item in the bag
74 75 |
# File 'docs/4_Systems_103_Bag.rb', line 74 def item_quantity(db_symbol) end |
#last_battle_item ⇒ Studio::Item
Get the last battle item
111 112 |
# File 'docs/4_Systems_103_Bag.rb', line 111 def last_battle_item end |
#remove_item(db_symbol, nb = 999) Also known as: drop_item
Remove items from the bag
85 86 |
# File 'docs/4_Systems_103_Bag.rb', line 85 def remove_item(db_symbol, nb = 999) end |
#reset_order(socket) ⇒ Array Also known as: sort_ids
Reset the order of items in a socket
96 97 |
# File 'docs/4_Systems_103_Bag.rb', line 96 def reset_order(socket) end |
#shortcuts ⇒ Array<Symbol> Also known as: get_shortcuts
Get the shortcuts
106 107 |
# File 'docs/4_Systems_103_Bag.rb', line 106 def shortcuts end |
#sort_alpha(socket, reverse = false)
Sort the item of a socket by their names
102 103 |
# File 'docs/4_Systems_103_Bag.rb', line 102 def sort_alpha(socket, reverse = false) end |