Load new-style stock files

Daniel Asher Resnick 2 years ago
parent 6157bb157d
commit 41138b54b6
  1. 10
      src/lib/data/gold.rb

@ -1,4 +1,5 @@
require 'json'
require_relative '../stock'
module Charred
module Gold
@ -12,6 +13,7 @@ module Charred
lifepaths = {}
resources = {}
stat_pts = {}
stock_objs = {}
stocks = ['dwarf', 'elf', 'man', 'orc', 'roden', 'wolf']
@ -24,6 +26,9 @@ module Charred
file = File.read("data/gold/starting_stat_pts/#{stock}.json")
stat_pts[stock] = JSON.parse(file)
file = File.read("data/gold/stocks/#{stock}.json")
stock_objs[stock] = Stock.new(JSON.parse(file))
end
data.merge!({
@ -32,8 +37,9 @@ module Charred
:traits => traits,
:lifepaths => lifepaths,
:resources => resources,
:stat_pts => stat_pts
:stat_pts => stat_pts,
:stock_objs => stock_objs
})
end
end
end
end

Loading…
Cancel
Save