From 7cc70149daf67183453b809221a484ed1610306f Mon Sep 17 00:00:00 2001 From: Scott Tolksdorf Date: Tue, 24 May 2016 21:50:55 -0400 Subject: [PATCH] Table generators now follow the proper prof bonus from the phb --- changelog.md | 3 +- .../editor/snippets/classtable.gen.js | 209 +++++++++--------- client/homebrew/navbar/navbar.jsx | 2 +- package.json | 2 +- 4 files changed, 109 insertions(+), 107 deletions(-) diff --git a/changelog.md b/changelog.md index 0a2381c..b393ba7 100644 --- a/changelog.md +++ b/changelog.md @@ -1,7 +1,8 @@ # changelog -### Tuesday, 24/05/2016 - v2.0.3 +### Tuesday, 24/05/2016 - v2.0.4 - Fixed extra wide monster stat blocks sometimes only being one column +- The class table generators now follow the proper progression from the PHB (thakns u/IrishBandit) ### Thursday, 19/05/2016 - v2.0.2 diff --git a/client/homebrew/editor/snippets/classtable.gen.js b/client/homebrew/editor/snippets/classtable.gen.js index 6da698d..4b78770 100644 --- a/client/homebrew/editor/snippets/classtable.gen.js +++ b/client/homebrew/editor/snippets/classtable.gen.js @@ -1,105 +1,106 @@ -var _ = require('lodash'); - -var features = [ - "Astrological Botany", - "Astrological Chemistry", - "Biochemical Sorcery", - "Civil Alchemy", - "Consecrated Biochemistry", - "Demonic Anthropology", - "Divinatory Mineralogy", - "Genetic Banishing", - "Hermetic Geography", - "Immunological Incantations", - "Nuclear Illusionism", - "Ritual Astronomy", - "Seismological Divination", - "Spiritual Biochemistry", - "Statistical Occultism", - "Police Necromancer", - "Sixgun Poisoner", - "Pharmaceutical Gunslinger", - "Infernal Banker", - "Spell Analyst", - "Gunslinger Corruptor", - "Torque Interfacer", - "Exo Interfacer", - "Gunpowder Torturer", - "Orbital Gravedigger", - "Phased Linguist", - "Mathematical Pharmacist", - "Plasma Outlaw", - "Malefic Chemist", - "Police Cultist" -]; - -var classnames = ['Archivist', 'Fancyman', 'Linguist', 'Fletcher', - 'Notary', 'Berserker-Typist', 'Fishmongerer', 'Manicurist', 'Haberdasher', 'Concierge']; - -var levels = ["1st", "2nd", "3rd", "4th", "5th", "6th", "7th", "8th", "9th", "10th", "11th", "12th", "13th", "14th", "15th", "16th", "17th", "18th", "19th", "20th"] - - -module.exports = { - full : function(classname){ - classname = classname || _.sample(classnames) - - var maxes = [4,3,3,3,3,2,2,1,1] - var drawSlots = function(Slots){ - var slots = Number(Slots); - return _.times(9, function(i){ - var max = maxes[i]; - if(slots < 1) return "—"; - var res = _.min([max, slots]); - slots -= res; - return res; - }).join(' | ') - } - - - var cantrips = 3; - var spells = 1; - var slots = 2; - return "##### The " + classname + "\n" + - "___\n" + - "| Level | Proficiency Bonus | Features | Cantrips Known | Spells Known | 1st | 2nd | 3rd | 4th | 5th | 6th | 7th | 8th | 9th |\n"+ - "|:---:|:---:|:---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|\n" + - _.map(levels, function(levelName, level){ - var res = [ - levelName, - "+" + Math.ceil(level/5 + 1), - _.sampleSize(features, _.sample([0,1,1])).join(', ') || "Ability Score Improvement", - cantrips, - spells, - drawSlots(slots) - ].join(' | '); - - cantrips += _.random(0,1); - spells += _.random(0,1); - slots += _.random(0,2); - - return "| " + res + " |"; - }).join('\n') +'\n\n'; - }, - - half : function(classname){ - classname = classname || _.sample(classnames) - - var featureScore = 1 - return "##### The " + classname + "\n" + - "___\n" + "___\n" + - "| Level | Proficiency Bonus | Features | " + _.sample(features) + "|\n" + - "|:---:|:---:|:---|:---:|\n" + - _.map(levels, function(levelName, level){ - var res = [ - levelName, - "+" + Math.ceil(level/5 + 1), - _.sampleSize(features, _.sample([0,1,1])).join(', ') || "Ability Score Improvement", - "+" + featureScore - ].join(' | '); - - featureScore += _.random(0,1); - - return "| " + res + " |"; - }).join('\n') +'\n\n'; - } +var _ = require('lodash'); + +var features = [ + "Astrological Botany", + "Astrological Chemistry", + "Biochemical Sorcery", + "Civil Alchemy", + "Consecrated Biochemistry", + "Demonic Anthropology", + "Divinatory Mineralogy", + "Genetic Banishing", + "Hermetic Geography", + "Immunological Incantations", + "Nuclear Illusionism", + "Ritual Astronomy", + "Seismological Divination", + "Spiritual Biochemistry", + "Statistical Occultism", + "Police Necromancer", + "Sixgun Poisoner", + "Pharmaceutical Gunslinger", + "Infernal Banker", + "Spell Analyst", + "Gunslinger Corruptor", + "Torque Interfacer", + "Exo Interfacer", + "Gunpowder Torturer", + "Orbital Gravedigger", + "Phased Linguist", + "Mathematical Pharmacist", + "Plasma Outlaw", + "Malefic Chemist", + "Police Cultist" +]; + +var classnames = ['Archivist', 'Fancyman', 'Linguist', 'Fletcher', + 'Notary', 'Berserker-Typist', 'Fishmongerer', 'Manicurist', 'Haberdasher', 'Concierge']; + +var levels = ["1st", "2nd", "3rd", "4th", "5th", "6th", "7th", "8th", "9th", "10th", "11th", "12th", "13th", "14th", "15th", "16th", "17th", "18th", "19th", "20th"] + +var profBonus = [2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,6,6,6,6] + +module.exports = { + full : function(classname){ + classname = classname || _.sample(classnames) + + var maxes = [4,3,3,3,3,2,2,1,1] + var drawSlots = function(Slots){ + var slots = Number(Slots); + return _.times(9, function(i){ + var max = maxes[i]; + if(slots < 1) return "—"; + var res = _.min([max, slots]); + slots -= res; + return res; + }).join(' | ') + } + + + var cantrips = 3; + var spells = 1; + var slots = 2; + return "##### The " + classname + "\n" + + "___\n" + + "| Level | Proficiency Bonus | Features | Cantrips Known | Spells Known | 1st | 2nd | 3rd | 4th | 5th | 6th | 7th | 8th | 9th |\n"+ + "|:---:|:---:|:---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|\n" + + _.map(levels, function(levelName, level){ + var res = [ + levelName, + "+" + profBonus[level], + _.sampleSize(features, _.sample([0,1,1])).join(', ') || "Ability Score Improvement", + cantrips, + spells, + drawSlots(slots) + ].join(' | '); + + cantrips += _.random(0,1); + spells += _.random(0,1); + slots += _.random(0,2); + + return "| " + res + " |"; + }).join('\n') +'\n\n'; + }, + + half : function(classname){ + classname = classname || _.sample(classnames) + + var featureScore = 1 + return "##### The " + classname + "\n" + + "___\n" + "___\n" + + "| Level | Proficiency Bonus | Features | " + _.sample(features) + "|\n" + + "|:---:|:---:|:---|:---:|\n" + + _.map(levels, function(levelName, level){ + var res = [ + levelName, + "+" + profBonus[level], + _.sampleSize(features, _.sample([0,1,1])).join(', ') || "Ability Score Improvement", + "+" + featureScore + ].join(' | '); + + featureScore += _.random(0,1); + + return "| " + res + " |"; + }).join('\n') +'\n\n'; + } }; \ No newline at end of file diff --git a/client/homebrew/navbar/navbar.jsx b/client/homebrew/navbar/navbar.jsx index c06516c..20c3c65 100644 --- a/client/homebrew/navbar/navbar.jsx +++ b/client/homebrew/navbar/navbar.jsx @@ -11,7 +11,7 @@ var Navbar = React.createClass({
The Homebrewery
- v2.0.3 + v2.0.4 {this.props.children} diff --git a/package.json b/package.json index b1575e6..0d5bf2a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "naturalcrit", "description": "D&D Tools for the discerning DM", - "version": "2.0.3", + "version": "2.0.4", "scripts": { "postinstall": "gulp prod", "start": "node server.js"