0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-20 22:32:45 +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 = { module.exports = {
full : function(classname){ full : function(classname){
classname = classname || _.sample(classnames) classname = classname || _.sample(classnames)
var maxes = [4,3,3,3,3,2,2,1,1] var maxes = [4,3,3,3,3,2,2,1,1]
@@ -62,7 +60,7 @@ module.exports = {
var spells = 1; var spells = 1;
var slots = 2; var slots = 2;
return "##### The " + classname + "\n" + 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"+ "| Level | Proficiency Bonus | Features | Cantrips Known | Spells Known | 1st | 2nd | 3rd | 4th | 5th | 6th | 7th | 8th | 9th |\n"+
"|:---:|:---:|:---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|\n" + "|:---:|:---:|:---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|\n" +
_.map(levels, function(levelName, level){ _.map(levels, function(levelName, level){
@@ -88,7 +86,7 @@ module.exports = {
var featureScore = 1 var featureScore = 1
return "##### The " + classname + "\n" + return "##### The " + classname + "\n" +
"___\n" + "___\n" + "___\n" +
"| Level | Proficiency Bonus | Features | " + _.sample(features) + "|\n" + "| Level | Proficiency Bonus | Features | " + _.sample(features) + "|\n" +
"|:---:|:---:|:---|:---:|\n" + "|:---:|:---:|:---|:---:|\n" +
_.map(levels, function(levelName, level){ _.map(levels, function(levelName, level){

View File

@@ -4,9 +4,8 @@ var genList = function(list, max){
return _.sample(list, _.random(0,max)).join(', ') || "None"; return _.sample(list, _.random(0,max)).join(', ') || "None";
} }
module.exports = function(){ var getMonsterName = function(){
return _.sample([
var monsterName = _.sample([
"All-devouring Baseball Imp", "All-devouring Baseball Imp",
"All-devouring Gumdrop Wraith", "All-devouring Gumdrop Wraith",
"Chocolate Hydra", "Chocolate Hydra",
@@ -59,10 +58,14 @@ module.exports = function(){
"Time Kangaroo", "Time Kangaroo",
"Tomb Poodle", "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", "annoying evil",
"chaotic gossipy", "chaotic gossipy",
"chaotic sloppy", "chaotic sloppy",
@@ -80,25 +83,24 @@ module.exports = function(){
"wordy evil", "wordy evil",
"unaligned" "unaligned"
]); ]);
};
var getStats = function(){
return '>|' + _.times(6, function(){
var stats = '>|' + _.times(6, function(){
var num = _.random(1,20); var num = _.random(1,20);
var mod = Math.ceil(num/2 - 5) var mod = Math.ceil(num/2 - 5)
return num + " (" + (mod >= 0 ? '+'+mod : mod ) + ")" return num + " (" + (mod >= 0 ? '+'+mod : mod ) + ")"
}).join('|') + '|'; }).join('|') + '|';
}
var genAbilities = function(){
var genAbilities = function(){
return _.sample([ return _.sample([
"> ***Pack Tactics.*** These guys work together. Like super well, you don't even know.", "> ***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.", "> ***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([ var name = _.sample([
"Abdominal Drop", "Abdominal Drop",
"Airplane Hammer", "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) "; return "> ***" + name + ".*** *Melee Weapon Attack:* +4 to hit, reach 5ft., one target. *Hit* 5 (1d6 + 2) ";
} }
module.exports = {
full : function(){
return [ return [
"___", "___",
"> ## " + monsterName, "___",
">*" + type + ", " + alignment+ "*", "> ## " + getMonsterName(),
">*" + getType() + ", " + getAlignment() + "*",
"> ___", "> ___",
"> - **Armor Class** " + _.random(10,20), "> - **Armor Class** " + _.random(10,20),
"> - **Hit Points** " + _.random(1, 150) + "(1d4 + 5)", "> - **Hit Points** " + _.random(1, 150) + "(1d4 + 5)",
@@ -142,7 +148,36 @@ module.exports = function(){
">___", ">___",
">|STR|DEX|CON|INT|WIS|CHA|", ">|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), "> - **Condition Immunities** " + genList(["groggy", "swagged", "weak-kneed", "buzzed", "groovy", "melancholy", "drunk"], 3),
"> - **Senses** passive Perception " + _.random(3, 20), "> - **Senses** passive Perception " + _.random(3, 20),
@@ -157,12 +192,5 @@ module.exports = function(){
return genAction() return genAction()
}).join('\n>\n'), }).join('\n>\n'),
].join('\n') + '\n\n\n'; ].join('\n') + '\n\n\n';
}
} }
/*
*/
/*
*/

View File

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

View File

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