From e3285b5ca40e6f2284406501dc89f6a69d47e6e8 Mon Sep 17 00:00:00 2001
From: Gazook89 <58999374+Gazook89@users.noreply.github.com>
Date: Mon, 9 Aug 2021 21:06:29 -0500
Subject: [PATCH 01/13] Create .frame class for Class Tables
Add a `.frame` class for Class Tables so that the frame and background can be toggled on or off in a similar fashion to the new monster stat block.
This will allow a class table to be used as a "third caster archetype" table such as referenced in PR #1079. Adds consistency with Monster blocks, too.
---
themes/5ePhb.style.less | 24 +++++++++++++-----------
1 file changed, 13 insertions(+), 11 deletions(-)
diff --git a/themes/5ePhb.style.less b/themes/5ePhb.style.less
index 9e56a7009..5e5fb3b7c 100644
--- a/themes/5ePhb.style.less
+++ b/themes/5ePhb.style.less
@@ -514,17 +514,19 @@ body {
// * CLASS TABLE
// *****************************/
.page .classTable{
- margin-top : 25px;
- margin-bottom : 40px;
- border-collapse : separate;
- background-color : white;
- border : initial;
- border-style : solid;
- border-image-outset : 25px 17px;
- border-image-repeat : stretch;
- border-image-slice : 150 200 150 200;
- border-image-source : @frameBorderImage;
- border-image-width : 47px;
+ &.frame {
+ margin-top : 25px;
+ margin-bottom : 40px;
+ border-collapse : separate;
+ background-color : white;
+ border : initial;
+ border-style : solid;
+ border-image-outset : 25px 17px;
+ border-image-repeat : stretch;
+ border-image-slice : 150 200 150 200;
+ border-image-source : @frameBorderImage;
+ border-image-width : 47px;
+ }
h5{
margin-bottom : 10px;
}
From 5d4bc23c84db150422110e94c663e16f97e3b88d Mon Sep 17 00:00:00 2001
From: Gazook89 <58999374+Gazook89@users.noreply.github.com>
Date: Mon, 9 Aug 2021 21:09:34 -0500
Subject: [PATCH 02/13] Remove text wrapping from spanned header
This removes text wrapping from col-spanned headers inside a classtable...needed for half-tables that contain `--- Spells Slots per Spell Level ---` so they don't wrap to next line.
Both v3 and Legacy
---
themes/5ePhb.style.less | 3 +++
themes/5ePhbLegacy.style.less | 3 +++
2 files changed, 6 insertions(+)
diff --git a/themes/5ePhb.style.less b/themes/5ePhb.style.less
index 5e5fb3b7c..c733ca221 100644
--- a/themes/5ePhb.style.less
+++ b/themes/5ePhb.style.less
@@ -514,6 +514,9 @@ body {
// * CLASS TABLE
// *****************************/
.page .classTable{
+ th[colspan] {
+ white-space : nowrap;
+ }
&.frame {
margin-top : 25px;
margin-bottom : 40px;
diff --git a/themes/5ePhbLegacy.style.less b/themes/5ePhbLegacy.style.less
index 0f1cae7ec..9346c25bd 100644
--- a/themes/5ePhbLegacy.style.less
+++ b/themes/5ePhbLegacy.style.less
@@ -407,6 +407,9 @@ body {
border-image-slice : 150 200 150 200;
border-image-source : @frameBorderImage;
border-image-width : 47px;
+ th[colspan] {
+ white-space : nowrap;
+ }
h5{
margin-bottom : 10px;
}
From 8bda68d6846de267a9f6b8dc661d9cbd8ad7c513 Mon Sep 17 00:00:00 2001
From: Gazook89 <58999374+Gazook89@users.noreply.github.com>
Date: Tue, 10 Aug 2021 08:31:08 -0500
Subject: [PATCH 03/13] Add 1/3 ClassTable, Unframed classes
- Adds a snippet for 1/3 Spellcasting/ClassTables for Issue #191 and builds on PR #1079 to work with v3 (but leaves out Legacy).
- Refactored classTable gen to more closely match monster block gen in terms of element classes (passed to gen function via attributes rather than baked into `return` function)
- Added an "unframed" snippet for each Full, Half, and Third class tables, which is consistent with monster stat blocks, and also is needed to satisfy #191 / #1079.
---
.../snippetbar/snippets/classtable.gen.js | 48 +++++++++++++++++--
.../editor/snippetbar/snippets/snippets.js | 26 ++++++++--
2 files changed, 67 insertions(+), 7 deletions(-)
diff --git a/client/homebrew/editor/snippetbar/snippets/classtable.gen.js b/client/homebrew/editor/snippetbar/snippets/classtable.gen.js
index c8a2d051f..ec5b4433a 100644
--- a/client/homebrew/editor/snippetbar/snippets/classtable.gen.js
+++ b/client/homebrew/editor/snippetbar/snippets/classtable.gen.js
@@ -51,7 +51,7 @@ const getFeature = (level)=>{
};
module.exports = {
- full : function(){
+ full : function(classes){
const classname = _.sample(classnames);
const maxes = [4, 3, 3, 3, 3, 2, 2, 1, 1];
@@ -70,7 +70,7 @@ module.exports = {
let cantrips = 3;
let spells = 1;
let slots = 2;
- return `{{classTable,wide\n##### The ${classname}\n` +
+ return `{{${classes}\n##### The ${classname}\n` +
`| Level | Proficiency | Features | Cantrips | Spells | --- Spell Slots Per Level --- |||||||||\n`+
`| ^| Bonus ^| ^| Known ^| Known ^| 1st | 2nd | 3rd | 4th | 5th | 6th | 7th | 8th | 9th |\n`+
`|:-----:|:-----------:|:---------|:--------:|:------:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|\n${
@@ -92,11 +92,11 @@ module.exports = {
}).join('\n')}\n}}\n\n`;
},
- half : function(){
+ half : function(classes){
const classname = _.sample(classnames);
let featureScore = 1;
- return `
\n##### The ${classname}\n` +
+ return `{{${classes}\n##### The ${classname}\n` +
`| Level | Proficiency Bonus | Features | ${_.sample(features)}|\n` +
`|:---:|:---:|:---|:---:|\n${
_.map(levels, function(levelName, level){
@@ -111,5 +111,45 @@ module.exports = {
return `| ${res} |`;
}).join('\n')}\n
\n\n`;
+ },
+
+ third : function(classes){
+ const classname = _.sample(classnames);
+
+ const maxes = [4, 3, 3, 3, 3, 2, 2, 1, 1];
+ const drawSlots = function(Slots){
+ let slots = Number(Slots);
+ return _.times(4, function(i){
+ const max = maxes[i];
+ if(slots < 1) return '—';
+ const res = _.min([max, slots]);
+ slots -= res;
+ return res;
+ }).join(' | ');
+ };
+
+
+ let cantrips = 3;
+ let spells = 1;
+ let slots = 2;
+ return `{{${classes}\n##### ${classname} Spellcasting\n` +
+ `| Class | Cantrips | Spells | --- Spells Slots per Spell Level --- ||||\n` +
+ `| Level ^| Known ^| Known ^| 1st | 2nd | 3rd | 4th |\n` +
+ `|:---:|:---:|:---:|:---:|:---:|:---:|:---:|\n${
+ _.map(levels, function(levelName, level){
+ const res = [
+ levelName,
+ cantrips,
+ spells,
+ drawSlots(slots)
+ ].join(' | ');
+
+ cantrips += _.random(0, 1);
+ spells += _.random(0, 1);
+ slots += _.random(0, 2);
+
+ return `| ${res} |`;
+ }).join('\n')}\n}}\n\n`;
}
+
};
diff --git a/client/homebrew/editor/snippetbar/snippets/snippets.js b/client/homebrew/editor/snippetbar/snippets/snippets.js
index b30a96e7c..10cb9cf4e 100644
--- a/client/homebrew/editor/snippetbar/snippets/snippets.js
+++ b/client/homebrew/editor/snippetbar/snippets/snippets.js
@@ -212,12 +212,32 @@ module.exports = [
{
name : 'Class Table',
icon : 'fas fa-table',
- gen : ClassTableGen.full,
+ gen : ClassTableGen.full('classTable,frame,wide'),
},
{
- name : 'Half Class Table',
+ name : 'Class Table (unframed)',
+ icon : 'fas fa-table',
+ gen : ClassTableGen.full('classTable,wide'),
+ },
+ {
+ name : '1/2 Class Table',
icon : 'fas fa-list-alt',
- gen : ClassTableGen.half,
+ gen : ClassTableGen.half('classTable,frame'),
+ },
+ {
+ name : '1/2 Class Table (unframed)',
+ icon : 'fas fa-list-alt',
+ gen : ClassTableGen.half('classTable'),
+ },
+ {
+ name : '1/3 Class Table',
+ icon : 'fas fa-list-alt',
+ gen : ClassTableGen.third('classTable,frame'),
+ },
+ {
+ name : '1/3 Class Table (unframed)',
+ icon : 'fas fa-list-alt',
+ gen : ClassTableGen.third('classTable'),
},
{
name : 'Table',
From 927cc2e9b557195a2774c6f179b23cb84dcb98b7 Mon Sep 17 00:00:00 2001
From: Gazook89 <58999374+Gazook89@users.noreply.github.com>
Date: Tue, 10 Aug 2021 08:33:05 -0500
Subject: [PATCH 04/13] Fix "Spell Slots per Spell Level"
Update current "--- Spells Slots per Level ---" to more accurate "--- Spells Slots per Spell Level ---" to match source material.
---
client/homebrew/editor/snippetbar/snippets/classtable.gen.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/client/homebrew/editor/snippetbar/snippets/classtable.gen.js b/client/homebrew/editor/snippetbar/snippets/classtable.gen.js
index ec5b4433a..39d033108 100644
--- a/client/homebrew/editor/snippetbar/snippets/classtable.gen.js
+++ b/client/homebrew/editor/snippetbar/snippets/classtable.gen.js
@@ -71,7 +71,7 @@ module.exports = {
let spells = 1;
let slots = 2;
return `{{${classes}\n##### The ${classname}\n` +
- `| Level | Proficiency | Features | Cantrips | Spells | --- Spell Slots Per Level --- |||||||||\n`+
+ `| Level | Proficiency | Features | Cantrips | Spells | --- Spell Slots Per Spell Level --- |||||||||\n`+
`| ^| Bonus ^| ^| Known ^| Known ^| 1st | 2nd | 3rd | 4th | 5th | 6th | 7th | 8th | 9th |\n`+
`|:-----:|:-----------:|:---------|:--------:|:------:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|\n${
_.map(levels, function(levelName, level){
From 9f519b469d349a65d061fd5b262e4d189949e5ae Mon Sep 17 00:00:00 2001
From: Gazook89 <58999374+Gazook89@users.noreply.github.com>
Date: Tue, 10 Aug 2021 08:44:25 -0500
Subject: [PATCH 05/13] Change classTable Icons
---
client/homebrew/editor/snippetbar/snippets/snippets.js | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/client/homebrew/editor/snippetbar/snippets/snippets.js b/client/homebrew/editor/snippetbar/snippets/snippets.js
index 10cb9cf4e..fce298b57 100644
--- a/client/homebrew/editor/snippetbar/snippets/snippets.js
+++ b/client/homebrew/editor/snippetbar/snippets/snippets.js
@@ -216,7 +216,7 @@ module.exports = [
},
{
name : 'Class Table (unframed)',
- icon : 'fas fa-table',
+ icon : 'fas fa-border-none',
gen : ClassTableGen.full('classTable,wide'),
},
{
@@ -226,17 +226,17 @@ module.exports = [
},
{
name : '1/2 Class Table (unframed)',
- icon : 'fas fa-list-alt',
+ icon : 'fas fa-border-none',
gen : ClassTableGen.half('classTable'),
},
{
name : '1/3 Class Table',
- icon : 'fas fa-list-alt',
+ icon : 'fas fa-border-all',
gen : ClassTableGen.third('classTable,frame'),
},
{
name : '1/3 Class Table (unframed)',
- icon : 'fas fa-list-alt',
+ icon : 'fas fa-border-none',
gen : ClassTableGen.third('classTable'),
},
{
From 2a428100c52567aa4c39aae252f50f9f8ee78d93 Mon Sep 17 00:00:00 2001
From: Gazook89 <58999374+Gazook89@users.noreply.github.com>
Date: Tue, 10 Aug 2021 09:11:14 -0500
Subject: [PATCH 06/13] fix some indentation issues for circleCI
---
.../snippetbar/snippets/classtable.gen.js | 60 +++++++++----------
1 file changed, 30 insertions(+), 30 deletions(-)
diff --git a/client/homebrew/editor/snippetbar/snippets/classtable.gen.js b/client/homebrew/editor/snippetbar/snippets/classtable.gen.js
index 39d033108..5d631cb48 100644
--- a/client/homebrew/editor/snippetbar/snippets/classtable.gen.js
+++ b/client/homebrew/editor/snippetbar/snippets/classtable.gen.js
@@ -116,40 +116,40 @@ module.exports = {
third : function(classes){
const classname = _.sample(classnames);
- const maxes = [4, 3, 3, 3, 3, 2, 2, 1, 1];
- const drawSlots = function(Slots){
- let slots = Number(Slots);
- return _.times(4, function(i){
- const max = maxes[i];
- if(slots < 1) return '—';
- const res = _.min([max, slots]);
- slots -= res;
- return res;
- }).join(' | ');
- };
+ const maxes = [4, 3, 3, 3, 3, 2, 2, 1, 1];
+ const drawSlots = function(Slots){
+ let slots = Number(Slots);
+ return _.times(4, function(i){
+ const max = maxes[i];
+ if(slots < 1) return '—';
+ const res = _.min([max, slots]);
+ slots -= res;
+ return res;
+ }).join(' | ');
+ };
- let cantrips = 3;
- let spells = 1;
- let slots = 2;
- return `{{${classes}\n##### ${classname} Spellcasting\n` +
- `| Class | Cantrips | Spells | --- Spells Slots per Spell Level --- ||||\n` +
- `| Level ^| Known ^| Known ^| 1st | 2nd | 3rd | 4th |\n` +
- `|:---:|:---:|:---:|:---:|:---:|:---:|:---:|\n${
- _.map(levels, function(levelName, level){
- const res = [
- levelName,
- cantrips,
- spells,
- drawSlots(slots)
- ].join(' | ');
+ let cantrips = 3;
+ let spells = 1;
+ let slots = 2;
+ return `{{${classes}\n##### ${classname} Spellcasting\n` +
+ `| Class | Cantrips | Spells | --- Spells Slots per Spell Level --- ||||\n` +
+ `| Level ^| Known ^| Known ^| 1st | 2nd | 3rd | 4th |\n` +
+ `|:---:|:---:|:---:|:---:|:---:|:---:|:---:|\n${
+ _.map(levels, function(levelName, level){
+ const res = [
+ levelName,
+ cantrips,
+ spells,
+ drawSlots(slots)
+ ].join(' | ');
- cantrips += _.random(0, 1);
- spells += _.random(0, 1);
- slots += _.random(0, 2);
+ cantrips += _.random(0, 1);
+ spells += _.random(0, 1);
+ slots += _.random(0, 2);
- return `| ${res} |`;
- }).join('\n')}\n}}\n\n`;
+ return `| ${res} |`;
+ }).join('\n')}\n}}\n\n`;
}
};
From c9e1d7ba5c27d8f5510cb198a74573c5efd71dea Mon Sep 17 00:00:00 2001
From: Gazook89 <58999374+Gazook89@users.noreply.github.com>
Date: Tue, 10 Aug 2021 16:35:21 -0500
Subject: [PATCH 07/13] Fixed closing curly brackets on half class table
---
client/homebrew/editor/snippetbar/snippets/classtable.gen.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/client/homebrew/editor/snippetbar/snippets/classtable.gen.js b/client/homebrew/editor/snippetbar/snippets/classtable.gen.js
index 5d631cb48..1b1beb66a 100644
--- a/client/homebrew/editor/snippetbar/snippets/classtable.gen.js
+++ b/client/homebrew/editor/snippetbar/snippets/classtable.gen.js
@@ -110,7 +110,7 @@ module.exports = {
featureScore += _.random(0, 1);
return `| ${res} |`;
- }).join('\n')}\n\n\n`;
+ }).join('\n')}\n}}\n\n`;
},
third : function(classes){
From 50a8468995c0487ce6397119052ee71ec33b6039 Mon Sep 17 00:00:00 2001
From: Gazook89 <58999374+Gazook89@users.noreply.github.com>
Date: Thu, 26 Aug 2021 12:00:56 -0500
Subject: [PATCH 08/13] Update legacy and v3 styles
- removed wrap from legacy
- add :not([rowspan]) qualifier to wrap on v3.
---
themes/5ePhb.style.less | 2 +-
themes/5ePhbLegacy.style.less | 3 ---
2 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/themes/5ePhb.style.less b/themes/5ePhb.style.less
index ff0b2f189..8179ea97f 100644
--- a/themes/5ePhb.style.less
+++ b/themes/5ePhb.style.less
@@ -542,7 +542,7 @@ body {
// * CLASS TABLE
// *****************************/
.page .classTable{
- th[colspan] {
+ th[colspan]:not([rowspan]) {
white-space : nowrap;
}
&.frame {
diff --git a/themes/5ePhbLegacy.style.less b/themes/5ePhbLegacy.style.less
index 65fff2ba0..d814d4036 100644
--- a/themes/5ePhbLegacy.style.less
+++ b/themes/5ePhbLegacy.style.less
@@ -408,9 +408,6 @@ body {
border-image-slice : 150 200 150 200;
border-image-source : @frameBorderImage;
border-image-width : 47px;
- th[colspan] {
- white-space : nowrap;
- }
h5{
margin-bottom : 10px;
}
From dc65980dcb1acecb5c1f82ed8f9de13836c8e95a Mon Sep 17 00:00:00 2001
From: Gazook89 <58999374+Gazook89@users.noreply.github.com>
Date: Thu, 26 Aug 2021 12:51:36 -0500
Subject: [PATCH 09/13] pull drawSlots out of individual functions
---
.../snippetbar/snippets/classtable.gen.js | 44 +++++++------------
1 file changed, 16 insertions(+), 28 deletions(-)
diff --git a/client/homebrew/editor/snippetbar/snippets/classtable.gen.js b/client/homebrew/editor/snippetbar/snippets/classtable.gen.js
index 1b1beb66a..0c72ac898 100644
--- a/client/homebrew/editor/snippetbar/snippets/classtable.gen.js
+++ b/client/homebrew/editor/snippetbar/snippets/classtable.gen.js
@@ -50,22 +50,23 @@ const getFeature = (level)=>{
return res.join(', ');
};
+const maxes = [4, 3, 3, 3, 3, 2, 2, 1, 1];
+
+const drawSlots = function(Slots, rows){
+ let slots = Number(Slots);
+ return _.times(rows, function(i){
+ const max = maxes[i];
+ if(slots < 1) return '—';
+ const res = _.min([max, slots]);
+ slots -= res;
+ return res;
+ }).join(' | ');
+};
+
module.exports = {
full : function(classes){
const classname = _.sample(classnames);
- const maxes = [4, 3, 3, 3, 3, 2, 2, 1, 1];
- const drawSlots = function(Slots){
- let slots = Number(Slots);
- return _.times(9, function(i){
- const max = maxes[i];
- if(slots < 1) return '—';
- const res = _.min([max, slots]);
- slots -= res;
- return res;
- }).join(' | ');
- };
-
let cantrips = 3;
let spells = 1;
@@ -81,7 +82,7 @@ module.exports = {
getFeature(level),
cantrips,
spells,
- drawSlots(slots)
+ drawSlots(slots, 9)
].join(' | ');
cantrips += _.random(0, 1);
@@ -116,19 +117,6 @@ module.exports = {
third : function(classes){
const classname = _.sample(classnames);
- const maxes = [4, 3, 3, 3, 3, 2, 2, 1, 1];
- const drawSlots = function(Slots){
- let slots = Number(Slots);
- return _.times(4, function(i){
- const max = maxes[i];
- if(slots < 1) return '—';
- const res = _.min([max, slots]);
- slots -= res;
- return res;
- }).join(' | ');
- };
-
-
let cantrips = 3;
let spells = 1;
let slots = 2;
@@ -141,12 +129,12 @@ module.exports = {
levelName,
cantrips,
spells,
- drawSlots(slots)
+ drawSlots(slots, 4)
].join(' | ');
cantrips += _.random(0, 1);
spells += _.random(0, 1);
- slots += _.random(0, 2);
+ slots += _.random(0, 1);
return `| ${res} |`;
}).join('\n')}\n}}\n\n`;
From b4825e085e270ca176de0517636392ea262bddf9 Mon Sep 17 00:00:00 2001
From: Gazook89 <58999374+Gazook89@users.noreply.github.com>
Date: Fri, 27 Aug 2021 10:40:40 -0500
Subject: [PATCH 10/13] fix table snippet spacing in editor
---
.../snippetbar/snippets/classtable.gen.js | 50 +++++++++----------
1 file changed, 25 insertions(+), 25 deletions(-)
diff --git a/client/homebrew/editor/snippetbar/snippets/classtable.gen.js b/client/homebrew/editor/snippetbar/snippets/classtable.gen.js
index 0c72ac898..0055adf65 100644
--- a/client/homebrew/editor/snippetbar/snippets/classtable.gen.js
+++ b/client/homebrew/editor/snippetbar/snippets/classtable.gen.js
@@ -52,14 +52,14 @@ const getFeature = (level)=>{
const maxes = [4, 3, 3, 3, 3, 2, 2, 1, 1];
-const drawSlots = function(Slots, rows){
+const drawSlots = function(Slots, rows, padding){
let slots = Number(Slots);
return _.times(rows, function(i){
const max = maxes[i];
- if(slots < 1) return '—';
+ if(slots < 1) return _.pad('—', padding);
const res = _.min([max, slots]);
slots -= res;
- return res;
+ return _.pad(res.toString(), padding);
}).join(' | ');
};
@@ -72,17 +72,17 @@ module.exports = {
let spells = 1;
let slots = 2;
return `{{${classes}\n##### The ${classname}\n` +
- `| Level | Proficiency | Features | Cantrips | Spells | --- Spell Slots Per Spell Level --- |||||||||\n`+
- `| ^| Bonus ^| ^| Known ^| Known ^| 1st | 2nd | 3rd | 4th | 5th | 6th | 7th | 8th | 9th |\n`+
- `|:-----:|:-----------:|:---------|:--------:|:------:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|\n${
+ `| Level | Proficiency | Features | Cantrips | Spells | --- Spell Slots Per Spell Level --- |||||||||\n`+
+ `| ^| Bonus ^| ^| Known ^| Known ^| 1st | 2nd | 3rd | 4th | 5th | 6th | 7th | 8th | 9th |\n`+
+ `|:-----:|:-----------:|:--------------------------------------------------------|:--------:|:------:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|\n${
_.map(levels, function(levelName, level){
const res = [
- levelName,
- `+${profBonus[level]}`,
- getFeature(level),
- cantrips,
- spells,
- drawSlots(slots, 9)
+ _.pad(levelName, 5),
+ _.pad(`+${profBonus[level]}`, 11),
+ _.padEnd(getFeature(level), 55),
+ _.pad(cantrips.toString(), 8),
+ _.pad(spells.toString(), 6),
+ drawSlots(slots, 9, 3),
].join(' | ');
cantrips += _.random(0, 1);
@@ -98,14 +98,14 @@ module.exports = {
let featureScore = 1;
return `{{${classes}\n##### The ${classname}\n` +
- `| Level | Proficiency Bonus | Features | ${_.sample(features)}|\n` +
- `|:---:|:---:|:---|:---:|\n${
+ `| Level | Proficiency Bonus | Features | ${_.pad(_.sample(features), 26)} |\n` +
+ `|:-----:|:-----------------:|:--------------------------------------------------------|:--------------------------:|\n${
_.map(levels, function(levelName, level){
const res = [
- levelName,
- `+${profBonus[level]}`,
- getFeature(level),
- `+${featureScore}`
+ _.pad(levelName, 5),
+ _.pad(`+${profBonus[level]}`, 17),
+ _.padEnd(getFeature(level), 55),
+ _.pad(`+${featureScore}`, 26),
].join(' | ');
featureScore += _.random(0, 1);
@@ -121,15 +121,15 @@ module.exports = {
let spells = 1;
let slots = 2;
return `{{${classes}\n##### ${classname} Spellcasting\n` +
- `| Class | Cantrips | Spells | --- Spells Slots per Spell Level --- ||||\n` +
- `| Level ^| Known ^| Known ^| 1st | 2nd | 3rd | 4th |\n` +
- `|:---:|:---:|:---:|:---:|:---:|:---:|:---:|\n${
+ `| Class | Cantrips | Spells | --- Spells Slots per Spell Level --- ||||\n` +
+ `| Level ^| Known ^| Known ^| 1st | 2nd | 3rd | 4th |\n` +
+ `|:------:|:--------:|:-------:|:--------:|:--------:|:--------:|:--------:|\n${
_.map(levels, function(levelName, level){
const res = [
- levelName,
- cantrips,
- spells,
- drawSlots(slots, 4)
+ _.pad(levelName, 6),
+ _.pad(cantrips.toString(), 8),
+ _.pad(spells.toString(), 7),
+ drawSlots(slots, 4, 8),
].join(' | ');
cantrips += _.random(0, 1);
From 9d5130154be7c2d65de18524611e51881ff7a89b Mon Sep 17 00:00:00 2001
From: Trevor Buckner
Date: Fri, 27 Aug 2021 12:29:11 -0400
Subject: [PATCH 11/13] Remixed Feature names to be shorter.
---
.../snippetbar/snippets/classtable.gen.js | 46 +++++++++----------
1 file changed, 22 insertions(+), 24 deletions(-)
diff --git a/client/homebrew/editor/snippetbar/snippets/classtable.gen.js b/client/homebrew/editor/snippetbar/snippets/classtable.gen.js
index 0055adf65..789d15b68 100644
--- a/client/homebrew/editor/snippetbar/snippets/classtable.gen.js
+++ b/client/homebrew/editor/snippetbar/snippets/classtable.gen.js
@@ -4,33 +4,31 @@ const features = [
'Astrological Botany',
'Astrological Chemistry',
'Biochemical Sorcery',
- 'Civil Alchemy',
- 'Consecrated Biochemistry',
+ 'Civil Divination',
+ 'Consecrated Augury',
'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',
+ 'Genetic Banishing',
'Gunpowder Torturer',
- 'Orbital Gravedigger',
- 'Phased Linguist',
- 'Mathematical Pharmacist',
- 'Plasma Outlaw',
+ 'Gunslinger Corruptor',
+ 'Hermetic Geography',
+ 'Immunological Cultist',
'Malefic Chemist',
- 'Police Cultist'
+ 'Mathematical Pharmacy',
+ 'Nuclear Biochemistry',
+ 'Orbital Gravedigger',
+ 'Pharmaceutical Outlaw',
+ 'Phased Linguist',
+ 'Plasma Gunslinger',
+ 'Police Necromancer',
+ 'Ritual Astronomy',
+ 'Sixgun Poisoner',
+ 'Seismological Alchemy',
+ 'Spiritual Illusionism',
+ 'Statistical Occultism',
+ 'Spell Analyst',
+ 'Torque Interfacer'
];
const classnames = ['Archivist', 'Fancyman', 'Linguist', 'Fletcher',
@@ -79,7 +77,7 @@ module.exports = {
const res = [
_.pad(levelName, 5),
_.pad(`+${profBonus[level]}`, 11),
- _.padEnd(getFeature(level), 55),
+ _.padEnd(getFeature(level), 48),
_.pad(cantrips.toString(), 8),
_.pad(spells.toString(), 6),
drawSlots(slots, 9, 3),
@@ -104,7 +102,7 @@ module.exports = {
const res = [
_.pad(levelName, 5),
_.pad(`+${profBonus[level]}`, 17),
- _.padEnd(getFeature(level), 55),
+ _.padEnd(getFeature(level), 48),
_.pad(`+${featureScore}`, 26),
].join(' | ');
From e5cfa98bbde35cb3fb0c574785dcf38e2a9d9a44 Mon Sep 17 00:00:00 2001
From: Trevor Buckner
Date: Fri, 27 Aug 2021 12:30:57 -0400
Subject: [PATCH 12/13] Shorten Features column to match shorter names
---
.../editor/snippetbar/snippets/classtable.gen.js | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/client/homebrew/editor/snippetbar/snippets/classtable.gen.js b/client/homebrew/editor/snippetbar/snippets/classtable.gen.js
index 789d15b68..40c133b7a 100644
--- a/client/homebrew/editor/snippetbar/snippets/classtable.gen.js
+++ b/client/homebrew/editor/snippetbar/snippets/classtable.gen.js
@@ -70,9 +70,9 @@ module.exports = {
let spells = 1;
let slots = 2;
return `{{${classes}\n##### The ${classname}\n` +
- `| Level | Proficiency | Features | Cantrips | Spells | --- Spell Slots Per Spell Level --- |||||||||\n`+
- `| ^| Bonus ^| ^| Known ^| Known ^| 1st | 2nd | 3rd | 4th | 5th | 6th | 7th | 8th | 9th |\n`+
- `|:-----:|:-----------:|:--------------------------------------------------------|:--------:|:------:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|\n${
+ `| Level | Proficiency | Features | Cantrips | Spells | --- Spell Slots Per Spell Level --- |||||||||\n`+
+ `| ^| Bonus ^| ^| Known ^| Known ^| 1st | 2nd | 3rd | 4th | 5th | 6th | 7th | 8th | 9th |\n`+
+ `|:-----:|:-----------:|:-----------------------------------------------|:--------:|:------:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|\n${
_.map(levels, function(levelName, level){
const res = [
_.pad(levelName, 5),
@@ -96,8 +96,8 @@ module.exports = {
let featureScore = 1;
return `{{${classes}\n##### The ${classname}\n` +
- `| Level | Proficiency Bonus | Features | ${_.pad(_.sample(features), 26)} |\n` +
- `|:-----:|:-----------------:|:--------------------------------------------------------|:--------------------------:|\n${
+ `| Level | Proficiency Bonus | Features | ${_.pad(_.sample(features), 26)} |\n` +
+ `|:-----:|:-----------------:|:-----------------------------------------------|:--------------------------:|\n${
_.map(levels, function(levelName, level){
const res = [
_.pad(levelName, 5),
@@ -137,5 +137,4 @@ module.exports = {
return `| ${res} |`;
}).join('\n')}\n}}\n\n`;
}
-
};
From f5057119da7edd726ec8f051f472c42c8202109e Mon Sep 17 00:00:00 2001
From: Trevor Buckner
Date: Tue, 31 Aug 2021 16:39:13 -0400
Subject: [PATCH 13/13] Shrink tables width
---
.../snippetbar/snippets/classtable.gen.js | 50 ++++++++-----------
1 file changed, 21 insertions(+), 29 deletions(-)
diff --git a/client/homebrew/editor/snippetbar/snippets/classtable.gen.js b/client/homebrew/editor/snippetbar/snippets/classtable.gen.js
index 40c133b7a..c1f6254f9 100644
--- a/client/homebrew/editor/snippetbar/snippets/classtable.gen.js
+++ b/client/homebrew/editor/snippetbar/snippets/classtable.gen.js
@@ -2,7 +2,6 @@ const _ = require('lodash');
const features = [
'Astrological Botany',
- 'Astrological Chemistry',
'Biochemical Sorcery',
'Civil Divination',
'Consecrated Augury',
@@ -31,23 +30,16 @@ const features = [
'Torque Interfacer'
];
-const classnames = ['Archivist', 'Fancyman', 'Linguist', 'Fletcher',
- 'Notary', 'Berserker-Typist', 'Fishmongerer', 'Manicurist', 'Haberdasher', 'Concierge'];
+const classnames = ['Ackerman', 'Berserker-Typist', 'Concierge', 'Fishmonger',
+ 'Haberdasher', 'Manicurist', 'Netrunner', 'Weirkeeper'];
-const levels = ['1st', '2nd', '3rd', '4th', '5th', '6th', '7th', '8th', '9th', '10th', '11th', '12th', '13th', '14th', '15th', '16th', '17th', '18th', '19th', '20th'];
+const levels = ['1st', '2nd', '3rd', '4th', '5th',
+ '6th', '7th', '8th', '9th', '10th',
+ '11th', '12th', '13th', '14th', '15th',
+ '16th', '17th', '18th', '19th', '20th'];
const profBonus = [2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6];
-const getFeature = (level)=>{
- let res = [];
- if(_.includes([4, 6, 8, 12, 14, 16, 19], level+1)){
- res = ['Ability Score Improvement'];
- }
- res = _.union(res, _.sampleSize(features, _.sample([0, 1, 1, 1, 1, 1])));
- if(!res.length) return '─';
- return res.join(', ');
-};
-
const maxes = [4, 3, 3, 3, 3, 2, 2, 1, 1];
const drawSlots = function(Slots, rows, padding){
@@ -70,17 +62,17 @@ module.exports = {
let spells = 1;
let slots = 2;
return `{{${classes}\n##### The ${classname}\n` +
- `| Level | Proficiency | Features | Cantrips | Spells | --- Spell Slots Per Spell Level --- |||||||||\n`+
- `| ^| Bonus ^| ^| Known ^| Known ^| 1st | 2nd | 3rd | 4th | 5th | 6th | 7th | 8th | 9th |\n`+
- `|:-----:|:-----------:|:-----------------------------------------------|:--------:|:------:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|\n${
+ `| Level | Proficiency | Features | Cantrips | Spells | --- Spell Slots Per Spell Level ---|||||||||\n`+
+ `| ^| Bonus ^| ^| Known ^| Known ^|1st |2nd |3rd |4th |5th |6th |7th |8th |9th |\n`+
+ `|:-----:|:-----------:|:-------------|:--------:|:------:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|\n${
_.map(levels, function(levelName, level){
const res = [
_.pad(levelName, 5),
- _.pad(`+${profBonus[level]}`, 11),
- _.padEnd(getFeature(level), 48),
+ _.pad(`+${profBonus[level]}`, 2),
+ _.padEnd(_.sample(features), 21),
_.pad(cantrips.toString(), 8),
_.pad(spells.toString(), 6),
- drawSlots(slots, 9, 3),
+ drawSlots(slots, 9, 2),
].join(' | ');
cantrips += _.random(0, 1);
@@ -96,14 +88,14 @@ module.exports = {
let featureScore = 1;
return `{{${classes}\n##### The ${classname}\n` +
- `| Level | Proficiency Bonus | Features | ${_.pad(_.sample(features), 26)} |\n` +
- `|:-----:|:-----------------:|:-----------------------------------------------|:--------------------------:|\n${
+ `| Level | Proficiency Bonus | Features | ${_.pad(_.sample(features), 21)} |\n` +
+ `|:-----:|:-----------------:|:---------|:---------------------:|\n${
_.map(levels, function(levelName, level){
const res = [
_.pad(levelName, 5),
- _.pad(`+${profBonus[level]}`, 17),
- _.padEnd(getFeature(level), 48),
- _.pad(`+${featureScore}`, 26),
+ _.pad(`+${profBonus[level]}`, 2),
+ _.padEnd(_.sample(features), 23),
+ _.pad(`+${featureScore}`, 21),
].join(' | ');
featureScore += _.random(0, 1);
@@ -119,15 +111,15 @@ module.exports = {
let spells = 1;
let slots = 2;
return `{{${classes}\n##### ${classname} Spellcasting\n` +
- `| Class | Cantrips | Spells | --- Spells Slots per Spell Level --- ||||\n` +
- `| Level ^| Known ^| Known ^| 1st | 2nd | 3rd | 4th |\n` +
- `|:------:|:--------:|:-------:|:--------:|:--------:|:--------:|:--------:|\n${
+ `| Class | Cantrips | Spells |--- Spells Slots per Spell Level ---||||\n` +
+ `| Level ^| Known ^| Known ^| 1st | 2nd | 3rd | 4th |\n` +
+ `|:------:|:--------:|:-------:|:-------:|:-------:|:-------:|:-------:|\n${
_.map(levels, function(levelName, level){
const res = [
_.pad(levelName, 6),
_.pad(cantrips.toString(), 8),
_.pad(spells.toString(), 7),
- drawSlots(slots, 4, 8),
+ drawSlots(slots, 4, 7),
].join(' | ');
cantrips += _.random(0, 1);