1
0
mirror of https://github.com/stolksdorf/homebrewery.git synced 2025-12-15 09:35:57 +00:00

Added a snippet for half class table gen

This commit is contained in:
Scott Tolksdorf
2016-01-21 23:08:53 -05:00
committed by Scott
parent 69f8cdb402
commit c8b3a0f183
2 changed files with 107 additions and 74 deletions

View File

@@ -1,10 +1,5 @@
var _ = require('lodash');
module.exports = function(classname){
classname = classname || _.sample(['Archivist', 'Fancyman', 'Linguist', 'Fletcher',
'Notary', 'Berserker-Typist', 'Fishmongerer', 'Manicurist', 'Haberdasher', 'Concierge'])
var features = [
"Astrological Botany",
"Astrological Chemistry",
@@ -38,6 +33,18 @@ module.exports = function(classname){
"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);
@@ -50,16 +57,15 @@ module.exports = function(classname){
}).join(' | ')
}
var extraWide = (_.random(0,1) === 0) ? "" : "___\n";
var cantrips = 3;
var spells = 1;
var slots = 2;
return "##### The " + classname + "\n" +
"___\n" + extraWide +
"___\n" + "___\n" +
"| Level | Proficiency Bonus | Features | Cantrips Known | Spells Known | 1st | 2nd | 3rd | 4th | 5th | 6th | 7th | 8th | 9th |\n"+
"|:---:|:---:|:---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|\n" +
_.map(["1st", "2nd", "3rd", "4th", "5th", "6th", "7th", "8th", "9th", "10th", "11th", "12th", "13th", "14th", "15th", "16th", "17th", "18th", "19th", "20th"],function(levelName, level){
_.map(levels, function(levelName, level){
var res = [
levelName,
"+" + Math.ceil(level/5 + 1),
@@ -75,5 +81,27 @@ module.exports = function(classname){
return "| " + res + " |";
}).join('\n') +'\n\n';
},
half : function(classname){
classname = classname || _.sample(classnames)
var featureScore = 1
return "##### The " + classname + "\n" +
"___\n" +
"| Level | Proficiency Bonus | Features | " + _.sample(features) + "|\n" +
"|:---:|:---:|:---|:---:|\n" +
_.map(levels, function(levelName, level){
var res = [
levelName,
"+" + Math.ceil(level/5 + 1),
_.sample(features, _.sample([0,1,1])).join(', ') || "Ability Score Improvement",
"+" + featureScore
].join(' | ');
featureScore += _.random(0,1);
return "| " + res + " |";
}).join('\n') +'\n\n';
}
};

View File

@@ -36,7 +36,7 @@ module.exports = [
},
{
tooltip : 'Table',
icon : 'fa-list',
icon : 'fa-th-list',
snippet : function(){
return [
"##### Cookie Tastiness",
@@ -58,7 +58,12 @@ module.exports = [
{
tooltip : "Class Table",
icon : 'fa-table',
snippet : ClassTableGen,
snippet : ClassTableGen.full,
},
{
tooltip : "Half Class Table",
icon : 'fa-list-alt',
snippet : ClassTableGen.half,
},
{
tooltip : "Column Break",