1
0
mirror of https://github.com/stolksdorf/homebrewery.git synced 2025-12-20 18:31:29 +00:00

Table generators now follow the proper prof bonus from the phb

This commit is contained in:
Scott Tolksdorf
2016-05-24 21:50:55 -04:00
parent 2ed9395e29
commit 7cc70149da
4 changed files with 109 additions and 107 deletions

View File

@@ -1,7 +1,8 @@
# changelog # 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 - 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 ### Thursday, 19/05/2016 - v2.0.2

View File

@@ -1,105 +1,106 @@
var _ = require('lodash'); var _ = require('lodash');
var features = [ var features = [
"Astrological Botany", "Astrological Botany",
"Astrological Chemistry", "Astrological Chemistry",
"Biochemical Sorcery", "Biochemical Sorcery",
"Civil Alchemy", "Civil Alchemy",
"Consecrated Biochemistry", "Consecrated Biochemistry",
"Demonic Anthropology", "Demonic Anthropology",
"Divinatory Mineralogy", "Divinatory Mineralogy",
"Genetic Banishing", "Genetic Banishing",
"Hermetic Geography", "Hermetic Geography",
"Immunological Incantations", "Immunological Incantations",
"Nuclear Illusionism", "Nuclear Illusionism",
"Ritual Astronomy", "Ritual Astronomy",
"Seismological Divination", "Seismological Divination",
"Spiritual Biochemistry", "Spiritual Biochemistry",
"Statistical Occultism", "Statistical Occultism",
"Police Necromancer", "Police Necromancer",
"Sixgun Poisoner", "Sixgun Poisoner",
"Pharmaceutical Gunslinger", "Pharmaceutical Gunslinger",
"Infernal Banker", "Infernal Banker",
"Spell Analyst", "Spell Analyst",
"Gunslinger Corruptor", "Gunslinger Corruptor",
"Torque Interfacer", "Torque Interfacer",
"Exo Interfacer", "Exo Interfacer",
"Gunpowder Torturer", "Gunpowder Torturer",
"Orbital Gravedigger", "Orbital Gravedigger",
"Phased Linguist", "Phased Linguist",
"Mathematical Pharmacist", "Mathematical Pharmacist",
"Plasma Outlaw", "Plasma Outlaw",
"Malefic Chemist", "Malefic Chemist",
"Police Cultist" "Police Cultist"
]; ];
var classnames = ['Archivist', 'Fancyman', 'Linguist', 'Fletcher', var classnames = ['Archivist', 'Fancyman', 'Linguist', 'Fletcher',
'Notary', 'Berserker-Typist', 'Fishmongerer', 'Manicurist', 'Haberdasher', 'Concierge']; '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 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){ module.exports = {
classname = classname || _.sample(classnames) full : function(classname){
classname = classname || _.sample(classnames)
var maxes = [4,3,3,3,3,2,2,1,1]
var drawSlots = function(Slots){ var maxes = [4,3,3,3,3,2,2,1,1]
var slots = Number(Slots); var drawSlots = function(Slots){
return _.times(9, function(i){ var slots = Number(Slots);
var max = maxes[i]; return _.times(9, function(i){
if(slots < 1) return "—"; var max = maxes[i];
var res = _.min([max, slots]); if(slots < 1) return "—";
slots -= res; var res = _.min([max, slots]);
return res; slots -= res;
}).join(' | ') return res;
} }).join(' | ')
}
var cantrips = 3;
var spells = 1; var cantrips = 3;
var slots = 2; var spells = 1;
return "##### The " + classname + "\n" + var slots = 2;
"___\n" + return "##### The " + classname + "\n" +
"| Level | Proficiency Bonus | Features | Cantrips Known | Spells Known | 1st | 2nd | 3rd | 4th | 5th | 6th | 7th | 8th | 9th |\n"+ "___\n" +
"|:---:|:---:|:---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|\n" + "| Level | Proficiency Bonus | Features | Cantrips Known | Spells Known | 1st | 2nd | 3rd | 4th | 5th | 6th | 7th | 8th | 9th |\n"+
_.map(levels, function(levelName, level){ "|:---:|:---:|:---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|\n" +
var res = [ _.map(levels, function(levelName, level){
levelName, var res = [
"+" + Math.ceil(level/5 + 1), levelName,
_.sampleSize(features, _.sample([0,1,1])).join(', ') || "Ability Score Improvement", "+" + profBonus[level],
cantrips, _.sampleSize(features, _.sample([0,1,1])).join(', ') || "Ability Score Improvement",
spells, cantrips,
drawSlots(slots) spells,
].join(' | '); drawSlots(slots)
].join(' | ');
cantrips += _.random(0,1);
spells += _.random(0,1); cantrips += _.random(0,1);
slots += _.random(0,2); spells += _.random(0,1);
slots += _.random(0,2);
return "| " + res + " |";
}).join('\n') +'\n\n'; return "| " + res + " |";
}, }).join('\n') +'\n\n';
},
half : function(classname){
classname = classname || _.sample(classnames) half : function(classname){
classname = classname || _.sample(classnames)
var featureScore = 1
return "##### The " + classname + "\n" + var featureScore = 1
"___\n" + "___\n" + return "##### The " + classname + "\n" +
"| Level | Proficiency Bonus | Features | " + _.sample(features) + "|\n" + "___\n" + "___\n" +
"|:---:|:---:|:---|:---:|\n" + "| Level | Proficiency Bonus | Features | " + _.sample(features) + "|\n" +
_.map(levels, function(levelName, level){ "|:---:|:---:|:---|:---:|\n" +
var res = [ _.map(levels, function(levelName, level){
levelName, var res = [
"+" + Math.ceil(level/5 + 1), levelName,
_.sampleSize(features, _.sample([0,1,1])).join(', ') || "Ability Score Improvement", "+" + profBonus[level],
"+" + featureScore _.sampleSize(features, _.sample([0,1,1])).join(', ') || "Ability Score Improvement",
].join(' | '); "+" + featureScore
].join(' | ');
featureScore += _.random(0,1);
featureScore += _.random(0,1);
return "| " + res + " |";
}).join('\n') +'\n\n'; return "| " + res + " |";
} }).join('\n') +'\n\n';
}
}; };

View File

@@ -11,7 +11,7 @@ var Navbar = React.createClass({
<Nav.item href='/homebrew' className='homebrewLogo'> <Nav.item href='/homebrew' className='homebrewLogo'>
<div>The Homebrewery</div> <div>The Homebrewery</div>
</Nav.item> </Nav.item>
<Nav.item>v2.0.3</Nav.item> <Nav.item>v2.0.4</Nav.item>
</Nav.section> </Nav.section>
{this.props.children} {this.props.children}
</Nav.base> </Nav.base>

View File

@@ -1,7 +1,7 @@
{ {
"name": "naturalcrit", "name": "naturalcrit",
"description": "D&D Tools for the discerning DM", "description": "D&D Tools for the discerning DM",
"version": "2.0.3", "version": "2.0.4",
"scripts": { "scripts": {
"postinstall": "gulp prod", "postinstall": "gulp prod",
"start": "node server.js" "start": "node server.js"