From 9335608c5ae7065c2543d0cf895e8ee0ebd9d70b Mon Sep 17 00:00:00 2001 From: Christian Brickhouse Date: Tue, 12 Mar 2019 14:29:43 -0700 Subject: [PATCH] Implementing magic item snippet from Issue 671. --- .../editor/snippetbar/snippets/magicitem.gen.js | 17 +++++++++++++++++ .../editor/snippetbar/snippets/snippets.js | 6 ++++++ 2 files changed, 23 insertions(+) create mode 100644 client/homebrew/editor/snippetbar/snippets/magicitem.gen.js diff --git a/client/homebrew/editor/snippetbar/snippets/magicitem.gen.js b/client/homebrew/editor/snippetbar/snippets/magicitem.gen.js new file mode 100644 index 0000000000..21f7712e00 --- /dev/null +++ b/client/homebrew/editor/snippetbar/snippets/magicitem.gen.js @@ -0,0 +1,17 @@ +const _ = require('lodash'); + +const itemNames = [ + 'Doorknob of Niceness' +]; + +module.exports = { + + return [ + `#### ${_.sample(itemNames)}`, + `*${_.sample(['Wondrous item', 'Armor', 'Weapon'])}, ${_.sample(['Common', 'Uncommon', 'Rare', 'Very Rare', 'Legendary', 'Artifact'])} (requires attunement)*`, + `
`, + `This knob is pretty nice. It opens the door you put it on.` + `*${_.sample(level)}-level ${_.sample(spellSchools)}*` + ].join('\n'); + } +}; diff --git a/client/homebrew/editor/snippetbar/snippets/snippets.js b/client/homebrew/editor/snippetbar/snippets/snippets.js index b7d661feac..5bc84209c0 100644 --- a/client/homebrew/editor/snippetbar/snippets/snippets.js +++ b/client/homebrew/editor/snippetbar/snippets/snippets.js @@ -6,6 +6,7 @@ const MonsterBlockGen = require('./monsterblock.gen.js'); const ClassFeatureGen = require('./classfeature.gen.js'); const CoverPageGen = require('./coverpage.gen.js'); const TableOfContentsGen = require('./tableOfContents.gen.js'); +const MagicItemGen = require('./magicitem.gen.js'); module.exports = [ @@ -145,6 +146,11 @@ module.exports = [ icon : 'fa-file-word-o', gen : CoverPageGen, }, + { + name : 'Magic Item', + icon : 'fa-key', + gen : MagicItemGen, + }, ] },