Switch all lifepath files to wrapped format

And change loading accordingly
pull/11/head
parent 4b4b847644
commit 38a49c8327
  1. 3797
      src/data/gold/lifepaths/dwarf.json
  2. 3941
      src/data/gold/lifepaths/elf.json
  3. 23343
      src/data/gold/lifepaths/man.json
  4. 3039
      src/data/gold/lifepaths/orc.json
  5. 3303
      src/data/gold/lifepaths/roden.json
  6. 1811
      src/data/gold/lifepaths/wolf.json
  7. 34
      src/lib/data/custom.rb
  8. 5
      src/lib/data/dark_elf.rb
  9. 3
      src/lib/data/gold.rb
  10. 3
      src/lib/data/troll.rb
  11. 5
      src/lib/data/wizard.rb

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -3,23 +3,23 @@ require 'json'
module Charred
module Custom
def load_custom(data)
Dir.glob("data/custom/**/*") { |file|
if File.file?(file)
case File.extname(file)
when "skills"
verbose_merge data[:skills], json_get(file)
when "traits"
verbose_merge data[:traits], json_get(file)
when "stock"
stock = Stock.new(json_get(file))
data[:stocks][stock.key] = stock # This overwrites existing data...
when "lifepaths"
#
when "resources"
#
end
end
}
#Dir.glob("data/custom/**/*") { |file|
# if File.file?(file)
# case File.extname(file)
# when "skills"
# verbose_merge data[:skills], json_get(file)
# when "traits"
# verbose_merge data[:traits], json_get(file)
# when "stock"
# stock = Stock.new(json_get(file))
# data[:stocks][stock.key] = stock # This overwrites existing data...
# when "lifepaths"
# #
# when "resources"
# #
# end
# end
#}
# Dir.glob("data/custom/*/") { |dir|
# stock_name = File.basename(dir)

@ -12,7 +12,8 @@ module Charred
verbose_merge data[:traits], traits
file = File.read('data/dark_elf/lifepaths.json')
lifepaths = JSON.parse(file)
contents = JSON.parse(file)
lifepaths = contents["settings"]
file = File.read("data/dark_elf/resources.json")
resources = JSON.parse(file)
@ -32,4 +33,4 @@ module Charred
data[:lifepaths]['elf'] = elf
end
end
end
end

@ -18,7 +18,8 @@ module Charred
gold_stocks.each do |stock|
file = File.read("data/gold/lifepaths/#{stock}.json")
lifepaths[stock] = JSON.parse(file)
contents = JSON.parse(file)
lifepaths[stock] = contents["settings"]
file = File.read("data/gold/resources/#{stock}.json")
resources[stock] = JSON.parse(file)

@ -13,7 +13,8 @@ module Charred
verbose_merge data[:traits], traits
file = File.read('data/troll/lifepaths.json')
lifepaths = JSON.parse(file)
contents = JSON.parse(file)
lifepaths = contents["settings"]
data[:lifepaths]['troll'] = lifepaths
file = File.read("data/troll/resources.json")

@ -4,7 +4,8 @@ module Charred
module Wizard
def load_wizard(data)
file = File.read('data/wizard/lifepaths.json')
wizard_data = JSON.parse(file)
contents = JSON.parse(file)
wizard_data = contents["settings"]
file = File.read('data/wizard/skills.json')
wizard_skills = JSON.parse(file)
@ -116,4 +117,4 @@ module Charred
data
end
end
end
end

Loading…
Cancel
Save