1
0
mirror of https://github.com/stolksdorf/homebrewery.git synced 2025-12-27 05:31:28 +00:00

Thin class tables and wide moster stat blocks are added

This commit is contained in:
Scott
2016-02-19 18:31:28 -05:00
parent 47fd832a32
commit ac8579ccc9
4 changed files with 128 additions and 88 deletions

View File

@@ -40,9 +40,7 @@ var levels = ["1st", "2nd", "3rd", "4th", "5th", "6th", "7th", "8th", "9th", "10
module.exports = {
full : function(classname){
classname = classname || _.sample(classnames)
var maxes = [4,3,3,3,3,2,2,1,1]
@@ -62,7 +60,7 @@ module.exports = {
var spells = 1;
var slots = 2;
return "##### The " + classname + "\n" +
"___\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){
@@ -88,7 +86,7 @@ module.exports = {
var featureScore = 1
return "##### The " + classname + "\n" +
"___\n" +
"___\n" + "___\n" +
"| Level | Proficiency Bonus | Features | " + _.sample(features) + "|\n" +
"|:---:|:---:|:---|:---:|\n" +
_.map(levels, function(levelName, level){

View File

@@ -4,9 +4,8 @@ var genList = function(list, max){
return _.sample(list, _.random(0,max)).join(', ') || "None";
}
module.exports = function(){
var monsterName = _.sample([
var getMonsterName = function(){
return _.sample([
"All-devouring Baseball Imp",
"All-devouring Gumdrop Wraith",
"Chocolate Hydra",
@@ -59,10 +58,14 @@ module.exports = function(){
"Time Kangaroo",
"Tomb Poodle",
]);
}
var type = _.sample(['Tiny', 'Small', 'Medium', 'Large', 'Gargantuan', 'Stupidly vast']) + " " + _.sample(['beast', 'fiend', 'annoyance', 'guy', 'cutie'])
var getType = function(){
return _.sample(['Tiny', 'Small', 'Medium', 'Large', 'Gargantuan', 'Stupidly vast']) + " " + _.sample(['beast', 'fiend', 'annoyance', 'guy', 'cutie'])
}
var alignment =_.sample([
var getAlignment = function(){
return _.sample([
"annoying evil",
"chaotic gossipy",
"chaotic sloppy",
@@ -80,25 +83,24 @@ module.exports = function(){
"wordy evil",
"unaligned"
]);
};
var stats = '>|' + _.times(6, function(){
var getStats = function(){
return '>|' + _.times(6, function(){
var num = _.random(1,20);
var mod = Math.ceil(num/2 - 5)
return num + " (" + (mod >= 0 ? '+'+mod : mod ) + ")"
}).join('|') + '|';
}
var genAbilities = function(){
var genAbilities = function(){
return _.sample([
"> ***Pack Tactics.*** These guys work together. Like super well, you don't even know.",
"> ***False Appearance. *** While the armor reamin motionless, it is indistinguishable from a normal suit of armor.",
]);
}
}
var genAction = function(){
var genAction = function(){
var name = _.sample([
"Abdominal Drop",
"Airplane Hammer",
@@ -128,13 +130,17 @@ module.exports = function(){
])
return "> ***" + name + ".*** *Melee Weapon Attack:* +4 to hit, reach 5ft., one target. *Hit* 5 (1d6 + 2) ";
}
}
module.exports = {
full : function(){
return [
"___",
"> ## " + monsterName,
">*" + type + ", " + alignment+ "*",
"___",
"> ## " + getMonsterName(),
">*" + getType() + ", " + getAlignment() + "*",
"> ___",
"> - **Armor Class** " + _.random(10,20),
"> - **Hit Points** " + _.random(1, 150) + "(1d4 + 5)",
@@ -142,7 +148,36 @@ module.exports = function(){
">___",
">|STR|DEX|CON|INT|WIS|CHA|",
">|:---:|:---:|:---:|:---:|:---:|:---:|",
stats,
getStats(),
">___",
"> - **Condition Immunities** " + genList(["groggy", "swagged", "weak-kneed", "buzzed", "groovy", "melancholy", "drunk"], 3),
"> - **Senses** passive Perception " + _.random(3, 20),
"> - **Languages** " + genList(["Common", "Pottymouth", "Gibberish", "Latin", "Jive"], 2),
"> - **Challenge** " + _.random(0, 15) + " (" + _.random(10,10000)+ " XP)",
"> ___",
_.times(_.random(3,6), function(){
return genAbilities()
}).join('\n>\n'),
"> ### Actions",
_.times(_.random(4,6), function(){
return genAction()
}).join('\n>\n'),
].join('\n') + '\n\n\n';
},
half : function(){
return [
"___",
"> ## " + getMonsterName(),
">*" + getType() + ", " + getAlignment() + "*",
"> ___",
"> - **Armor Class** " + _.random(10,20),
"> - **Hit Points** " + _.random(1, 150) + "(1d4 + 5)",
"> - **Speed** " + _.random(0,50) + "ft.",
">___",
">|STR|DEX|CON|INT|WIS|CHA|",
">|:---:|:---:|:---:|:---:|:---:|:---:|",
getStats(),
">___",
"> - **Condition Immunities** " + genList(["groggy", "swagged", "weak-kneed", "buzzed", "groovy", "melancholy", "drunk"], 3),
"> - **Senses** passive Perception " + _.random(3, 20),
@@ -157,12 +192,5 @@ module.exports = function(){
return genAction()
}).join('\n>\n'),
].join('\n') + '\n\n\n';
}
}
/*
*/
/*
*/

View File

@@ -53,7 +53,12 @@ module.exports = [
{
tooltip : 'Monster Stat Block',
icon : 'fa-bug',
snippet : MonsterBlockGen,
snippet : MonsterBlockGen.half,
},
{
tooltip : 'Wide Monster Stat Block',
icon : 'fa-bullseye',
snippet : MonsterBlockGen.full,
},
{
tooltip : "Class Table",

View File

@@ -176,7 +176,9 @@
position : relative;
background-color : @monsterStatBackground;
border : none;
padding-top: 15px;
h2{
margin-top: -8px;
margin-bottom : 0px;
&+p{
padding-bottom : 0px;
@@ -263,7 +265,7 @@
.useColumns();
}
//*****************************
// * FULL CLASS TABLE
// * CLASS TABLE
// *****************************/
hr+table{
margin-top : -5px;
@@ -278,6 +280,13 @@
border-image-source : @frameBorderImage;
border-image-width : 47px;
}
h5+hr+table{
column-span : all;
-webkit-column-span : all;
-moz-column-span : all;
}
//*****************************
// * FOOTER
// *****************************/
@@ -336,7 +345,7 @@
list-style-type : none;
}
//Double hr for full width elements
hr+hr+table, hr+hr+blockquote{
hr+hr+blockquote{
column-span : all;
-webkit-column-span : all;
-moz-column-span : all;