Wrap (and update loading of) resources

pull/11/head
Daniel Asher Resnick 2 years ago
parent 38a49c8327
commit 849b957a7b
  1. 5
      src/data/dark_elf/resources.json
  2. 5
      src/data/gold/resources/dwarf.json
  3. 5
      src/data/gold/resources/elf.json
  4. 5
      src/data/gold/resources/man.json
  5. 5
      src/data/gold/resources/orc.json
  6. 5
      src/data/gold/resources/roden.json
  7. 5
      src/data/gold/resources/wolf.json
  8. 5
      src/data/troll/resources.json
  9. 3
      src/lib/data/dark_elf.rb
  10. 3
      src/lib/data/gold.rb
  11. 3
      src/lib/data/troll.rb

@ -1,4 +1,6 @@
[ {
"stock": "elf",
"resources": [
{ {
"name": "Bitter Poison", "name": "Bitter Poison",
"type": "gear", "type": "gear",
@ -112,3 +114,4 @@
] ]
} }
] ]
}

@ -1,4 +1,6 @@
[ {
"stock": "dwarf",
"resources": [
{ {
"name": "Shoddy Arms", "name": "Shoddy Arms",
"rp": 5, "rp": 5,
@ -150,3 +152,4 @@
"type": "gear" "type": "gear"
} }
] ]
}

@ -1,4 +1,6 @@
[ {
"stock": "elf",
"resources": [
{ {
"name": "Run Of The Mill Bow", "name": "Run Of The Mill Bow",
"type": "gear", "type": "gear",
@ -174,3 +176,4 @@
] ]
} }
] ]
}

@ -1,4 +1,6 @@
[ {
"stock": "man",
"resources": [
{ {
"name": "Arms", "name": "Arms",
"type": "gear", "type": "gear",
@ -432,3 +434,4 @@
] ]
} }
] ]
}

@ -1,4 +1,6 @@
[ {
"stock": "orc",
"resources": [
{ {
"name": "Rags", "name": "Rags",
"rp": 1, "rp": 1,
@ -209,3 +211,4 @@
"type": "gear" "type": "gear"
} }
] ]
}

@ -1,4 +1,6 @@
[ {
"stock": "roden",
"resources": [
{ {
"name": "Arms", "name": "Arms",
"rp": 5, "rp": 5,
@ -137,3 +139,4 @@
] ]
} }
] ]
}

@ -1,4 +1,6 @@
[ {
"stock": "wolf",
"resources": [
{ {
"name": "Territory", "name": "Territory",
"type": "property", "type": "property",
@ -40,3 +42,4 @@
] ]
} }
] ]
}

@ -1,4 +1,6 @@
[ {
"stock": "troll",
"resources": [
{ {
"name": "Rags", "name": "Rags",
"type": "gear", "type": "gear",
@ -55,3 +57,4 @@
"rp": 5 "rp": 5
} }
] ]
}

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

@ -22,7 +22,8 @@ module Charred
lifepaths[stock] = contents["settings"] lifepaths[stock] = contents["settings"]
file = File.read("data/gold/resources/#{stock}.json") file = File.read("data/gold/resources/#{stock}.json")
resources[stock] = JSON.parse(file) contents = JSON.parse(file)
resources[stock] = contents["resources"]
file = File.read("data/gold/stocks/#{stock}.json") file = File.read("data/gold/stocks/#{stock}.json")
stocks[stock] = Stock.new(JSON.parse(file)) stocks[stock] = Stock.new(JSON.parse(file))

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

Loading…
Cancel
Save