From ffd5dc4d77448f2953311689b89dc3eb6bd529b5 Mon Sep 17 00:00:00 2001 From: Daniel Asher Resnick Date: Tue, 4 Oct 2022 22:27:03 -0500 Subject: [PATCH] wip --- Gemfile | 3 +- Gemfile.lock | 2 + src/app.rb | 11 + src/public/css/stocked.css | 11 +- src/public/js/stocked.js | 2030 ++------------------ src/public/js/stocked/test/data-archive.js | 1796 +++++++++++++++++ src/public/js/stocked/test/data_1.json | 23 + src/views/partials/stocked.erb | 56 +- 8 files changed, 2041 insertions(+), 1891 deletions(-) create mode 100644 src/public/js/stocked/test/data-archive.js create mode 100644 src/public/js/stocked/test/data_1.json diff --git a/Gemfile b/Gemfile index 5228531..bb063c9 100644 --- a/Gemfile +++ b/Gemfile @@ -5,7 +5,8 @@ gem 'sinatra' gem 'sinatra-contrib' gem 'prawn', '2.2.2' gem 'prawn-templates', '0.1.1' +gem 'rubyzip' group :development do gem 'rerun' -end \ No newline at end of file +end diff --git a/Gemfile.lock b/Gemfile.lock index 3c6664b..8343095 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -37,6 +37,7 @@ GEM listen (~> 3.0) ruby-rc4 (0.1.5) ruby_dep (1.5.0) + rubyzip (2.3.2) sinatra (2.0.5) mustermann (~> 1.0) rack (~> 2.0) @@ -63,6 +64,7 @@ DEPENDENCIES prawn (= 2.2.2) prawn-templates (= 0.1.1) rerun + rubyzip sinatra sinatra-contrib thin diff --git a/src/app.rb b/src/app.rb index 9a9aba3..f296a7a 100644 --- a/src/app.rb +++ b/src/app.rb @@ -123,6 +123,17 @@ post '/wiki' do "/get_file?file=#{key}&download_name=#{data['name']} Character Sheet.wiki" end +post '/stocked_download' do + request.body.rewind + raw = request.body.readpartial(16 * 1024) + puts raw + data = JSON.parse(raw) + key = "stock-#{Time.now.strftime('%Y%m%d%H%M%S%L')}-#{rand(1...10000)}" + CACHE.store key, data + + "/get_file?file=#{key}&download_name=#{data['Name']}.stock" +end + get '/get_file' do data = nil if params['download_name'].match(/\.pdf$/) diff --git a/src/public/css/stocked.css b/src/public/css/stocked.css index 7650f51..481529f 100644 --- a/src/public/css/stocked.css +++ b/src/public/css/stocked.css @@ -48,9 +48,10 @@ div.skill-even { div.skill-odd { background: #F5F5F5; } -div.trait-even { +tr.trait-even { + background: lightgray; } -div.trait-odd { +tr.trait-odd { background: #F5F5F5; } textarea.trait-desc { @@ -58,3 +59,9 @@ textarea.trait-desc { width: 98%; margin: 1em; } +table.traits{ + width: 100%; +} +table.traits input.editable-name { + width: 100%; +} diff --git a/src/public/js/stocked.js b/src/public/js/stocked.js index 582397d..768070a 100644 --- a/src/public/js/stocked.js +++ b/src/public/js/stocked.js @@ -1,1828 +1,28 @@ -class TimeLogger { - constructor() { - this.logs = []; - this.unlabelled_id = 0; - this.start = this.previous = Date.now(); - this.log('start'); - } - log(label) { - var now = Date.now(); - var log = { - 'when': now, - 'label': label, - 'elapsed': now - this.previous, - 'total': now - this.start - }; - this.logs.push(log); - this.previous = now; - return log; - } -} - -const timelogger = new TimeLogger; - -console.log(timelogger.logs[0]); - -var test_data = { - // "Chattel Setting": { - // "Born Chattel": { - // "time": 10, - // "res": 5, - // "stat": [ - // [ - // 1, - // "p" - // ] - // ], - // "leads": [ - // "Black Legion", - // "Servant" - // ], - // "skills": [ - // [ - // 2, - // "General" - // ] - // ], - // "traits": [ - // 1 - // ], - // "common_traits": [ - // "Cannibal", - // "Cold Black Blood", - // "Breeder", - // "Fanged And Clawed", - // "Loathsome And Twisted", - // "Lynx-eyed, Like Burning Coals", - // "Vile Language" - // ], - // "key_leads": [ - // "Black Legion Subsetting", - // "Servant Of The Dark Blood Subsetting" - // ] - // }, - // "Cattle Slave": { - // "time": 5, - // "res": 3, - // "stat": [ - // [ - // 1, - // "p" - // ] - // ], - // "skills": [ - // [ - // 2, - // "Animal Husbandry" - // ] - // ], - // "traits": [ - // 2, - // "Tasting The Lash", - // "Screaming", - // "Shouting", - // "Kicking The Beast" - // ] - // }, - // "Scavenger": { - // "time": 3, - // "res": 6, - // "stat": [ - // [ - // 1, - // "p" - // ] - // ], - // "leads": [ - // "Black Legion" - // ], - // "skills": [ - // [ - // 3, - // "Foraging", - // "Inconspicuous" - // ] - // ], - // "traits": [ - // 2, - // "Tasting The Lash", - // "Running (Away)", - // "Hiding", - // "Stealing", - // "Scavenger" - // ], - // "key_leads": [ - // "Black Legion Subsetting" - // ] - // }, - // "Forge Slave": { - // "time": 5, - // "res": 3, - // "stat": [ - // [ - // 1, - // "p" - // ] - // ], - // "skills": [ - // [ - // 2, - // "Ditch Digging" - // ] - // ], - // "traits": [ - // 2, - // "Tasting The Lash", - // "Pain Life", - // "Back-breaking Labor", - // "Numb" - // ] - // }, - // "Hauler": { - // "time": 5, - // "res": 3, - // "stat": [ - // [ - // 1, - // "p" - // ] - // ], - // "skills": [ - // [ - // 2, - // "Driving", - // "Beast Of Burden-wise" - // ] - // ], - // "traits": [ - // 2, - // "Tasting The Lash", - // "Back-breaking Labor", - // "Cursing", - // "Spitting", - // "Yowling" - // ] - // }, - // "Cutter Slave": { - // "time": 5, - // "res": 3, - // "stat": [ - // [ - // 1, - // "p" - // ] - // ], - // "skills": [ - // [ - // 2, - // "Tree Pulling", - // "Ditch Digging" - // ] - // ], - // "traits": [ - // 2, - // "Tasting The Lash", - // "Hatred Of Forests", - // "Back-breaking Labor" - // ] - // }, - // "Tunneler": { - // "time": 4, - // "res": 3, - // "stat": [ - // [ - // 1, - // "p" - // ] - // ], - // "skills": [ - // [ - // 2, - // "Ditch Digging", - // "Tunnel-wise" - // ] - // ], - // "traits": [ - // 2, - // "Tasting The Lash", - // "Back-breaking Labor", - // "Black Lung" - // ] - // }, - // "Ravager": { - // "time": 3, - // "res": 8, - // "stat": [ - // [ - // 1, - // "p" - // ] - // ], - // "leads": [ - // "Black Legion" - // ], - // "skills": [ - // [ - // 4, - // "Brawling", - // "Cudgel", - // "Intimidation" - // ] - // ], - // "traits": [ - // 2, - // "Pack Hunter" - // ], - // "key_leads": [ - // "Black Legion Subsetting" - // ] - // }, - // "Woodcutter": { - // "time": 7, - // "res": 9, - // "stat": [ - // [ - // 1, - // "m" - // ] - // ], - // "skills": [ - // [ - // 4, - // "Rude Carpentry", - // "Mending", - // "Intimidation" - // ] - // ], - // "traits": [ - // 1 - // ], - // "requires": "Cutter Slave", - // "requires_expr": [ - // "cutter slave" - // ] - // }, - // "Butcher": { - // "time": 7, - // "res": 9, - // "stat": [ - // [ - // 1, - // "m" - // ] - // ], - // "skills": [ - // [ - // 4, - // "Butchery", - // "Tanner", - // "Intimidation" - // ] - // ], - // "traits": [ - // 1 - // ], - // "requires": "Cattle Slave", - // "requires_expr": [ - // "cattle slave" - // ] - // }, - // "Forger": { - // "time": 7, - // "res": 9, - // "stat": [ - // [ - // 1, - // "m" - // ] - // ], - // "skills": [ - // [ - // 5, - // "Blacksmith", - // "Intimidation" - // ] - // ], - // "traits": [ - // 2, - // "Singed" - // ], - // "requires": "Forge Slave", - // "requires_expr": [ - // "forge slave" - // ] - // }, - // "Pitwright": { - // "time": 8, - // "res": 10, - // "stat": [ - // [ - // 1, - // "m" - // ] - // ], - // "skills": [ - // [ - // 4, - // "Mining", - // "Intimidation" - // ] - // ], - // "traits": [ - // 1, - // "Deep Sense" - // ], - // "requires": "Tunneler", - // "requires_expr": [ - // "tunneler" - // ] - // }, - // "Edge Grinder": { - // "time": 10, - // "res": 15, - // "stat": [ - // [ - // 1, - // "pm" - // ] - // ], - // "leads": [ - // "Black Legion" - // ], - // "skills": [ - // [ - // 6, - // "Mending", - // "Weaponsmith", - // "Armorer", - // "Tanner" - // ] - // ], - // "traits": [ - // 2, - // "Suspicious" - // ], - // "requires": "He Who Grinds the Edges of our Axes to Glinting Sharpness requires Forger", - // "requires_expr": [ - // "forger" - // ], - // "key_leads": [ - // "Black Legion Subsetting" - // ] - // }, - // "Whipmaster": { - // "time": 9, - // "res": 15, - // "stat": [ - // [ - // 1, - // "m" - // ] - // ], - // "leads": [ - // "Black Legion" - // ], - // "skills": [ - // [ - // 4, - // "Interrogation", - // "Intimidation", - // "Brawling", - // "Orcish Torture" - // ] - // ], - // "traits": [ - // 1, - // "Where There's A Whip, There's A Way" - // ], - // "requires": "Pitwright, Forger, four Slave life paths, or any Great and Black, or Legion lifepath", - // "requires_expr": [ - // "+or", - // [ - // "pitwright", - // "forger" - // ], - // [ - // "+has_n_lifepaths_in", - // 4, - // "cattle slave", - // "forge slave", - // "cutter slave" - // ], - // [ - // "great and black setting:born great", - // "great and black setting:the rites", - // "great and black setting:servant of the gate", - // "great and black setting:follower", - // "great and black setting:black destroyer", - // "great and black setting:named", - // "great and black setting:siege master", - // "great and black setting:gate forger", - // "great and black setting:whisperer", - // "great and black setting:great one", - // "black legion subsetting:goblin", - // "black legion subsetting:sun blotter", - // "black legion subsetting:nightseeker", - // "black legion subsetting:legioner", - // "black legion subsetting:hatred bearer", - // "black legion subsetting:despair shouter", - // "black legion subsetting:black hunter", - // "black legion subsetting:astride the beast", - // "black legion subsetting:bears the lash", - // "black legion subsetting:packmaster", - // "black legion subsetting:head taker", - // "black legion subsetting:troll lord" - // ] - // ], - // "key_leads": [ - // "Black Legion Subsetting" - // ] - // } - // }, - // "Great And Black Setting": { - // "Born Great": { - // "time": 10, - // "res": 5, - // "leads": [ - // "Servant" - // ], - // "skills": [ - // [ - // 3, - // "General" - // ] - // ], - // "traits": [ - // 2, - // "Born To Rule Them All", - // "Enemy Of The Sun" - // ], - // "common_traits": [ - // "Cannibal", - // "Cold Black Blood", - // "Breeder", - // "Fanged And Clawed", - // "Loathsome And Twisted", - // "Lynx-eyed, Like Burning Coals", - // "Vile Language" - // ], - // "key_leads": [ - // "Servant Of The Dark Blood Subsetting" - // ] - // }, - // "The Rites": { - // "time": 3, - // "res": 3, - // "stat": [ - // [ - // 1, - // "m" - // ], - // [ - // 1, - // "p" - // ] - // ], - // "leads": [ - // "Black Legion", - // "Servant" - // ], - // "skills": [ - // [ - // 5, - // "Brawling", - // "Intimidation", - // "Orcish Torture" - // ] - // ], - // "traits": [ - // 2, - // "Life Is Death", - // "Sprinter" - // ], - // "restrict": "The Rites may only be taken once and it must be the character's second lifepath.", - // "requires_expr": [ - // "+and", - // [ - // "+has_n_lifepaths_or_more", - // 1 - // ], - // [ - // "+has_n_lifepaths_or_less", - // 1 - // ] - // ], - // "key_leads": [ - // "Black Legion Subsetting", - // "Servant Of The Dark Blood Subsetting" - // ] - // }, - // "Servant Of The Gate": { - // "time": 4, - // "res": 7, - // "stat": [ - // [ - // 1, - // "p" - // ] - // ], - // "leads": [ - // "Black Legion", - // "Chattel" - // ], - // "skills": [ - // [ - // 2, - // "Soothing Platitudes", - // "Ditch Digging" - // ] - // ], - // "traits": [ - // 1, - // "Humble Before My Master", - // "Hauling", - // "Back-breaking Labor" - // ], - // "key_leads": [ - // "Black Legion Subsetting", - // "Chattel Setting" - // ] - // }, - // "Follower": { - // "time": 5, - // "res": 9, - // "stat": [ - // [ - // 1, - // "m" - // ], - // [ - // 1, - // "p" - // ] - // ], - // "leads": [ - // "Black Legion", - // "Chattel" - // ], - // "skills": [ - // [ - // 8, - // "Armor Training", - // "Axe", - // "Bow", - // "Knives", - // "Mace", - // "Riding", - // "Shield Training", - // "Clan-wise" - // ] - // ], - // "traits": [ - // 1, - // "Silent Hatred" - // ], - // "requires": "He Who Walks in the Named's Shadow requires The Rites or Astride the Beast", - // "requires_expr": [ - // "the rites", - // "astride the beast" - // ], - // "key_leads": [ - // "Black Legion Subsetting", - // "Chattel Setting" - // ] - // }, - // "Black Destroyer": { - // "time": 6, - // "res": 12, - // "stat": [ - // [ - // 1, - // "m" - // ], - // [ - // 1, - // "p" - // ] - // ], - // "leads": [ - // "Chattel" - // ], - // "skills": [ - // [ - // 7, - // "Mounted Combat Training", - // "Great Wolf Husbandry", - // "Riding", - // "Axe", - // "Spear" - // ] - // ], - // "traits": [ - // 2, - // "Intense Hatred", - // "Low Cunning" - // ], - // "requires": "He Whose Skin is like Winter Night, Whose Mere Presence Causes Those Beneath Him to Shiver in Terror and Cower Beneath his Wicked Blade requires Follower, Astride the Beast or Head Taker", - // "requires_expr": [ - // "follower", - // "astride the beast", - // "head taker" - // ], - // "key_leads": [ - // "Chattel Setting" - // ] - // }, - // "Named": { - // "time": 8, - // "res": 25, - // "stat": [ - // [ - // 1, - // "m" - // ], - // [ - // 1, - // "p" - // ] - // ], - // "leads": [ - // "Chattel" - // ], - // "skills": [ - // [ - // 5, - // "Command", - // "Brutal Intimidation", - // "Orcish Torture" - // ] - // ], - // "traits": [ - // 2, - // "Savage Consequences" - // ], - // "requires": "He Who is Mighty and Earned the Ancient Right to be Named requires Black Destroyer, Troll Lord or Head Taker", - // "requires_expr": [ - // "black destroyer", - // "troll lord", - // "head taker" - // ], - // "key_leads": [ - // "Chattel Setting" - // ] - // }, - // "Siege Master": { - // "time": 10, - // "res": 30, - // "stat": [ - // [ - // 1, - // "m" - // ] - // ], - // "leads": [ - // "Chattel" - // ], - // "skills": [ - // [ - // 5, - // "Siege Engineer", - // "Artillerist", - // "Mending" - // ] - // ], - // "traits": [ - // 1, - // "The Bigger They Come...", - // "Brutish Efficiency" - // ], - // "requires": "Servant of the Gate", - // "requires_expr": [ - // "servant of the gate" - // ], - // "key_leads": [ - // "Chattel Setting" - // ] - // }, - // "Gate Forger": { - // "time": 10, - // "res": 30, - // "stat": [ - // [ - // 1, - // "m" - // ] - // ], - // "leads": [ - // "Chattel" - // ], - // "skills": [ - // [ - // 5, - // "Mason", - // "Bastions Of Hatred", - // "Mining" - // ] - // ], - // "traits": [ - // 1, - // "Rare Talent" - // ], - // "requires": "Siege Master", - // "requires_expr": [ - // "siege master" - // ], - // "key_leads": [ - // "Chattel Setting" - // ] - // }, - // "Whisperer": { - // "time": 9, - // "res": 40, - // "stat": [ - // [ - // 1, - // "m" - // ] - // ], - // "leads": [ - // "Servant" - // ], - // "skills": [ - // [ - // 5, - // "Poisonous Platitudes", - // "Falsehood", - // "Persuasion", - // "Clan-wise", - // "Ambition-wise" - // ] - // ], - // "traits": [ - // 2, - // "Forked Tongue", - // "Poisonous Ambition" - // ], - // "requires": "Slave to the Dark, Whipmaster, Gate Forger or Bears the Lash", - // "requires_expr": [ - // "slave to the dark", - // "whipmaster", - // "gate forger", - // "bears the lash" - // ], - // "key_leads": [ - // "Servant Of The Dark Blood Subsetting" - // ] - // }, - // "Great One": { - // "time": 20, - // "res": 60, - // "stat": [ - // [ - // 2, - // "m" - // ], - // [ - // 2, - // "p" - // ] - // ], - // "leads": [ - // "Black Legion" - // ], - // "skills": [ - // [ - // 5, - // "Command", - // "Strategy", - // "Name Ritual" - // ], - // [ - // 1, - // "General" - // ] - // ], - // "traits": [ - // 2, - // "Flights Of Murderous Fancy", - // "Unrelenting Hatred" - // ], - // "requires": "Named and the Born to Rule Them All trait", - // "requires_expr": [ - // "+and", - // [ - // "named" - // ], - // [ - // "+trait", - // "born to rule them all" - // ] - // ], - // "key_leads": [ - // "Black Legion Subsetting" - // ] - // } - // }, - // "Black Legion Subsetting": { - // "Goblin": { - // "time": 3, - // "res": 2, - // "stat": [ - // [ - // 1, - // "p" - // ] - // ], - // "leads": [ - // "Chattel" - // ], - // "skills": [ - // [ - // 2, - // "Foraging", - // "Brawling" - // ] - // ], - // "traits": [ - // 2, - // "Tasting The Lash", - // "Exhausted", - // "Running (Away)", - // "Charging Blindly", - // "Marching" - // ], - // "restrict": "Born Great orcs may not take this path.", - // "requires_expr": [ - // "+not", - // [ - // "born great" - // ] - // ], - // "key_leads": [ - // "Chattel Setting" - // ] - // }, - // "Sun Blotter": { - // "time": 3, - // "res": 3, - // "stat": [ - // [ - // 1, - // "p" - // ] - // ], - // "leads": [ - // "Chattel" - // ], - // "skills": [ - // [ - // 2, - // "Bow", - // "Mending", - // "Fletcher" - // ] - // ], - // "traits": [ - // 1, - // "Hiding", - // "Running (Away)" - // ], - // "restrict": "Born Great orcs may not take this path.", - // "requires_expr": [ - // "+not", - // [ - // "born great" - // ] - // ], - // "key_leads": [ - // "Chattel Setting" - // ] - // }, - // "Nightseeker": { - // "time": 4, - // "res": 4, - // "stat": [ - // [ - // 1, - // "p" - // ], - // [ - // 1, - // "m" - // ] - // ], - // "leads": [ - // "Chattel" - // ], - // "skills": [ - // [ - // 5, - // "Orienteering", - // "Tracking", - // "Trapper", - // "Stealthy", - // "Climbing", - // "Garrote" - // ] - // ], - // "traits": [ - // 1, - // "Tasting The Lash" - // ], - // "requires": "He Who Lurks in the Twilight and Seeks Our Enemies requires Legioner, Sun Blotter, Scavenger or Ravager", - // "restrict": "Born Great orcs may not take this path.", - // "requires_expr": [ - // "+and", - // [ - // "legioner", - // "sun blotter", - // "scavenger", - // "ravager" - // ], - // [ - // "+not", - // [ - // "born great" - // ] - // ] - // ], - // "key_leads": [ - // "Chattel Setting" - // ] - // }, - // "Legioner": { - // "time": 4, - // "res": 5, - // "stat": [ - // [ - // 1, - // "p" - // ] - // ], - // "leads": [ - // "Chattel" - // ], - // "skills": [ - // [ - // 4, - // "Spear", - // "Shield Training", - // "Brawling", - // "Foraging" - // ] - // ], - // "traits": [ - // 1 - // ], - // "requires": "Ravager, Whipmaster or Goblin", - // "restrict": "Born Great orcs may not take this path.", - // "requires_expr": [ - // "+and", - // [ - // "ravager", - // "whipmaster", - // "goblin" - // ], - // [ - // "+not", - // [ - // "born great" - // ] - // ] - // ], - // "key_leads": [ - // "Chattel Setting" - // ] - // }, - // "Hatred Bearer": { - // "time": 1, - // "res": 15, - // "stat": [ - // [ - // 1, - // "p" - // ], - // [ - // 1, - // "m" - // ] - // ], - // "leads": [ - // "Chattel" - // ], - // "skills": [ - // [ - // 3, - // "Conspicuous", - // "Black Legion-wise" - // ] - // ], - // "traits": [ - // 1, - // "Psychotic", - // "Paranoid", - // "Booming Voice" - // ], - // "requires": "The Rites, Legioner or Whipmaster", - // "requires_expr": [ - // "the rites", - // "legioner", - // "whipmaster" - // ], - // "key_leads": [ - // "Chattel Setting" - // ] - // }, - // "Despair Shouter": { - // "time": 3, - // "res": 10, - // "stat": [ - // [ - // 1, - // "p" - // ] - // ], - // "leads": [ - // "Chattel" - // ], - // "skills": [ - // [ - // 3, - // "Brazen Horn Of Despair", - // "Intimidation", - // "Brawling" - // ] - // ], - // "traits": [ - // 2, - // "Reviled" - // ], - // "requires": "The Rites, Legioner or Whipmaster", - // "requires_expr": [ - // "the rites", - // "legioner", - // "whipmaster" - // ], - // "key_leads": [ - // "Chattel Setting" - // ] - // }, - // "Black Hunter": { - // "time": 5, - // "res": 5, - // "stat": [ - // [ - // 1, - // "p" - // ] - // ], - // "leads": [ - // "Chattel" - // ], - // "skills": [ - // [ - // 5, - // "Bow", - // "Hunting", - // "Field Dressing", - // "Stealthy" - // ] - // ], - // "traits": [ - // 1, - // "Black Bile Poison" - // ], - // "requires": "He Who is Fell and Stalks the Night requires Follower, Ravager or Nightseeker", - // "requires_expr": [ - // "follower", - // "ravager", - // "nightseeker" - // ], - // "key_leads": [ - // "Chattel Setting" - // ] - // }, - // "Astride The Beast": { - // "time": 5, - // "res": 6, - // "stat": [ - // [ - // 1, - // "p" - // ] - // ], - // "leads": [ - // "Chattel", - // "Great" - // ], - // "skills": [ - // [ - // 8, - // "Mounted Combat Training", - // "Riding", - // "Great Wolf Husbandry", - // "Intimidation", - // "Spear", - // "Armor Training" - // ] - // ], - // "traits": [ - // 1, - // "Brash", - // "Cry Of Doom" - // ], - // "requires": "He Who Sits Astride the Howling Black Beast requires Black Hunter or Follower", - // "requires_expr": [ - // "black hunter", - // "follower" - // ], - // "key_leads": [ - // "Chattel Setting", - // "Great And Black Setting" - // ] - // }, - // "Bears The Lash": { - // "time": 6, - // "res": 9, - // "stat": [ - // [ - // 1, - // "m" - // ] - // ], - // "leads": [ - // "Chattel", - // "Great" - // ], - // "skills": [ - // [ - // 6, - // "Whip-wise", - // "Intimidation", - // "Orcish Torture", - // "Command", - // "Sword", - // "Brawling" - // ] - // ], - // "traits": [ - // 1, - // "Where There's A Whip, There's A Way" - // ], - // "requires": "He Who Bears the Lash and Drives Us Ever On requires Whipmaster, Black Hunter, Astride the Beast or The Rites", - // "requires_expr": [ - // "whipmaster", - // "black hunter", - // "astride the beast", - // "the rites" - // ], - // "key_leads": [ - // "Chattel Setting", - // "Great And Black Setting" - // ] - // }, - // "Packmaster": { - // "time": 7, - // "res": 10, - // "stat": [ - // [ - // 1, - // "pm" - // ] - // ], - // "leads": [ - // "Chattel", - // "Great" - // ], - // "skills": [ - // [ - // 5, - // "Great Wolf Husbandry", - // "Great Wolf-wise", - // "Pack-wise", - // "Mending" - // ] - // ], - // "traits": [ - // 1, - // "Flea-bitten", - // "Where There's A Whip, There's A Way", - // "Show No Fear" - // ], - // "requires": "He Who Rules the Black Wolf Pack requires Bears the Lash, Follower, Whipmaster, Master of Eight or Knower of Secrets]", - // "requires_expr": [ - // "bears the lash", - // "follower", - // "whipmaster", - // "master of eight", - // "knower of secrets" - // ], - // "key_leads": [ - // "Chattel Setting", - // "Great And Black Setting" - // ] - // }, - // "Head Taker": { - // "time": 6, - // "res": 15, - // "stat": [ - // [ - // 1, - // "m" - // ], - // [ - // 1, - // "p" - // ] - // ], - // "leads": [ - // "Chattel", - // "Great" - // ], - // "skills": [ - // [ - // 5, - // "Command", - // "Brutal Intimidation", - // "Axe", - // "Brawling" - // ] - // ], - // "traits": [ - // 2, - // "Unrelenting Savagery", - // "Fondness For Elven Blood", - // "Taste For Man-flesh" - // ], - // "requires": "He Who Cleaves the Heads of his Enemies From Their Shoulders and Sets Them Upon Stakes for All to See requires Bears the Lash, Black Destroyer or Named", - // "requires_expr": [ - // "bears the lash", - // "black destroyer", - // "named" - // ], - // "key_leads": [ - // "Chattel Setting", - // "Great And Black Setting" - // ] - // }, - // "Troll Lord": { - // "time": 5, - // "res": 20, - // "stat": [ - // [ - // 1, - // "m" - // ], - // [ - // 1, - // "p" - // ] - // ], - // "leads": [ - // "Great", - // "Servant" - // ], - // "skills": [ - // [ - // 6, - // "Troll-wise", - // "Troll Etiquette", - // "Hammer", - // "Shield Training" - // ] - // ], - // "traits": [ - // 2, - // "Arrogant", - // "Troll Speak" - // ], - // "requires": "Bears the Lash, Pack Master or Named", - // "requires_expr": [ - // "bears the lash", - // "packmaster", - // "named" - // ], - // "key_leads": [ - // "Great And Black Setting", - // "Servant Of The Dark Blood Subsetting" - // ] - // } - // }, - // "Servant Of The Dark Blood Subsetting": { - // "Slave To The Dark": { - // "time": 6, - // "res": 3, - // "leads": [ - // "Chattel" - // ], - // "skills": [ - // [ - // 2, - // "Servant-wise" - // ] - // ], - // "traits": [ - // 2, - // "Fearful Respect Of The Servants", - // "Naked Hatred" - // ], - // "key_leads": [ - // "Chattel Setting" - // ] - // }, - // "Drinker Of The Dark": { - // "time": 5, - // "res": 6, - // "stat": [ - // [ - // 1, - // "m" - // ], - // [ - // 1, - // "p" - // ] - // ], - // "leads": [ - // "Chattel" - // ], - // "skills": [ - // [ - // 3, - // "Doctrine Of Night's Blood" - // ] - // ], - // "traits": [ - // 3, - // "Stark Madness", - // "Blasphemer", - // "Void Embrace" - // ], - // "requires": "Slave to the Dark", - // "requires_expr": [ - // "slave to the dark" - // ], - // "key_leads": [ - // "Chattel Setting" - // ] - // }, - // "Bloodletter": { - // "time": 5, - // "res": 6, - // "stat": [ - // [ - // 1, - // "m" - // ], - // [ - // 1, - // "p" - // ] - // ], - // "leads": [ - // "Chattel" - // ], - // "skills": [ - // [ - // 5, - // "Rituals Of Blood", - // "Orcish Torture", - // "Intimidation", - // "Knives" - // ] - // ], - // "traits": [ - // 1 - // ], - // "requires": "Drinker of the Dark", - // "requires_expr": [ - // "drinker of the dark" - // ], - // "key_leads": [ - // "Chattel Setting" - // ] - // }, - // "Knower Of Secrets": { - // "time": 6, - // "res": 7, - // "stat": [ - // [ - // 1, - // "pm" - // ] - // ], - // "leads": [ - // "Chattel", - // "Black Legion" - // ], - // "skills": [ - // [ - // 4, - // "Rituals Of Night", - // "Vile Poisoner", - // "Foraging" - // ] - // ], - // "traits": [ - // 1 - // ], - // "requires": "Drinker of the Dark", - // "requires_expr": [ - // "drinker of the dark" - // ], - // "key_leads": [ - // "Chattel Setting", - // "Black Legion Subsetting" - // ] - // }, - // "Master Of Eight": { - // "time": 8, - // "res": 8, - // "stat": [ - // [ - // 1, - // "pm" - // ] - // ], - // "leads": [ - // "Chattel", - // "Black Legion" - // ], - // "skills": [ - // [ - // 7, - // "Spider Husbandry", - // "Riding", - // "Mounted Combat Training", - // "Web-wise", - // "Climbing" - // ] - // ], - // "traits": [ - // 2, - // "Batshit", - // "Affinity For Spiders" - // ], - // "requires": "Knower of Secrets", - // "requires_expr": [ - // "knower of secrets" - // ], - // "key_leads": [ - // "Chattel Setting", - // "Black Legion Subsetting" - // ] - // }, - // "Master Of Blood": { - // "time": 7, - // "res": 8, - // "stat": [ - // [ - // 1, - // "pm" - // ] - // ], - // "skills": [ - // [ - // 4, - // "Rituals-wise", - // "Animal Husbandry", - // "Orc-wise", - // "Elf-wise", - // "Wolf-wise" - // ] - // ], - // "traits": [ - // 2, - // "Where There's A Whip, There's A Way" - // ], - // "requires": "Bloodletter", - // "requires_expr": [ - // "bloodletter" - // ] - // }, - // "Master Of Darkness": { - // "time": 7, - // "res": 8, - // "stat": [ - // [ - // 1, - // "pm" - // ] - // ], - // "skills": [ - // [ - // 3, - // "Cave-wise", - // "Tunnel-wise" - // ] - // ], - // "traits": [ - // 1 - // ], - // "requires": "Knower of Secrets", - // "requires_expr": [ - // "knower of secrets" - // ] - // }, - // "Dark Summoner": { - // "time": 10, - // "res": 12, - // "stat": [ - // [ - // 1, - // "pm" - // ] - // ], - // "skills": [ - // [ - // 3, - // "Darkness-wise" - // ], - // [ - // 1, - // "General" - // ] - // ], - // "traits": [ - // 1 - // ], - // "requires": "Master of Darkness", - // "requires_expr": [ - // "master of darkness" - // ] - // }, - // "Blood Summoner": { - // "time": 10, - // "res": 12, - // "stat": [ - // [ - // 1, - // "pm" - // ] - // ], - // "skills": [ - // [ - // 3, - // "Poison-wise", - // "Bat-wise", - // "Troll-wise" - // ], - // [ - // 1, - // "General" - // ] - // ], - // "traits": [ - // 1 - // ], - // "requires": "Master of Blood", - // "requires_expr": [ - // "master of blood" - // ] - // }, - // "Servant": { - // "time": 50, - // "res": 30, - // "stat": [ - // [ - // 1, - // "m" - // ] - // ], - // "skills": [ - // [ - // 2, - // "Great And Black-wise", - // "Name Ritual" - // ], - // [ - // 2, - // "General" - // ] - // ], - // "traits": [ - // 1 - // ], - // "requires": "The Born to Rule Them All trait and Dark Summoner or Blood Summoner", - // "requires_expr": [ - // "+and", - // [ - // "dark summoner", - // "blood summoner" - // ], - // [ - // "+trait", - // "born to rule them all" - // ] - // ] - // } - // } -}; - -var test_skills_data = { - "Alchemy": { - "roots": [ - "Perception" - ] - }, - "Bargaining": { - "roots": [ - "Will", - "Perception" - ] - }, - "Circination": { - "magic": 1, - "roots": [ - "Perception", - "Agility" - ] - }, - "Death Art": { - "magic": 1, - "roots": [ - "Will", - "Forte" - ] - }, - "Enchanting": { - "magic": 1, - "roots": [ - "Perception", - "Agility" - ] - }, - "Sorcery": { - "magic": 1, - "roots": [ - "Perception" - ] - }, - "Spirit Binding": { - "magic": 1, - "roots": [ - "Will" - ] - }, - "Summoning": { - "magic": 1, - "roots": [ - "Perception" - ] - } -} - -var test_traits_data = { - "Always in the Way": { - "cost": 1, - "type": "character" - }, - "Assistant Pig-Keeper": { - "cost": 1, - "type": "character" - }, - "Brook No Fools": { - "cost": 7, - "type": "die", - "desc": "The spirit binder's art is not something to be trifled with! Their secrets are well kept because meddling fools will only cause irreparable harm to themselves and the domains with which they tamper. A summoner with this trait receives a fate point every time they rebuff an offer of help from a potential student (so that character does not earn a test toward learning the skill). The summoner receives a persona point when they actively thwart another character from learning the secrets of Spirit Binding, Summoning, or Circination." - }, - "Bully": { - "cost": 1, - "type": "character" - }, - "Corrupted": { - "cost": 3, - "type": "die", - "desc": "This character has opened their body and soul to the dark powers. They must open the Corrupted emotional attribute. Increase their starting rank by one." - }, - "Council of Mages": { - "cost": 6, - "type": "die", - "desc": "The Council of Mages is a small, secretive, yet powerful entity. This trait grants a 1D reputation and a 1D affiliation with this organization. This combines with other appropriate reputations and affiliations." - }, - "Creepy": { - "cost": 1, - "type": "character" - }, - "Cult Leader": { - "cost": 8, - "type": "die", - "desc": "Cult Leaders are charismatic and eccentric. This trait grants a 1D reputation and 1D affiliation with the Death Cult. This combines with other appropriate reputations and affiliations." - }, - "Unhinged": { - "cost": 1, - "type": "character" - }, - "Disfigured": { - "cost": 3, - "type": "die", - "desc": "This character has led a life of hardship and pain. They've been cut up, broken, and beaten down. This trait grants +1D to shrug off or grit teeth for any injury." - }, - "Evil": { - "cost": 1, - "type": "character" - }, - "Faust": { - "cost": 3, - "type": "die", - "desc": "When bargaining with the higher powers for something pure and innocent like love, gain a bonus persona point for each agreement you strike on behalf of the one you seek to protect or affect." - }, - "Feared Above All": { - "cost": 5, - "type": "die", - "desc": "For good reason or not, this character is feared by all who know them. +1D to Intimidation. Choose a 1D infamous reputation." - }, - "Fiery": { - "cost": 1, - "type": "character" - }, - "Disgruntled": { - "cost": 1, - "type": "character" - }, - "Furtive": { - "cost": 1, - "type": "character" - }, - "Graduate": { - "cost": 3, - "type": "die", - "desc": "This trait grants a 1D affiliation with a College of Magic. This combines with other appropriate and applicable affiliations." - }, - "Harried": { - "cost": 1, - "type": "character" - }, - "Hazed": { - "cost": 2, - "type": "die", - "desc": "This character may take a free inimical relationship with another character who was their senior in the College of Magic." - }, - "Impressive Hat": { - "cost": 3, - "type": "die", - "desc": "This character's hat is mightily impressive. It can be seen for miles! It's so impressive that people often remember the hat more than the person. This gives a 1D Reputation among the people of a given locale as the wearer of the really impressive hat, so long as the hat is being worn, of course. Wearing the hat also gives a +2 Ob to any Disguise or Inconspicuous test." - }, - "Invocations of the Damned": { - "cost": 5, - "type": "call_on", - "desc": "The Dark Priest swears their soul to fell powers. Like other priests, they must have a Belief that ties to their Faith in order to maintain the emotional attribute. If the player writes a second Belief tied to their faith in the dark gods and their service to them, the priest may use this trait as a call-on for Faith when that Belief comes into question." - }, - "Late": { - "cost": 1, - "type": "character" - }, - "Low Born": { - "cost": 2, - "type": "die", - "desc": "Low Born characters are born of unremarkable parents. They cannot trace their lineage to any nobility or to any historic or notable figures. They have a 1D infamous reputation in noble or elite circles due to their obvious lack of heritage. It also adds a +1 Ob disadvantage to any Inconspicuous tests in noble or courtly settings." - }, - "Master of Mages": { - "cost": 0, - "type": "die", - "desc": "The Headmaster of a College of Magic attained their position by rigorous pursuit of excellence and expertise in sorcery and magic. This trait grants a 2D repuation among mages and the halls of power as a Master of Mages." - }, - "Outsider": { - "cost": 2, - "type": "die", - "desc": "Choose a 1D infamous reputation. And suffer -1 to your body of argument whenever you're trying to explain your nature, position, meaning, or special insight." - }, - "Never A Moment Of Peace": { - "cost": 3, - "type": "die", - "desc": "This trait grants the character a 5 rps relationship. This relationship must be with a character who is always bothering or interrupting him. If that character is forced out of his life, someone new will come along. This character just attracts these sort of people! You may invest additional resource points and increase the value of this relationship." - }, - "Polite": { - "cost": 1, - "type": "character" - }, - "Speaker Of The Secret Language": { - "cost": 1, - "type": "character" - }, - "Spirit Familiar": { - "cost": 5, - "type": "die", - "desc": "This character has a familiar whose spirit is linked to their own. They can see through the familiar's eyes using the familiar's Perception stat. However, when using their familiar's eyes, a character with this trait cannot look through their own though other senses may still be employed. It takes two actions of concentration to engage their familiar's eyes, and two more actions to return their sight to their own eyes. This trait does not grant Low Speech. However the creature does understand its companion's wishes and will go where its master directs it to go, look at what its master directs it to look at, etc. A character with this trait feels the pain of their familiar. If the familiar suffers a light or greater wound, the master suffers a light wound. If the familiar is ever killed, the master suffers a traumatic wound. In the game, the character is physically unharmed, but mentally traumatized. Recovery and Treatment are as per a standard traumatic wound. This wound does not bleed out. A familiar uses the following stats: Wi G2, Pe G3, Ag B4, Sp B5, Po B3, Fo B3, Hea B4, Ref B4, Ste B5, MW B9. Choose its form: cat, doc, snake, bird, pig, rabbit, fox or similar. No large predators or beasts of burden. The animal must show some mark or quality that indicates it is not entirely of this world. For example, it must be hairless, one eyed, two-tailed, of large size or even just have a disturbing aura." - }, - "Suicidal": { - "cost": 5, - "type": "die", - "desc": "This character (instantly) earns a persona point every time he takes a mortal wound." - }, - "Versatile": { - "cost": 4, - "type": "die", - "desc": "The Master Sorcerer places their confidence in the art of sorcery. It is a versatile and potent art, and they know it intimately. If using Art Magic, reduce by one the number of tests required for Weaving Magic into the Fiber of my Being. If using the standard Sorcery rules, reduce their practicals aptitude by one. If using Practical Magic, they may take an additional category of magic. In addition, the player earns a persona point for pushing their character's magic in a dangerous or untried direction." - }, - "Well Traveled": { - "cost": 4, - "type": "die", - "desc": "The Speaker of Names wanders the lands and seas, communing with the spirits. This trait allows the player to take a new domain when their character travels to a new locale in play. The player may describe a memory their character has of this place or a place like it. They may describe when they traveled here before. The player then adds a new domain to their spirit binder at its base level (0). Once used, this trait becomes a character trait. To be clear, the domain is added during play at a time of the player's choosing, not during character burning." - } -}; - -console.log(timelogger.log("post-data")); +// class TimeLogger { +// constructor() { +// this.logs = []; +// this.unlabelled_id = 0; +// this.start = this.previous = Date.now(); +// this.log('start'); +// } +// log(label) { +// var now = Date.now(); +// var log = { +// 'when': now, +// 'label': label, +// 'elapsed': now - this.previous, +// 'total': now - this.start +// }; +// this.logs.push(log); +// this.previous = now; +// return log; +// } +// } + +// const timelogger = new TimeLogger; +// console.log(timelogger.logs[0]); +// +// console.log(timelogger.log("post-data")); // Settings @@ -1849,8 +49,12 @@ StockedSetting.prototype.removeLifepath = function(index) { this.lifepaths.splice(index, 1); } StockedSetting.prototype.toCharred = function() { + // let name = this.name + (this.isSubsetting ? " Subsetting" : " Setting"; + let charred = {}; - // "setting" in name + for(let lp of this.lifepaths) { + charred[lp.name] = lp.toCharred(); + } // common traits // stride return charred; @@ -1878,6 +82,18 @@ function StockedLifePath(name, charredPathData) { } this.leads = () => Object.keys(this.leads_dict).filter(l => this.leads_dict[l]); } +StockedLifePath.prototype.toCharred = function() { + let charred = {}; + charred.time = this.time; + charred.res = this.res; + charred.requires = this.requires; + charred.restrict = this.restrict; + charred.stat = this.stat.toCharred(); + charred.skills = this.skills.toCharred(); + charred.traits = this.traits.toCharred(); + charred.leads = this.leads(); + return charred; +} function StockedLifePathStats(charredStatData) { this.P = 0; @@ -1904,6 +120,13 @@ StockedLifePathStats.prototype.toString = function() { if (this.PM) { strs.push("+" + this.PM + "P/M"); } return strs.join(","); }; +StockedLifePathStats.prototype.toCharred = function() { + let charred = []; + if(this.P > 0) charred.push([this.P, "p"]); + if(this.M > 0) charred.push([this.M, "m"]); + if(this.PM > 0) charred.push([this.PM, "pm"]); + return charred; +} function StockedLifePathSkills(charredLpSkillData) { this.lpPoints = 0; @@ -1911,11 +134,16 @@ function StockedLifePathSkills(charredLpSkillData) { this.lpSkills = []; if (charredLpSkillData) { for (let skill of charredLpSkillData) { - if(skill[1].toLowerCase() == "general") { - this.generalPoints += skill[0]; - } else { - this.lpPoints += skill[0]; - this.lpSkills = this.lpSkills.concat(skill.slice(1)); + if(skill.length == 1) { + this.lpPoints = skill[0]; + } + if(skill.length >= 2) { + if(skill[1].toLowerCase() == "general") { + this.generalPoints += skill[0]; + } else { + this.lpPoints += skill[0]; + this.lpSkills = this.lpSkills.concat(skill.slice(1)); + } } } } @@ -1932,6 +160,15 @@ StockedLifePathSkills.prototype.toString = function() { if (this.generalPoints) { strs.push(StockedUtil.pts(this.generalPoints, ["General"])); } return strs.join("; "); }; +StockedLifePathSkills.prototype.toCharred = function() { + let charred = []; + if(this.lpSkills.length > 0 || this.lpPoints > 0){ + charred.push([this.lpPoints].concat(this.lpSkills)); + } + if(this.generalPoints > 0) + charred.push([this.generalPoints, "General"]); + return charred; +} function StockedLifePathTraits(charredTraitData) { this.lpTraits = []; @@ -1949,6 +186,9 @@ StockedLifePathTraits.prototype.addTrait = function(skill) { StockedLifePathTraits.prototype.toString = function() { return StockedUtil.pts(this.points, this.lpTraits); } +StockedLifePathTraits.prototype.toCharred = function() { + return [this.points].concat(this.lpTraits); +} // Skills @@ -1985,66 +225,84 @@ function StockedTrait(name, charredTraitData) { //Ctrl -function StockedCtrl($scope, burningData) { +var testscope; + +function StockedCtrl($scope, $http, burningData) { $scope.to_id = function(input) { return input.replaceAll(/\W/g, '_'); }; $scope.StockedUtil = StockedUtil; $scope.TRAIT_TYPES = ["character", "die", "call_on"]; + $scope.settings = []; + /* testing */ + testscope = $scope; $scope.general = { - 'Name': '', + 'Name': 'Foo', 'Stride': 7, 'CommonTraits': [], 'selectedTrait': '' }; - $scope.parseStock = function (stockData){ - let settings = []; - for (let name in stockData) { - settings.push(new StockedSetting(name, stockData[name])); - } - return settings; - }; - - $scope.parseSkills = function (skillsData){ - let skills = []; - for (let name in skillsData) { - skills.push(new StockedSkill(name, skillsData[name])); - } - return skills; - }; - - $scope.parseTraits = function (traitsData){ - let traits = []; - for (let name in traitsData) { - traits.push(new StockedTrait(name, traitsData[name])); - } - return traits; - }; + // $scope.parseStock = function (stockData){ + // let settings = []; + // for (let name in stockData) { + // settings.push(new StockedSetting(name, stockData[name])); + // } + // return settings; + // }; + + // $scope.parseSkills = function (skillsData){ + // let skills = []; + // for (let name in skillsData) { + // skills.push(new StockedSkill(name, skillsData[name])); + // } + // return skills; + // }; + + // $scope.parseTraits = function (traitsData){ + // let traits = []; + // for (let name in traitsData) { + // traits.push(new StockedTrait(name, traitsData[name])); + // } + // return traits; + // }; /* end testing */ + /* Input/Output */ + /* end Input/Output */ + $scope.addSetting = function (){ this.settings.push(new StockedSetting(this.newSettingName, {})); this.newSettingName = ""; - } + }; $scope.removeSetting = function (index) { this.settings.splice(index, 1); - } + }; $scope.addSkill = function (){ this.skills.push(new StockedSkill("New", {})); - } + }; + $scope.removeSkill = function (index) { + this.skills.splice(index, 1); + }; + + $scope.addTrait = function (){ + this.traits.push(new StockedTrait("New", {})); + }; + $scope.removeTrait = function (index) { + this.traits.splice(index, 1); + }; $scope.collapseBody = function(data_target, $event) { $(data_target).collapse("toggle"); if($event) { $event.stopPropagation(); } - } + }; $scope.editField = function($event, edit) { $($event.target).toggleClass("not-editing"); - } + }; burningData.registerOnAllDatasetsLoaded(function() { onLifepathsLoad_Stocked($scope, burningData); }); @@ -2053,18 +311,57 @@ function StockedCtrl($scope, burningData) { let container = $($event.target).closest('.path-leads'); container.find(".path-leads-read").toggle(false); container.find(".path-leads-write").toggle(true); - } + }; $scope.readLeads = function($event) { let container = $($event.target).closest('.path-leads'); container.find(".path-leads-read").toggle(true); container.find(".path-leads-write").toggle(false); + }; + + $scope.stocked_loadCharredModel = function() { + file = document.getElementById("stocked_charred_file"); + file.files[0].text().then((text) => loadCharredModel(this, JSON.parse(text))); + }; + $scope.stocked_downLoadCharredModel = function() { + model = serializeToCharredModel(this); + $http.post("/stocked_download", model). + success(function(data,status,headers,config){ + console.log("huzzah, converting stocked model to charred succeeded. File URL: " + data); + var frame = document.getElementById("downloadframe"); + if ( frame ){ + frame.src = data; + } + }). + error(function(data,status,headers,config){ + console.log("boo, converting stocked model to charred failed. File URL: " + data); + $scope.addAlert('tools', "converting stocked model to charred failed: " + data); + }); } } +// Accepts an object, JSON text should be parsed first +function loadCharredModel($scope, model) { + let settings = []; + for (let name in model) { + settings.push(new StockedSetting(name, model[name])); + } + $scope.settings = settings; + $scope.$apply(); +} + +function serializeToCharredModel($scope) { + let model = {}; + model.settings = {}; + model.Name = $scope.general.Name; + $scope.settings.forEach((s) => + model.settings[s.name + (s.isSubsetting ? " Subsetting" : " Setting")] = s.toCharred()) + return JSON.stringify(model); +} + function onLifepathsLoad_Stocked($scope, burningData) { - $scope.settings = $scope.parseStock(test_data); - $scope.skills = $scope.parseSkills(test_skills_data); - $scope.traits = $scope.parseTraits(test_traits_data); +// $scope.settings = $scope.parseStock(test_data); +// $scope.skills = $scope.parseSkills(test_skills_data); +// $scope.traits = $scope.parseTraits(test_traits_data); $scope.charredTraits = Object.keys(burningData.traits); $scope.charredSkills = Object.keys(burningData.skills); } @@ -2086,5 +383,6 @@ var StockedUtil = { if(Array.isArray(entries) && entries.length > 0) { str += entries.join(", "); } else { str += "—" } return str; - } + }//, "filter$properties": (key, value) => (key.startsWith('$') ? undefined : value) + }; diff --git a/src/public/js/stocked/test/data-archive.js b/src/public/js/stocked/test/data-archive.js new file mode 100644 index 0000000..918afef --- /dev/null +++ b/src/public/js/stocked/test/data-archive.js @@ -0,0 +1,1796 @@ +var test_data = { + "Chattel Setting": { + "Born Chattel": { + "time": 10, + "res": 5, + "stat": [ + [ + 1, + "p" + ] + ], + "leads": [ + "Black Legion", + "Servant" + ], + "skills": [ + [ + 2, + "General" + ] + ], + "traits": [ + 1 + ], + "common_traits": [ + "Cannibal", + "Cold Black Blood", + "Breeder", + "Fanged And Clawed", + "Loathsome And Twisted", + "Lynx-eyed, Like Burning Coals", + "Vile Language" + ], + "key_leads": [ + "Black Legion Subsetting", + "Servant Of The Dark Blood Subsetting" + ] + }, + "Cattle Slave": { + "time": 5, + "res": 3, + "stat": [ + [ + 1, + "p" + ] + ], + "skills": [ + [ + 2, + "Animal Husbandry" + ] + ], + "traits": [ + 2, + "Tasting The Lash", + "Screaming", + "Shouting", + "Kicking The Beast" + ] + }, + "Scavenger": { + "time": 3, + "res": 6, + "stat": [ + [ + 1, + "p" + ] + ], + "leads": [ + "Black Legion" + ], + "skills": [ + [ + 3, + "Foraging", + "Inconspicuous" + ] + ], + "traits": [ + 2, + "Tasting The Lash", + "Running (Away)", + "Hiding", + "Stealing", + "Scavenger" + ], + "key_leads": [ + "Black Legion Subsetting" + ] + }, + "Forge Slave": { + "time": 5, + "res": 3, + "stat": [ + [ + 1, + "p" + ] + ], + "skills": [ + [ + 2, + "Ditch Digging" + ] + ], + "traits": [ + 2, + "Tasting The Lash", + "Pain Life", + "Back-breaking Labor", + "Numb" + ] + }, + "Hauler": { + "time": 5, + "res": 3, + "stat": [ + [ + 1, + "p" + ] + ], + "skills": [ + [ + 2, + "Driving", + "Beast Of Burden-wise" + ] + ], + "traits": [ + 2, + "Tasting The Lash", + "Back-breaking Labor", + "Cursing", + "Spitting", + "Yowling" + ] + }, + "Cutter Slave": { + "time": 5, + "res": 3, + "stat": [ + [ + 1, + "p" + ] + ], + "skills": [ + [ + 2, + "Tree Pulling", + "Ditch Digging" + ] + ], + "traits": [ + 2, + "Tasting The Lash", + "Hatred Of Forests", + "Back-breaking Labor" + ] + }, + "Tunneler": { + "time": 4, + "res": 3, + "stat": [ + [ + 1, + "p" + ] + ], + "skills": [ + [ + 2, + "Ditch Digging", + "Tunnel-wise" + ] + ], + "traits": [ + 2, + "Tasting The Lash", + "Back-breaking Labor", + "Black Lung" + ] + }, + "Ravager": { + "time": 3, + "res": 8, + "stat": [ + [ + 1, + "p" + ] + ], + "leads": [ + "Black Legion" + ], + "skills": [ + [ + 4, + "Brawling", + "Cudgel", + "Intimidation" + ] + ], + "traits": [ + 2, + "Pack Hunter" + ], + "key_leads": [ + "Black Legion Subsetting" + ] + }, + "Woodcutter": { + "time": 7, + "res": 9, + "stat": [ + [ + 1, + "m" + ] + ], + "skills": [ + [ + 4, + "Rude Carpentry", + "Mending", + "Intimidation" + ] + ], + "traits": [ + 1 + ], + "requires": "Cutter Slave", + "requires_expr": [ + "cutter slave" + ] + }, + "Butcher": { + "time": 7, + "res": 9, + "stat": [ + [ + 1, + "m" + ] + ], + "skills": [ + [ + 4, + "Butchery", + "Tanner", + "Intimidation" + ] + ], + "traits": [ + 1 + ], + "requires": "Cattle Slave", + "requires_expr": [ + "cattle slave" + ] + }, + "Forger": { + "time": 7, + "res": 9, + "stat": [ + [ + 1, + "m" + ] + ], + "skills": [ + [ + 5, + "Blacksmith", + "Intimidation" + ] + ], + "traits": [ + 2, + "Singed" + ], + "requires": "Forge Slave", + "requires_expr": [ + "forge slave" + ] + }, + "Pitwright": { + "time": 8, + "res": 10, + "stat": [ + [ + 1, + "m" + ] + ], + "skills": [ + [ + 4, + "Mining", + "Intimidation" + ] + ], + "traits": [ + 1, + "Deep Sense" + ], + "requires": "Tunneler", + "requires_expr": [ + "tunneler" + ] + }, + "Edge Grinder": { + "time": 10, + "res": 15, + "stat": [ + [ + 1, + "pm" + ] + ], + "leads": [ + "Black Legion" + ], + "skills": [ + [ + 6, + "Mending", + "Weaponsmith", + "Armorer", + "Tanner" + ] + ], + "traits": [ + 2, + "Suspicious" + ], + "requires": "He Who Grinds the Edges of our Axes to Glinting Sharpness requires Forger", + "requires_expr": [ + "forger" + ], + "key_leads": [ + "Black Legion Subsetting" + ] + }, + "Whipmaster": { + "time": 9, + "res": 15, + "stat": [ + [ + 1, + "m" + ] + ], + "leads": [ + "Black Legion" + ], + "skills": [ + [ + 4, + "Interrogation", + "Intimidation", + "Brawling", + "Orcish Torture" + ] + ], + "traits": [ + 1, + "Where There's A Whip, There's A Way" + ], + "requires": "Pitwright, Forger, four Slave life paths, or any Great and Black, or Legion lifepath", + "requires_expr": [ + "+or", + [ + "pitwright", + "forger" + ], + [ + "+has_n_lifepaths_in", + 4, + "cattle slave", + "forge slave", + "cutter slave" + ], + [ + "great and black setting:born great", + "great and black setting:the rites", + "great and black setting:servant of the gate", + "great and black setting:follower", + "great and black setting:black destroyer", + "great and black setting:named", + "great and black setting:siege master", + "great and black setting:gate forger", + "great and black setting:whisperer", + "great and black setting:great one", + "black legion subsetting:goblin", + "black legion subsetting:sun blotter", + "black legion subsetting:nightseeker", + "black legion subsetting:legioner", + "black legion subsetting:hatred bearer", + "black legion subsetting:despair shouter", + "black legion subsetting:black hunter", + "black legion subsetting:astride the beast", + "black legion subsetting:bears the lash", + "black legion subsetting:packmaster", + "black legion subsetting:head taker", + "black legion subsetting:troll lord" + ] + ], + "key_leads": [ + "Black Legion Subsetting" + ] + } + }, + "Great And Black Setting": { + "Born Great": { + "time": 10, + "res": 5, + "leads": [ + "Servant" + ], + "skills": [ + [ + 3, + "General" + ] + ], + "traits": [ + 2, + "Born To Rule Them All", + "Enemy Of The Sun" + ], + "common_traits": [ + "Cannibal", + "Cold Black Blood", + "Breeder", + "Fanged And Clawed", + "Loathsome And Twisted", + "Lynx-eyed, Like Burning Coals", + "Vile Language" + ], + "key_leads": [ + "Servant Of The Dark Blood Subsetting" + ] + }, + "The Rites": { + "time": 3, + "res": 3, + "stat": [ + [ + 1, + "m" + ], + [ + 1, + "p" + ] + ], + "leads": [ + "Black Legion", + "Servant" + ], + "skills": [ + [ + 5, + "Brawling", + "Intimidation", + "Orcish Torture" + ] + ], + "traits": [ + 2, + "Life Is Death", + "Sprinter" + ], + "restrict": "The Rites may only be taken once and it must be the character's second lifepath.", + "requires_expr": [ + "+and", + [ + "+has_n_lifepaths_or_more", + 1 + ], + [ + "+has_n_lifepaths_or_less", + 1 + ] + ], + "key_leads": [ + "Black Legion Subsetting", + "Servant Of The Dark Blood Subsetting" + ] + }, + "Servant Of The Gate": { + "time": 4, + "res": 7, + "stat": [ + [ + 1, + "p" + ] + ], + "leads": [ + "Black Legion", + "Chattel" + ], + "skills": [ + [ + 2, + "Soothing Platitudes", + "Ditch Digging" + ] + ], + "traits": [ + 1, + "Humble Before My Master", + "Hauling", + "Back-breaking Labor" + ], + "key_leads": [ + "Black Legion Subsetting", + "Chattel Setting" + ] + }, + "Follower": { + "time": 5, + "res": 9, + "stat": [ + [ + 1, + "m" + ], + [ + 1, + "p" + ] + ], + "leads": [ + "Black Legion", + "Chattel" + ], + "skills": [ + [ + 8, + "Armor Training", + "Axe", + "Bow", + "Knives", + "Mace", + "Riding", + "Shield Training", + "Clan-wise" + ] + ], + "traits": [ + 1, + "Silent Hatred" + ], + "requires": "He Who Walks in the Named's Shadow requires The Rites or Astride the Beast", + "requires_expr": [ + "the rites", + "astride the beast" + ], + "key_leads": [ + "Black Legion Subsetting", + "Chattel Setting" + ] + }, + "Black Destroyer": { + "time": 6, + "res": 12, + "stat": [ + [ + 1, + "m" + ], + [ + 1, + "p" + ] + ], + "leads": [ + "Chattel" + ], + "skills": [ + [ + 7, + "Mounted Combat Training", + "Great Wolf Husbandry", + "Riding", + "Axe", + "Spear" + ] + ], + "traits": [ + 2, + "Intense Hatred", + "Low Cunning" + ], + "requires": "He Whose Skin is like Winter Night, Whose Mere Presence Causes Those Beneath Him to Shiver in Terror and Cower Beneath his Wicked Blade requires Follower, Astride the Beast or Head Taker", + "requires_expr": [ + "follower", + "astride the beast", + "head taker" + ], + "key_leads": [ + "Chattel Setting" + ] + }, + "Named": { + "time": 8, + "res": 25, + "stat": [ + [ + 1, + "m" + ], + [ + 1, + "p" + ] + ], + "leads": [ + "Chattel" + ], + "skills": [ + [ + 5, + "Command", + "Brutal Intimidation", + "Orcish Torture" + ] + ], + "traits": [ + 2, + "Savage Consequences" + ], + "requires": "He Who is Mighty and Earned the Ancient Right to be Named requires Black Destroyer, Troll Lord or Head Taker", + "requires_expr": [ + "black destroyer", + "troll lord", + "head taker" + ], + "key_leads": [ + "Chattel Setting" + ] + }, + "Siege Master": { + "time": 10, + "res": 30, + "stat": [ + [ + 1, + "m" + ] + ], + "leads": [ + "Chattel" + ], + "skills": [ + [ + 5, + "Siege Engineer", + "Artillerist", + "Mending" + ] + ], + "traits": [ + 1, + "The Bigger They Come...", + "Brutish Efficiency" + ], + "requires": "Servant of the Gate", + "requires_expr": [ + "servant of the gate" + ], + "key_leads": [ + "Chattel Setting" + ] + }, + "Gate Forger": { + "time": 10, + "res": 30, + "stat": [ + [ + 1, + "m" + ] + ], + "leads": [ + "Chattel" + ], + "skills": [ + [ + 5, + "Mason", + "Bastions Of Hatred", + "Mining" + ] + ], + "traits": [ + 1, + "Rare Talent" + ], + "requires": "Siege Master", + "requires_expr": [ + "siege master" + ], + "key_leads": [ + "Chattel Setting" + ] + }, + "Whisperer": { + "time": 9, + "res": 40, + "stat": [ + [ + 1, + "m" + ] + ], + "leads": [ + "Servant" + ], + "skills": [ + [ + 5, + "Poisonous Platitudes", + "Falsehood", + "Persuasion", + "Clan-wise", + "Ambition-wise" + ] + ], + "traits": [ + 2, + "Forked Tongue", + "Poisonous Ambition" + ], + "requires": "Slave to the Dark, Whipmaster, Gate Forger or Bears the Lash", + "requires_expr": [ + "slave to the dark", + "whipmaster", + "gate forger", + "bears the lash" + ], + "key_leads": [ + "Servant Of The Dark Blood Subsetting" + ] + }, + "Great One": { + "time": 20, + "res": 60, + "stat": [ + [ + 2, + "m" + ], + [ + 2, + "p" + ] + ], + "leads": [ + "Black Legion" + ], + "skills": [ + [ + 5, + "Command", + "Strategy", + "Name Ritual" + ], + [ + 1, + "General" + ] + ], + "traits": [ + 2, + "Flights Of Murderous Fancy", + "Unrelenting Hatred" + ], + "requires": "Named and the Born to Rule Them All trait", + "requires_expr": [ + "+and", + [ + "named" + ], + [ + "+trait", + "born to rule them all" + ] + ], + "key_leads": [ + "Black Legion Subsetting" + ] + } + }, + "Black Legion Subsetting": { + "Goblin": { + "time": 3, + "res": 2, + "stat": [ + [ + 1, + "p" + ] + ], + "leads": [ + "Chattel" + ], + "skills": [ + [ + 2, + "Foraging", + "Brawling" + ] + ], + "traits": [ + 2, + "Tasting The Lash", + "Exhausted", + "Running (Away)", + "Charging Blindly", + "Marching" + ], + "restrict": "Born Great orcs may not take this path.", + "requires_expr": [ + "+not", + [ + "born great" + ] + ], + "key_leads": [ + "Chattel Setting" + ] + }, + "Sun Blotter": { + "time": 3, + "res": 3, + "stat": [ + [ + 1, + "p" + ] + ], + "leads": [ + "Chattel" + ], + "skills": [ + [ + 2, + "Bow", + "Mending", + "Fletcher" + ] + ], + "traits": [ + 1, + "Hiding", + "Running (Away)" + ], + "restrict": "Born Great orcs may not take this path.", + "requires_expr": [ + "+not", + [ + "born great" + ] + ], + "key_leads": [ + "Chattel Setting" + ] + }, + "Nightseeker": { + "time": 4, + "res": 4, + "stat": [ + [ + 1, + "p" + ], + [ + 1, + "m" + ] + ], + "leads": [ + "Chattel" + ], + "skills": [ + [ + 5, + "Orienteering", + "Tracking", + "Trapper", + "Stealthy", + "Climbing", + "Garrote" + ] + ], + "traits": [ + 1, + "Tasting The Lash" + ], + "requires": "He Who Lurks in the Twilight and Seeks Our Enemies requires Legioner, Sun Blotter, Scavenger or Ravager", + "restrict": "Born Great orcs may not take this path.", + "requires_expr": [ + "+and", + [ + "legioner", + "sun blotter", + "scavenger", + "ravager" + ], + [ + "+not", + [ + "born great" + ] + ] + ], + "key_leads": [ + "Chattel Setting" + ] + }, + "Legioner": { + "time": 4, + "res": 5, + "stat": [ + [ + 1, + "p" + ] + ], + "leads": [ + "Chattel" + ], + "skills": [ + [ + 4, + "Spear", + "Shield Training", + "Brawling", + "Foraging" + ] + ], + "traits": [ + 1 + ], + "requires": "Ravager, Whipmaster or Goblin", + "restrict": "Born Great orcs may not take this path.", + "requires_expr": [ + "+and", + [ + "ravager", + "whipmaster", + "goblin" + ], + [ + "+not", + [ + "born great" + ] + ] + ], + "key_leads": [ + "Chattel Setting" + ] + }, + "Hatred Bearer": { + "time": 1, + "res": 15, + "stat": [ + [ + 1, + "p" + ], + [ + 1, + "m" + ] + ], + "leads": [ + "Chattel" + ], + "skills": [ + [ + 3, + "Conspicuous", + "Black Legion-wise" + ] + ], + "traits": [ + 1, + "Psychotic", + "Paranoid", + "Booming Voice" + ], + "requires": "The Rites, Legioner or Whipmaster", + "requires_expr": [ + "the rites", + "legioner", + "whipmaster" + ], + "key_leads": [ + "Chattel Setting" + ] + }, + "Despair Shouter": { + "time": 3, + "res": 10, + "stat": [ + [ + 1, + "p" + ] + ], + "leads": [ + "Chattel" + ], + "skills": [ + [ + 3, + "Brazen Horn Of Despair", + "Intimidation", + "Brawling" + ] + ], + "traits": [ + 2, + "Reviled" + ], + "requires": "The Rites, Legioner or Whipmaster", + "requires_expr": [ + "the rites", + "legioner", + "whipmaster" + ], + "key_leads": [ + "Chattel Setting" + ] + }, + "Black Hunter": { + "time": 5, + "res": 5, + "stat": [ + [ + 1, + "p" + ] + ], + "leads": [ + "Chattel" + ], + "skills": [ + [ + 5, + "Bow", + "Hunting", + "Field Dressing", + "Stealthy" + ] + ], + "traits": [ + 1, + "Black Bile Poison" + ], + "requires": "He Who is Fell and Stalks the Night requires Follower, Ravager or Nightseeker", + "requires_expr": [ + "follower", + "ravager", + "nightseeker" + ], + "key_leads": [ + "Chattel Setting" + ] + }, + "Astride The Beast": { + "time": 5, + "res": 6, + "stat": [ + [ + 1, + "p" + ] + ], + "leads": [ + "Chattel", + "Great" + ], + "skills": [ + [ + 8, + "Mounted Combat Training", + "Riding", + "Great Wolf Husbandry", + "Intimidation", + "Spear", + "Armor Training" + ] + ], + "traits": [ + 1, + "Brash", + "Cry Of Doom" + ], + "requires": "He Who Sits Astride the Howling Black Beast requires Black Hunter or Follower", + "requires_expr": [ + "black hunter", + "follower" + ], + "key_leads": [ + "Chattel Setting", + "Great And Black Setting" + ] + }, + "Bears The Lash": { + "time": 6, + "res": 9, + "stat": [ + [ + 1, + "m" + ] + ], + "leads": [ + "Chattel", + "Great" + ], + "skills": [ + [ + 6, + "Whip-wise", + "Intimidation", + "Orcish Torture", + "Command", + "Sword", + "Brawling" + ] + ], + "traits": [ + 1, + "Where There's A Whip, There's A Way" + ], + "requires": "He Who Bears the Lash and Drives Us Ever On requires Whipmaster, Black Hunter, Astride the Beast or The Rites", + "requires_expr": [ + "whipmaster", + "black hunter", + "astride the beast", + "the rites" + ], + "key_leads": [ + "Chattel Setting", + "Great And Black Setting" + ] + }, + "Packmaster": { + "time": 7, + "res": 10, + "stat": [ + [ + 1, + "pm" + ] + ], + "leads": [ + "Chattel", + "Great" + ], + "skills": [ + [ + 5, + "Great Wolf Husbandry", + "Great Wolf-wise", + "Pack-wise", + "Mending" + ] + ], + "traits": [ + 1, + "Flea-bitten", + "Where There's A Whip, There's A Way", + "Show No Fear" + ], + "requires": "He Who Rules the Black Wolf Pack requires Bears the Lash, Follower, Whipmaster, Master of Eight or Knower of Secrets]", + "requires_expr": [ + "bears the lash", + "follower", + "whipmaster", + "master of eight", + "knower of secrets" + ], + "key_leads": [ + "Chattel Setting", + "Great And Black Setting" + ] + }, + "Head Taker": { + "time": 6, + "res": 15, + "stat": [ + [ + 1, + "m" + ], + [ + 1, + "p" + ] + ], + "leads": [ + "Chattel", + "Great" + ], + "skills": [ + [ + 5, + "Command", + "Brutal Intimidation", + "Axe", + "Brawling" + ] + ], + "traits": [ + 2, + "Unrelenting Savagery", + "Fondness For Elven Blood", + "Taste For Man-flesh" + ], + "requires": "He Who Cleaves the Heads of his Enemies From Their Shoulders and Sets Them Upon Stakes for All to See requires Bears the Lash, Black Destroyer or Named", + "requires_expr": [ + "bears the lash", + "black destroyer", + "named" + ], + "key_leads": [ + "Chattel Setting", + "Great And Black Setting" + ] + }, + "Troll Lord": { + "time": 5, + "res": 20, + "stat": [ + [ + 1, + "m" + ], + [ + 1, + "p" + ] + ], + "leads": [ + "Great", + "Servant" + ], + "skills": [ + [ + 6, + "Troll-wise", + "Troll Etiquette", + "Hammer", + "Shield Training" + ] + ], + "traits": [ + 2, + "Arrogant", + "Troll Speak" + ], + "requires": "Bears the Lash, Pack Master or Named", + "requires_expr": [ + "bears the lash", + "packmaster", + "named" + ], + "key_leads": [ + "Great And Black Setting", + "Servant Of The Dark Blood Subsetting" + ] + } + }, + "Servant Of The Dark Blood Subsetting": { + "Slave To The Dark": { + "time": 6, + "res": 3, + "leads": [ + "Chattel" + ], + "skills": [ + [ + 2, + "Servant-wise" + ] + ], + "traits": [ + 2, + "Fearful Respect Of The Servants", + "Naked Hatred" + ], + "key_leads": [ + "Chattel Setting" + ] + }, + "Drinker Of The Dark": { + "time": 5, + "res": 6, + "stat": [ + [ + 1, + "m" + ], + [ + 1, + "p" + ] + ], + "leads": [ + "Chattel" + ], + "skills": [ + [ + 3, + "Doctrine Of Night's Blood" + ] + ], + "traits": [ + 3, + "Stark Madness", + "Blasphemer", + "Void Embrace" + ], + "requires": "Slave to the Dark", + "requires_expr": [ + "slave to the dark" + ], + "key_leads": [ + "Chattel Setting" + ] + }, + "Bloodletter": { + "time": 5, + "res": 6, + "stat": [ + [ + 1, + "m" + ], + [ + 1, + "p" + ] + ], + "leads": [ + "Chattel" + ], + "skills": [ + [ + 5, + "Rituals Of Blood", + "Orcish Torture", + "Intimidation", + "Knives" + ] + ], + "traits": [ + 1 + ], + "requires": "Drinker of the Dark", + "requires_expr": [ + "drinker of the dark" + ], + "key_leads": [ + "Chattel Setting" + ] + }, + "Knower Of Secrets": { + "time": 6, + "res": 7, + "stat": [ + [ + 1, + "pm" + ] + ], + "leads": [ + "Chattel", + "Black Legion" + ], + "skills": [ + [ + 4, + "Rituals Of Night", + "Vile Poisoner", + "Foraging" + ] + ], + "traits": [ + 1 + ], + "requires": "Drinker of the Dark", + "requires_expr": [ + "drinker of the dark" + ], + "key_leads": [ + "Chattel Setting", + "Black Legion Subsetting" + ] + }, + "Master Of Eight": { + "time": 8, + "res": 8, + "stat": [ + [ + 1, + "pm" + ] + ], + "leads": [ + "Chattel", + "Black Legion" + ], + "skills": [ + [ + 7, + "Spider Husbandry", + "Riding", + "Mounted Combat Training", + "Web-wise", + "Climbing" + ] + ], + "traits": [ + 2, + "Batshit", + "Affinity For Spiders" + ], + "requires": "Knower of Secrets", + "requires_expr": [ + "knower of secrets" + ], + "key_leads": [ + "Chattel Setting", + "Black Legion Subsetting" + ] + }, + "Master Of Blood": { + "time": 7, + "res": 8, + "stat": [ + [ + 1, + "pm" + ] + ], + "skills": [ + [ + 4, + "Rituals-wise", + "Animal Husbandry", + "Orc-wise", + "Elf-wise", + "Wolf-wise" + ] + ], + "traits": [ + 2, + "Where There's A Whip, There's A Way" + ], + "requires": "Bloodletter", + "requires_expr": [ + "bloodletter" + ] + }, + "Master Of Darkness": { + "time": 7, + "res": 8, + "stat": [ + [ + 1, + "pm" + ] + ], + "skills": [ + [ + 3, + "Cave-wise", + "Tunnel-wise" + ] + ], + "traits": [ + 1 + ], + "requires": "Knower of Secrets", + "requires_expr": [ + "knower of secrets" + ] + }, + "Dark Summoner": { + "time": 10, + "res": 12, + "stat": [ + [ + 1, + "pm" + ] + ], + "skills": [ + [ + 3, + "Darkness-wise" + ], + [ + 1, + "General" + ] + ], + "traits": [ + 1 + ], + "requires": "Master of Darkness", + "requires_expr": [ + "master of darkness" + ] + }, + "Blood Summoner": { + "time": 10, + "res": 12, + "stat": [ + [ + 1, + "pm" + ] + ], + "skills": [ + [ + 3, + "Poison-wise", + "Bat-wise", + "Troll-wise" + ], + [ + 1, + "General" + ] + ], + "traits": [ + 1 + ], + "requires": "Master of Blood", + "requires_expr": [ + "master of blood" + ] + }, + "Servant": { + "time": 50, + "res": 30, + "stat": [ + [ + 1, + "m" + ] + ], + "skills": [ + [ + 2, + "Great And Black-wise", + "Name Ritual" + ], + [ + 2, + "General" + ] + ], + "traits": [ + 1 + ], + "requires": "The Born to Rule Them All trait and Dark Summoner or Blood Summoner", + "requires_expr": [ + "+and", + [ + "dark summoner", + "blood summoner" + ], + [ + "+trait", + "born to rule them all" + ] + ] + } + } +}; +var test_skills_data = { + "Alchemy": { + "roots": [ + "Perception" + ] + }, + "Bargaining": { + "roots": [ + "Will", + "Perception" + ] + }, + "Circination": { + "magic": 1, + "roots": [ + "Perception", + "Agility" + ] + }, + "Death Art": { + "magic": 1, + "roots": [ + "Will", + "Forte" + ] + }, + "Enchanting": { + "magic": 1, + "roots": [ + "Perception", + "Agility" + ] + }, + "Sorcery": { + "magic": 1, + "roots": [ + "Perception" + ] + }, + "Spirit Binding": { + "magic": 1, + "roots": [ + "Will" + ] + }, + "Summoning": { + "magic": 1, + "roots": [ + "Perception" + ] + } +}; +var test_traits_data = { + "Always in the Way": { + "cost": 1, + "type": "character" + }, + "Assistant Pig-Keeper": { + "cost": 1, + "type": "character" + }, + "Brook No Fools": { + "cost": 7, + "type": "die", + "desc": "The spirit binder's art is not something to be trifled with! Their secrets are well kept because meddling fools will only cause irreparable harm to themselves and the domains with which they tamper. A summoner with this trait receives a fate point every time they rebuff an offer of help from a potential student (so that character does not earn a test toward learning the skill). The summoner receives a persona point when they actively thwart another character from learning the secrets of Spirit Binding, Summoning, or Circination." + }, + "Bully": { + "cost": 1, + "type": "character" + }, + "Corrupted": { + "cost": 3, + "type": "die", + "desc": "This character has opened their body and soul to the dark powers. They must open the Corrupted emotional attribute. Increase their starting rank by one." + }, + "Council of Mages": { + "cost": 6, + "type": "die", + "desc": "The Council of Mages is a small, secretive, yet powerful entity. This trait grants a 1D reputation and a 1D affiliation with this organization. This combines with other appropriate reputations and affiliations." + }, + "Creepy": { + "cost": 1, + "type": "character" + }, + "Cult Leader": { + "cost": 8, + "type": "die", + "desc": "Cult Leaders are charismatic and eccentric. This trait grants a 1D reputation and 1D affiliation with the Death Cult. This combines with other appropriate reputations and affiliations." + }, + "Unhinged": { + "cost": 1, + "type": "character" + }, + "Disfigured": { + "cost": 3, + "type": "die", + "desc": "This character has led a life of hardship and pain. They've been cut up, broken, and beaten down. This trait grants +1D to shrug off or grit teeth for any injury." + }, + "Evil": { + "cost": 1, + "type": "character" + }, + "Faust": { + "cost": 3, + "type": "die", + "desc": "When bargaining with the higher powers for something pure and innocent like love, gain a bonus persona point for each agreement you strike on behalf of the one you seek to protect or affect." + }, + "Feared Above All": { + "cost": 5, + "type": "die", + "desc": "For good reason or not, this character is feared by all who know them. +1D to Intimidation. Choose a 1D infamous reputation." + }, + "Fiery": { + "cost": 1, + "type": "character" + }, + "Disgruntled": { + "cost": 1, + "type": "character" + }, + "Furtive": { + "cost": 1, + "type": "character" + }, + "Graduate": { + "cost": 3, + "type": "die", + "desc": "This trait grants a 1D affiliation with a College of Magic. This combines with other appropriate and applicable affiliations." + }, + "Harried": { + "cost": 1, + "type": "character" + }, + "Hazed": { + "cost": 2, + "type": "die", + "desc": "This character may take a free inimical relationship with another character who was their senior in the College of Magic." + }, + "Impressive Hat": { + "cost": 3, + "type": "die", + "desc": "This character's hat is mightily impressive. It can be seen for miles! It's so impressive that people often remember the hat more than the person. This gives a 1D Reputation among the people of a given locale as the wearer of the really impressive hat, so long as the hat is being worn, of course. Wearing the hat also gives a +2 Ob to any Disguise or Inconspicuous test." + }, + "Invocations of the Damned": { + "cost": 5, + "type": "call_on", + "desc": "The Dark Priest swears their soul to fell powers. Like other priests, they must have a Belief that ties to their Faith in order to maintain the emotional attribute. If the player writes a second Belief tied to their faith in the dark gods and their service to them, the priest may use this trait as a call-on for Faith when that Belief comes into question." + }, + "Late": { + "cost": 1, + "type": "character" + }, + "Low Born": { + "cost": 2, + "type": "die", + "desc": "Low Born characters are born of unremarkable parents. They cannot trace their lineage to any nobility or to any historic or notable figures. They have a 1D infamous reputation in noble or elite circles due to their obvious lack of heritage. It also adds a +1 Ob disadvantage to any Inconspicuous tests in noble or courtly settings." + }, + "Master of Mages": { + "cost": 0, + "type": "die", + "desc": "The Headmaster of a College of Magic attained their position by rigorous pursuit of excellence and expertise in sorcery and magic. This trait grants a 2D repuation among mages and the halls of power as a Master of Mages." + }, + "Outsider": { + "cost": 2, + "type": "die", + "desc": "Choose a 1D infamous reputation. And suffer -1 to your body of argument whenever you're trying to explain your nature, position, meaning, or special insight." + }, + "Never A Moment Of Peace": { + "cost": 3, + "type": "die", + "desc": "This trait grants the character a 5 rps relationship. This relationship must be with a character who is always bothering or interrupting him. If that character is forced out of his life, someone new will come along. This character just attracts these sort of people! You may invest additional resource points and increase the value of this relationship." + }, + "Polite": { + "cost": 1, + "type": "character" + }, + "Speaker Of The Secret Language": { + "cost": 1, + "type": "character" + }, + "Spirit Familiar": { + "cost": 5, + "type": "die", + "desc": "This character has a familiar whose spirit is linked to their own. They can see through the familiar's eyes using the familiar's Perception stat. However, when using their familiar's eyes, a character with this trait cannot look through their own though other senses may still be employed. It takes two actions of concentration to engage their familiar's eyes, and two more actions to return their sight to their own eyes. This trait does not grant Low Speech. However the creature does understand its companion's wishes and will go where its master directs it to go, look at what its master directs it to look at, etc. A character with this trait feels the pain of their familiar. If the familiar suffers a light or greater wound, the master suffers a light wound. If the familiar is ever killed, the master suffers a traumatic wound. In the game, the character is physically unharmed, but mentally traumatized. Recovery and Treatment are as per a standard traumatic wound. This wound does not bleed out. A familiar uses the following stats: Wi G2, Pe G3, Ag B4, Sp B5, Po B3, Fo B3, Hea B4, Ref B4, Ste B5, MW B9. Choose its form: cat, doc, snake, bird, pig, rabbit, fox or similar. No large predators or beasts of burden. The animal must show some mark or quality that indicates it is not entirely of this world. For example, it must be hairless, one eyed, two-tailed, of large size or even just have a disturbing aura." + }, + "Suicidal": { + "cost": 5, + "type": "die", + "desc": "This character (instantly) earns a persona point every time he takes a mortal wound." + }, + "Versatile": { + "cost": 4, + "type": "die", + "desc": "The Master Sorcerer places their confidence in the art of sorcery. It is a versatile and potent art, and they know it intimately. If using Art Magic, reduce by one the number of tests required for Weaving Magic into the Fiber of my Being. If using the standard Sorcery rules, reduce their practicals aptitude by one. If using Practical Magic, they may take an additional category of magic. In addition, the player earns a persona point for pushing their character's magic in a dangerous or untried direction." + }, + "Well Traveled": { + "cost": 4, + "type": "die", + "desc": "The Speaker of Names wanders the lands and seas, communing with the spirits. This trait allows the player to take a new domain when their character travels to a new locale in play. The player may describe a memory their character has of this place or a place like it. They may describe when they traveled here before. The player then adds a new domain to their spirit binder at its base level (0). Once used, this trait becomes a character trait. To be clear, the domain is added during play at a time of the player's choosing, not during character burning." + } +}; diff --git a/src/public/js/stocked/test/data_1.json b/src/public/js/stocked/test/data_1.json new file mode 100644 index 0000000..7583655 --- /dev/null +++ b/src/public/js/stocked/test/data_1.json @@ -0,0 +1,23 @@ +{ + "Foo Setting": { + "Born Foo": { + "time": 1, + "res": 5, + "stat": [ + [1, "pm"] + ], + "leads": [ + "Bar" + ], + "key_leads": [ + "Bar Setting" + ], + "skills": [ + [3, "General"] + ], + "traits": [1], + "common_traits": [] + } + }, + "Bar Setting": {} +} diff --git a/src/views/partials/stocked.erb b/src/views/partials/stocked.erb index 97d36cd..3c3511c 100644 --- a/src/views/partials/stocked.erb +++ b/src/views/partials/stocked.erb @@ -29,13 +29,14 @@
@@ -113,6 +114,13 @@
+ Note: + + Prefix a lifepath's name with "Born " to have charred consider it a born lifepath; + i.e. selectable if and only if it is the first lifepath. + +
+ collapse/expand all paths in setting @@ -329,37 +337,41 @@
-
-
-
Trait
-
Cost
-
Type
+ + + + + <%#
Bonus
%> <%#
Restrictions
%> - - -
-
-
+
+ <%# %> + + + + + + <%#
WISHLIST
%> <%#
WISHLIST
%> -
- -
+ + + +
TraitCostType
- -
+
- -
+
- - + [X]
+