mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-10 06:34:59 +00:00
Turned Town Map PBS data into a GameData class
This commit is contained in:
42
Data/Scripts/010_Data/002_PBS data/007_BerryPlant.rb
Normal file
42
Data/Scripts/010_Data/002_PBS data/007_BerryPlant.rb
Normal file
@@ -0,0 +1,42 @@
|
||||
module GameData
|
||||
class BerryPlant
|
||||
attr_reader :id
|
||||
attr_reader :hours_per_stage
|
||||
attr_reader :drying_per_hour
|
||||
attr_reader :yield
|
||||
|
||||
DATA = {}
|
||||
DATA_FILENAME = "berry_plants.dat"
|
||||
|
||||
SCHEMA = {
|
||||
"SectionName" => [:id, "m"],
|
||||
"HoursPerStage" => [:hours_per_stage, "v"],
|
||||
"DryingPerHour" => [:drying_per_hour, "u"],
|
||||
"Yield" => [:yield, "uv"]
|
||||
}
|
||||
|
||||
NUMBER_OF_REPLANTS = 9
|
||||
NUMBER_OF_GROWTH_STAGES = 4
|
||||
NUMBER_OF_FULLY_GROWN_STAGES = 4
|
||||
WATERING_CANS = [:SPRAYDUCK, :SQUIRTBOTTLE, :WAILMERPAIL, :SPRINKLOTAD]
|
||||
|
||||
extend ClassMethodsSymbols
|
||||
include InstanceMethods
|
||||
|
||||
def initialize(hash)
|
||||
@id = hash[:id]
|
||||
@hours_per_stage = hash[:hours_per_stage] || 3
|
||||
@drying_per_hour = hash[:drying_per_hour] || 15
|
||||
@yield = hash[:yield] || [2, 5]
|
||||
@yield.reverse! if @yield[1] < @yield[0]
|
||||
end
|
||||
|
||||
def minimum_yield
|
||||
return @yield[0]
|
||||
end
|
||||
|
||||
def maximum_yield
|
||||
return @yield[1]
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user