mirror of
https://github.com/stolksdorf/homebrewery.git
synced 2025-12-15 06:35:56 +00:00
Added a snippet for half class table gen
This commit is contained in:
@@ -1,79 +1,107 @@
|
|||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
|
|
||||||
module.exports = function(classname){
|
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"
|
||||||
|
];
|
||||||
|
|
||||||
classname = classname || _.sample(['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 features = [
|
var levels = ["1st", "2nd", "3rd", "4th", "5th", "6th", "7th", "8th", "9th", "10th", "11th", "12th", "13th", "14th", "15th", "16th", "17th", "18th", "19th", "20th"]
|
||||||
"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 maxes = [4,3,3,3,3,2,2,1,1]
|
|
||||||
var drawSlots = function(Slots){
|
module.exports = {
|
||||||
var slots = Number(Slots);
|
|
||||||
return _.times(9, function(i){
|
full : function(classname){
|
||||||
var max = maxes[i];
|
|
||||||
if(slots < 1) return "—";
|
classname = classname || _.sample(classnames)
|
||||||
var res = _.min([max, slots]);
|
|
||||||
slots -= res;
|
var maxes = [4,3,3,3,3,2,2,1,1]
|
||||||
return res;
|
var drawSlots = function(Slots){
|
||||||
}).join(' | ')
|
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" + "___\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),
|
||||||
|
_.sample(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" +
|
||||||
|
"| 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';
|
||||||
}
|
}
|
||||||
|
|
||||||
var extraWide = (_.random(0,1) === 0) ? "" : "___\n";
|
|
||||||
|
|
||||||
var cantrips = 3;
|
|
||||||
var spells = 1;
|
|
||||||
var slots = 2;
|
|
||||||
return "##### The " + classname + "\n" +
|
|
||||||
"___\n" + extraWide +
|
|
||||||
"| 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){
|
|
||||||
var res = [
|
|
||||||
levelName,
|
|
||||||
"+" + Math.ceil(level/5 + 1),
|
|
||||||
_.sample(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';
|
|
||||||
|
|
||||||
};
|
};
|
||||||
@@ -36,7 +36,7 @@ module.exports = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
tooltip : 'Table',
|
tooltip : 'Table',
|
||||||
icon : 'fa-list',
|
icon : 'fa-th-list',
|
||||||
snippet : function(){
|
snippet : function(){
|
||||||
return [
|
return [
|
||||||
"##### Cookie Tastiness",
|
"##### Cookie Tastiness",
|
||||||
@@ -58,7 +58,12 @@ module.exports = [
|
|||||||
{
|
{
|
||||||
tooltip : "Class Table",
|
tooltip : "Class Table",
|
||||||
icon : 'fa-table',
|
icon : 'fa-table',
|
||||||
snippet : ClassTableGen,
|
snippet : ClassTableGen.full,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
tooltip : "Half Class Table",
|
||||||
|
icon : 'fa-list-alt',
|
||||||
|
snippet : ClassTableGen.half,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
tooltip : "Column Break",
|
tooltip : "Column Break",
|
||||||
|
|||||||
Reference in New Issue
Block a user