|
|
@ -3,6 +3,29 @@ require 'json' |
|
|
|
module Charred |
|
|
|
module Charred |
|
|
|
module Custom |
|
|
|
module Custom |
|
|
|
def load_custom(data) |
|
|
|
def load_custom(data) |
|
|
|
|
|
|
|
Dir.glob("data/custom/*/") { |dir| |
|
|
|
|
|
|
|
stock_name = File.basename(dir) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if File.readable?("dir/skills.json") |
|
|
|
|
|
|
|
skills = json_get("dir/skills.json") |
|
|
|
|
|
|
|
verbose_merge data[:skills], skills |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if File.readable?("dir/traits.json") |
|
|
|
|
|
|
|
traits = json_get("dir/traits.json") |
|
|
|
|
|
|
|
verbose_merge data[:traits], traits |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if File.readable?("dir/lifepaths.json") |
|
|
|
|
|
|
|
lifepaths = json_get("dir/lifepaths.json") |
|
|
|
|
|
|
|
data[:lifepaths][stock_name] = lifepaths |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if File.readable?("dir/resources.json") |
|
|
|
|
|
|
|
resources = json_get("dir/resources.json") |
|
|
|
|
|
|
|
data[:resources][stock_name] = resources |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
} |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|