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, quantity = 1) ⇒ 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
80 81 |
# File 'docs/4_Systems_103_Bag.rb', line 80 def add_item(db_symbol, nb = 1) end |
#contain_item?(db_symbol, quantity = 1) ⇒ Boolean Also known as: has_item?
If the bag contain a specific item
65 66 |
# File 'docs/4_Systems_103_Bag.rb', line 65 def contain_item?(db_symbol, quantity = 1) 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
70 71 |
# File 'docs/4_Systems_103_Bag.rb', line 70 def empty? end |
#get_order(socket) ⇒ Array
Get the order of items in a socket
92 93 |
# File 'docs/4_Systems_103_Bag.rb', line 92 def get_order(socket) end |
#item_quantity(db_symbol) ⇒ Integer
The quantity of an item in the bag
75 76 |
# File 'docs/4_Systems_103_Bag.rb', line 75 def item_quantity(db_symbol) end |
#last_battle_item ⇒ Studio::Item
Get the last battle item
112 113 |
# File 'docs/4_Systems_103_Bag.rb', line 112 def last_battle_item end |
#remove_item(db_symbol, nb = 999) Also known as: drop_item
Remove items from the bag
86 87 |
# File 'docs/4_Systems_103_Bag.rb', line 86 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
97 98 |
# File 'docs/4_Systems_103_Bag.rb', line 97 def reset_order(socket) end |
#shortcuts ⇒ Array<Symbol> Also known as: get_shortcuts
Get the shortcuts
107 108 |
# File 'docs/4_Systems_103_Bag.rb', line 107 def shortcuts end |
#sort_alpha(socket, reverse = false)
Sort the item of a socket by their names
103 104 |
# File 'docs/4_Systems_103_Bag.rb', line 103 def sort_alpha(socket, reverse = false) end |