Module: GameData::MiningGame
- Defined in:
- scripts/01450 Systems/08001 Mining Game/00010 GameData_Mining_Game/00001 GameData_MiningGame.rb
Overview
Module that describes the Mining Game database and its derived methods
Constant Summary collapse
- DATA_ITEM =
The data list of each item that exist for the MiningGame probability is an Integer and states how many chances out of the total of chances the item will be picked by the system. layout is a [Array<Array>] where each sub-Array is assigned to one line; x means a part of the ITEM is here, o means that's not the case. accepted_max_rotation is an Integer (between 0 and 3) determining the max rotation the sprite can have (90x degrees, x being accepted_max_rotation).
{}
- DATA_IRON =
The data list of each iron that exist for the MiningGame probability is an Integer and states how many chances out of the total of chances the item will be picked by the system. layout is a [Array<Array>] where each sub-Array is assigned to one line; x means a part of the ITEM is here, o means that's not the case. accepted_max_rotation is an Integer (between 0 and 3) determining the max rotation the sprite can have (90x degrees, x being accepted_max_rotation).
{}
Class Method Summary collapse
-
.iron_total_chance ⇒ Integer
Return the total of the chances to get a certain iron.
-
.o
Sign that indicate a part of the ITEM does not exist on a specific tile of a layout.
- .register_iron(symbol, probability, layout, accepted_max_rotation)
- .register_item(db_symbol, probability, layout, accepted_max_rotation)
-
.total_chance ⇒ Integer
Return the total of the chances to get a certain item.
-
.x
Sign that indicate a part of the ITEM exist on a specific tile of a layout.
Class Method Details
.iron_total_chance ⇒ Integer
Return the total of the chances to get a certain iron
109 110 111 112 113 114 115 |
# File 'scripts/01450 Systems/08001 Mining Game/00010 GameData_Mining_Game/00001 GameData_MiningGame.rb', line 109 def iron_total_chance count = 0 DATA_IRON.each_key do |key| count += DATA_IRON[key.to_sym][:probability] end return count end |
.o
Sign that indicate a part of the ITEM does not exist on a specific tile of a layout
14 15 16 |
# File 'scripts/01450 Systems/08001 Mining Game/00010 GameData_Mining_Game/00001 GameData_MiningGame.rb', line 14 def o return false end |
.register_iron(symbol, probability, layout, accepted_max_rotation)
22 23 24 |
# File 'scripts/01450 Systems/08001 Mining Game/00010 GameData_Mining_Game/00001 GameData_MiningGame.rb', line 22 def register_iron(symbol, probability, layout, accepted_max_rotation) DATA_IRON[symbol] = {probability: probability, layout: layout, accepted_max_rotation: accepted_max_rotation} end |
.register_item(db_symbol, probability, layout, accepted_max_rotation)
18 19 20 |
# File 'scripts/01450 Systems/08001 Mining Game/00010 GameData_Mining_Game/00001 GameData_MiningGame.rb', line 18 def register_item(db_symbol, probability, layout, accepted_max_rotation) DATA_ITEM[db_symbol] = {probability: probability, layout: layout, accepted_max_rotation: accepted_max_rotation} end |
.total_chance ⇒ Integer
Return the total of the chances to get a certain item
99 100 101 102 103 104 105 |
# File 'scripts/01450 Systems/08001 Mining Game/00010 GameData_Mining_Game/00001 GameData_MiningGame.rb', line 99 def total_chance count = 0 DATA_ITEM.each_key do |key| count += DATA_ITEM[key.to_sym][:probability] end return count end |
.x
Sign that indicate a part of the ITEM exist on a specific tile of a layout
8 9 10 |
# File 'scripts/01450 Systems/08001 Mining Game/00010 GameData_Mining_Game/00001 GameData_MiningGame.rb', line 8 def x return true end |