0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-13 15:12:43 +00:00

Snippet bar has been replaced and new style of snippets being worked on

This commit is contained in:
Scott Tolksdorf
2017-02-26 11:53:40 -05:00
parent 0d0ce101f3
commit 9d4d337bb9
28 changed files with 302 additions and 1193 deletions

View File

@@ -1,13 +1,15 @@
const _ = require('lodash');
const process = (imports)=>{
};
module.exports = {
phb : _.keyBy([
require('./spell.snippet.js')
], (spt)=>_.snakeCase(spt.name)),
module.exports = _.merge(
require('./spell.snippet.js'),
require('./table.snippet.js')
}
//wide
//colors
//brushed
//font
//alignment
);

View File

@@ -1,4 +1,9 @@
module.exports = {
const _ = require('lodash');
const Data = {
rand : (name, max = 1, min = 1)=>{
return _.sampleSize(Data[name], _.random(min, max));
},
titles : [
`The Burning Gallows`,
@@ -309,4 +314,6 @@ module.exports = {
}
};
module.exports = Data;

View File

@@ -1,7 +1,4 @@
const _ = require('lodash');
const spellNames = require('./spellname.list.js');
const Data = require('./random.data.js');
@@ -11,13 +8,11 @@ const schools = ['abjuration', 'conjuration', 'divination', 'enchantment', 'evoc
module.exports = {
name : 'Spell',
icon : 'fa-spell',
gen : ()=>{
spell : ()=>{
let components = _.sampleSize(['V', 'S', 'M'], _.random(1,3)).join(', ');
if(components.indexOf('M') !== -1){
components += ' (' + _.sampleSize(Data.gear, _.random(1,3)).join(', ') + ')'
components += ` (${Data.rand('gear',3).join(', ')})`
}
const duration = _.sample([
@@ -28,11 +23,11 @@ module.exports = {
'1 hour'
]);
const description = _.sampleSize(Data.effects, _.random(1,2)).concat(_.sample(Data.effects2)).join(' ');
const description = Data.rand('effects', 2).concat(Data.rand('effects2')).join(' ');
return `{{spell
#### ${_.sample(spellNames)}
#### ${_.sample(Data.spellNames)}
*${_.sample(levels)}-level ${_.sample(schools)}*
- **Casting Time:** ${_.sample(['1 action', 'Reaction', '10 minutes', '1 hour'])}
- **Range:** ${_.sample(['Self', 'Touch', '30 feet', '60 feet'])}

View File

@@ -1,47 +0,0 @@
module.exports = [
'Astral Rite of Acne',
'Create Acne',
'Cursed Ramen Erruption',
'Dark Chant of the Dentists',
'Erruption of Immaturity',
'Flaming Disc of Inconvenience',
'Heal Bad Hygene',
'Heavenly Transfiguration of the Cream Devil',
'Hellish Cage of Mucus',
'Irritate Peanut Butter Fairy',
'Luminous Erruption of Tea',
'Mystic Spell of the Poser',
'Sorcerous Enchantment of the Chimneysweep',
'Steak Sauce Ray',
'Talk to Groupie',
'Astonishing Chant of Chocolate',
'Astounding Pasta Puddle',
'Ball of Annoyance',
'Cage of Yarn',
'Control Noodles Elemental',
'Create Nervousness',
'Cure Baldness',
'Cursed Ritual of Bad Hair',
'Dispell Piles in Dentist',
'Eliminate Florists',
'Illusionary Transfiguration of the Babysitter',
'Necromantic Armor of Salad Dressing',
'Occult Transfiguration of Foot Fetish',
'Protection from Mucus Giant',
'Tinsel Blast',
'Alchemical Evocation of the Goths',
'Call Fangirl',
'Divine Spell of Crossdressing',
'Dominate Ramen Giant',
'Eliminate Vindictiveness in Gym Teacher',
'Extra-Planar Spell of Irritation',
'Induce Whining in Babysitter',
'Invoke Complaining',
'Magical Enchantment of Arrogance',
'Occult Globe of Salad Dressing',
'Overwhelming Enchantment of the Chocolate Fairy',
'Sorcerous Dandruff Globe',
'Spiritual Invocation of the Costumers',
'Ultimate Rite of the Confetti Angel',
'Ultimate Ritual of Mouthwash',
];

View File

@@ -1,14 +1,62 @@
const _ = require('lodash');
const Data = require('./random.data.js');
/*
- Roll
- Level
- Cost
- spell lists
- roll charts
- cost
- Class
*/
const columns = {
roll : (rows)=>{
return _.concat([`d${rows}`, ':---:'], _.times(rows, (i)=>i+1));
},
level : (rows)=>{
return _.concat([`${_.sample(Data.classes)} Level`, ':---:'], _.times(rows, (i)=>`${i*2+3}th`));
},
spell : (rows)=>{
return _.concat(['Spells', ':---'], _.times(rows, (i)=>{
return `_${Data.rand('spellNames', 2).join(', ')}_`
}));
},
cost : (rows)=>{
return _.concat([`Cost`, '---:'], _.times(rows, (i)=>{
return _.sample(['1 gp', '10 gp', '5 cp', '10,000 gp', '200 sp', '1 pp', '2 gp']);
}));
},
gear : (rows)=>{
return _.concat([_.sample(['Equipment', 'Reward', 'Treasure']), ':---'], _.times(rows, (i)=>{
return Data.rand('gear');
}));
}
}
module.exports = {
name : 'Table',
icon : 'fa-table',
gen: ()=>{
table : () => {
const rows = _.sample([4,6,8,10]);
},
const cols = [
columns.roll(rows),
columns.level(rows),
columns.gear(rows)
];
return _.times(rows + 2, (i)=>{
if(i==1){
return '|' + _.map(cols, (col)=>col[i]).join('|') + '|';
}else{
return '| ' + _.map(cols, (col)=>col[i]).join(' | ') + ' |';
}
}).join('\n');
}
}

View File

@@ -0,0 +1,8 @@
module.exports = {
a4 : ()=>{
return `.phb{
width : 210mm;
height : 296.8mm;
}`;
}
}

View File

@@ -0,0 +1,6 @@
const _ = require('lodash');
module.exports = _.merge(
require('./ink.snippet.js'),
require('./a4.snippet.js')
);

View File

@@ -0,0 +1,9 @@
module.exports = {
inkFriendly : ()=>{
return `.phb{ background : white;}
.phb img{ display : none;}
.phb hr+blockquote{background : white;}`;
}
}