Added documentation UI and began documenting props
This commit is contained in:
3
app/imports/api/docs/Docs.js
Normal file
3
app/imports/api/docs/Docs.js
Normal file
@@ -0,0 +1,3 @@
|
||||
if (Meteor.isServer) throw 'Client side only collection, don\'t import on server';
|
||||
const Docs = new Mongo.Collection('docs');
|
||||
export default Docs;
|
||||
@@ -3,11 +3,13 @@ const PROPERTIES = Object.freeze({
|
||||
icon: '$vuetify.icons.action',
|
||||
name: 'Action',
|
||||
helpText: 'Actions are things your character can do. When an action is taken, all the properties under it are activated.',
|
||||
docsPath: 'property/action',
|
||||
suggestedParents: ['classLevel', 'feature', 'item'],
|
||||
},
|
||||
attribute: {
|
||||
icon: '$vuetify.icons.attribute',
|
||||
name: 'Attribute',
|
||||
docsPath: 'property/attribute',
|
||||
helpText: 'Attributes are the numbered statistics of your character, excluding rolls you might add proficiency bonus to, those are skills.',
|
||||
examples: 'Ability scores, speed, hit points, ki',
|
||||
suggestedParents: ['classLevel', 'buff'],
|
||||
@@ -15,6 +17,7 @@ const PROPERTIES = Object.freeze({
|
||||
adjustment: {
|
||||
icon: '$vuetify.icons.attribute_damage',
|
||||
name: 'Attribute damage',
|
||||
docsPath: 'property/attribute-damage',
|
||||
helpText: 'Attribute damage reduces the current value of an attribute when it is applied by an action. A negative value causes the attribute to increase instead, up to its normal maximum.',
|
||||
suggestedParents: ['action', 'attack', 'savingThrow', 'spell', 'branch'],
|
||||
},
|
||||
@@ -27,12 +30,14 @@ const PROPERTIES = Object.freeze({
|
||||
buffRemover: {
|
||||
icon: '$vuetify.icons.buffRemover',
|
||||
name: 'Remove Buff',
|
||||
docsPath: 'property/remove-buff',
|
||||
helpText: 'Removes a buff from the target character',
|
||||
suggestedParents: ['action', 'attack', 'savingThrow', 'spell', 'branch'],
|
||||
},
|
||||
branch: {
|
||||
icon: 'mdi-file-tree',
|
||||
name: 'Branch',
|
||||
docsPath: 'property/branch',
|
||||
helpText: 'When a branch is activated as a child of an action, it can control which of its children get activated.',
|
||||
suggestedParents: ['action', 'attack', 'savingThrow', 'spell'],
|
||||
},
|
||||
@@ -188,3 +193,17 @@ export function getPropertyName(type){
|
||||
export function getPropertyIcon(type){
|
||||
return type && PROPERTIES[type] && PROPERTIES[type].icon;
|
||||
}
|
||||
|
||||
const propsByDocsPath = new Map();
|
||||
|
||||
for (const key in PROPERTIES) {
|
||||
const prop = PROPERTIES[key];
|
||||
if (prop.docsPath) {
|
||||
propsByDocsPath.set(prop.docsPath, {
|
||||
...prop,
|
||||
type: key,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export { propsByDocsPath };
|
||||
|
||||
190
app/imports/server/PROPERTIES.js
Normal file
190
app/imports/server/PROPERTIES.js
Normal file
@@ -0,0 +1,190 @@
|
||||
const PROPERTIES = Object.freeze({
|
||||
action: {
|
||||
icon: '$vuetify.icons.action',
|
||||
name: 'Action',
|
||||
helpText: 'Actions are things your character can do. When an action is taken, all the properties under it are activated.',
|
||||
suggestedParents: ['classLevel', 'feature', 'item'],
|
||||
},
|
||||
attribute: {
|
||||
icon: '$vuetify.icons.attribute',
|
||||
name: 'Attribute',
|
||||
helpText: 'Attributes are the numbered statistics of your character, excluding rolls you might add proficiency bonus to, those are skills.',
|
||||
examples: 'Ability scores, speed, hit points, ki',
|
||||
suggestedParents: ['classLevel', 'buff'],
|
||||
},
|
||||
adjustment: {
|
||||
icon: '$vuetify.icons.attribute_damage',
|
||||
name: 'Attribute damage',
|
||||
helpText: 'Attribute damage reduces the current value of an attribute when it is applied by an action. A negative value causes the attribute to increase instead, up to its normal maximum.',
|
||||
suggestedParents: ['action', 'attack', 'savingThrow', 'spell', 'branch'],
|
||||
},
|
||||
buff: {
|
||||
icon: '$vuetify.icons.buff',
|
||||
name: 'Buff',
|
||||
helpText: 'When a buff is activated as a child of an action, it will copy the properties under itself onto a target character.',
|
||||
suggestedParents: ['action', 'attack', 'savingThrow', 'spell', 'branch'],
|
||||
},
|
||||
buffRemover: {
|
||||
icon: '$vuetify.icons.buffRemover',
|
||||
name: 'Remove Buff',
|
||||
helpText: 'Removes a buff from the target character',
|
||||
suggestedParents: ['action', 'attack', 'savingThrow', 'spell', 'branch'],
|
||||
},
|
||||
branch: {
|
||||
icon: 'mdi-file-tree',
|
||||
name: 'Branch',
|
||||
helpText: 'When a branch is activated as a child of an action, it can control which of its children get activated.',
|
||||
suggestedParents: ['action', 'attack', 'savingThrow', 'spell'],
|
||||
},
|
||||
class: {
|
||||
icon: 'mdi-card-account-details',
|
||||
name: 'Class',
|
||||
helpText: 'Your character should ideally have one starting class. Classes hold class levels',
|
||||
suggestedParents: [],
|
||||
},
|
||||
classLevel: {
|
||||
icon: '$vuetify.icons.class_level',
|
||||
name: 'Class level',
|
||||
helpText: 'Class levels represent a single level gained in a class',
|
||||
suggestedParents: ['class'],
|
||||
},
|
||||
constant: {
|
||||
icon: 'mdi-anchor',
|
||||
name: 'Constant',
|
||||
helpText: 'A constant can define a static value that can be used in calculations elsewhere in the sheet',
|
||||
suggestedParents: [],
|
||||
},
|
||||
container: {
|
||||
icon: 'mdi-bag-personal-outline',
|
||||
name: 'Container',
|
||||
helpText: 'A container holds items in the inventory',
|
||||
examples: 'Coin pouch, backpack',
|
||||
suggestedParents: ['folder'],
|
||||
},
|
||||
damage: {
|
||||
icon: '$vuetify.icons.damage',
|
||||
name: 'Damage',
|
||||
helpText: 'When damage is activated by an action it reduces the hit points of the target creature by the calculated amount.',
|
||||
suggestedParents: ['action', 'attack', 'savingThrow', 'spell', 'branch'],
|
||||
},
|
||||
damageMultiplier: {
|
||||
icon: '$vuetify.icons.damage_multiplier',
|
||||
name: 'Damage multiplier',
|
||||
helpText: 'Resistance, vulnerability, and immunity.',
|
||||
suggestedParents: ['classLevel', 'feature', 'item'],
|
||||
},
|
||||
effect: {
|
||||
icon: '$vuetify.icons.effect',
|
||||
name: 'Effect',
|
||||
helpText: 'Effects change the value or state of attributes and skills.',
|
||||
examples: '+2 Strength, Advantage on dexterity saving throws',
|
||||
suggestedParents: ['buff', 'classLevel', 'feature', 'folder', 'item'],
|
||||
},
|
||||
feature: {
|
||||
icon: 'mdi-text-subject',
|
||||
name: 'Feature',
|
||||
helpText: 'Descriptive or narrative features your character has access to',
|
||||
suggestedParents: ['classLevel', 'folder'],
|
||||
},
|
||||
folder: {
|
||||
icon: 'mdi-folder-outline',
|
||||
name: 'Folder',
|
||||
helpText: 'A way to organise other properties on the character',
|
||||
suggestedParents: ['folder'],
|
||||
},
|
||||
item: {
|
||||
icon: 'mdi-cube-outline',
|
||||
name: 'Item',
|
||||
helpText: 'Objects and equipment your charcter finds on their adventures',
|
||||
suggestedParents: ['container'],
|
||||
},
|
||||
note: {
|
||||
icon: 'mdi-note-outline',
|
||||
name: 'Note',
|
||||
helpText: 'Notes about your character and their adventures',
|
||||
suggestedParents: ['note', 'folder'],
|
||||
},
|
||||
pointBuy: {
|
||||
icon: 'mdi-table',
|
||||
name: 'Point Buy',
|
||||
helpText: 'A point buy table that allows the user to select an array of values that match a given cost',
|
||||
suggestedParents: [],
|
||||
},
|
||||
proficiency: {
|
||||
icon: 'mdi-brightness-1',
|
||||
name: 'Proficiency',
|
||||
helpText: 'Proficiencies apply your proficiency bonus to skills already on your character sheet.',
|
||||
suggestedParents: ['buff', 'classLevel', 'feature', 'folder'],
|
||||
},
|
||||
roll: {
|
||||
icon: '$vuetify.icons.roll',
|
||||
name: 'Roll',
|
||||
helpText: 'When activated by an action, rolls perform a calculation and temporarily store the result for other properties under the same action to use',
|
||||
suggestedParents: ['action', 'attack', 'savingThrow', 'spell', 'branch'],
|
||||
},
|
||||
reference: {
|
||||
icon: 'mdi-vector-link',
|
||||
name: 'Reference',
|
||||
libraryOnly: true,
|
||||
helpText: 'A reference is a link to a different property in a library. When a reference gets copied to a character sheet, it is replaced with the referenced property and all its children.',
|
||||
suggestedParents: [],
|
||||
},
|
||||
savingThrow: {
|
||||
icon: '$vuetify.icons.saving_throw',
|
||||
name: 'Saving throw',
|
||||
helpText: 'When a saving throw is activated by an action, it causes the target to make a saving throw, if the saving throw fails, the children properties of the saving throw are activated.',
|
||||
suggestedParents: ['action', 'attack', 'spell'],
|
||||
},
|
||||
skill: {
|
||||
icon: '$vuetify.icons.skill',
|
||||
name: 'Skill',
|
||||
helpText: 'Skills, saves, languages, and weapon and tool proficiencies are all skills. Skills can have a default proficiency set. Proficiencies and effects can change the value and state of skills.',
|
||||
suggestedParents: ['classLevel', 'folder'],
|
||||
},
|
||||
propertySlot: {
|
||||
icon: 'mdi-power-socket-eu',
|
||||
name: 'Slot',
|
||||
helpText: 'A slot in the character sheet is used to specify that a property needs to be selected from a library to fill the slot. The slot can determine what tags it is looking for, and any subscribed library property with matching tags can fill the slot',
|
||||
suggestedParents: [],
|
||||
},
|
||||
slotFiller: {
|
||||
icon: 'mdi-power-plug-outline',
|
||||
name: 'Slot filler',
|
||||
helpText: 'A slot filler allows for more advanced logic when it attempts to fill a slot. It can masquarade as any property type, and calculate whether it should fill a slot or not.',
|
||||
suggestedParents: ['propertySlot'],
|
||||
},
|
||||
spellList: {
|
||||
icon: '$vuetify.icons.spell_list',
|
||||
name: 'Spell list',
|
||||
helpText: 'A list of spells on your character sheet. It can provide a DC and spell attack bonus to the spells within',
|
||||
suggestedParents: [],
|
||||
},
|
||||
spell: {
|
||||
icon: '$vuetify.icons.spell',
|
||||
name: 'Spell',
|
||||
helpText: 'A spell your character can potentially cast',
|
||||
suggestedParents: ['spellList'],
|
||||
},
|
||||
toggle: {
|
||||
icon: '$vuetify.icons.toggle',
|
||||
name: 'Toggle',
|
||||
helpText: 'Togggles allow parts of the character sheet to be turned on and off, either manually or as the result of a calculation.',
|
||||
suggestedParents: [],
|
||||
},
|
||||
trigger: {
|
||||
icon: 'mdi-electric-switch',
|
||||
name: 'Trigger',
|
||||
helpText: 'Triggers apply their children in response to events on the character sheet, such as taking an action or receiving damage',
|
||||
suggestedParents: [],
|
||||
},
|
||||
});
|
||||
|
||||
export default PROPERTIES;
|
||||
|
||||
export function getPropertyName(type){
|
||||
return type && PROPERTIES[type] && PROPERTIES[type].name;
|
||||
}
|
||||
|
||||
export function getPropertyIcon(type){
|
||||
return type && PROPERTIES[type] && PROPERTIES[type].icon;
|
||||
}
|
||||
0
app/imports/server/action.js
Normal file
0
app/imports/server/action.js
Normal file
28
app/imports/server/publications/docs.js
Normal file
28
app/imports/server/publications/docs.js
Normal file
@@ -0,0 +1,28 @@
|
||||
import { propsByDocsPath } from '/imports/constants/PROPERTIES.js';
|
||||
|
||||
|
||||
// Manual doc paths
|
||||
const docPaths = [];
|
||||
const docs = new Map();
|
||||
docPaths.forEach(path => {
|
||||
docs.set(path, Assets.getText(`docs/${path}.md`))
|
||||
});
|
||||
|
||||
// Doc paths for properties
|
||||
propsByDocsPath.forEach(prop => {
|
||||
docs.set(prop.docsPath, Assets.getText(`docs/${prop.docsPath}.md`));
|
||||
});
|
||||
|
||||
Meteor.publish('docs', function (path) {
|
||||
if (!path) {
|
||||
docs.forEach((text, path) => {
|
||||
this.added('docs', path, { text });
|
||||
});
|
||||
} else {
|
||||
const text = docs.get(path);
|
||||
if (text) {
|
||||
this.added('docs', path, { text });
|
||||
}
|
||||
}
|
||||
this.ready();
|
||||
});
|
||||
@@ -11,3 +11,4 @@ import '/imports/server/publications/ownedDocuments.js';
|
||||
import '/imports/server/publications/searchLibraryNodes.js';
|
||||
import '/imports/server/publications/archiveFiles.js';
|
||||
import '/imports/server/publications/userImages.js';
|
||||
import '/imports/server/publications/docs.js';
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<template lang="html">
|
||||
<!-- eslint-disable-next-line vue/no-v-html -->
|
||||
<!-- eslint-disable vue/no-v-html -->
|
||||
<div
|
||||
class="markdown"
|
||||
@click="e => $emit('click', e)"
|
||||
v-html="compiledMarkdown"
|
||||
/>
|
||||
</template>
|
||||
|
||||
@@ -54,6 +54,19 @@
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-list>
|
||||
<v-list-item
|
||||
v-if="docsPath"
|
||||
@click="helpDialog"
|
||||
>
|
||||
<v-list-item-content>
|
||||
<v-list-item-title>
|
||||
Help
|
||||
</v-list-item-title>
|
||||
</v-list-item-content>
|
||||
<v-list-item-action>
|
||||
<v-icon>mdi-help</v-icon>
|
||||
</v-list-item-action>
|
||||
</v-list-item>
|
||||
<v-list-item
|
||||
v-if="$listeners && $listeners.duplicate"
|
||||
@click="$emit('duplicate')"
|
||||
@@ -137,6 +150,7 @@ import PropertyIcon from '/imports/ui/properties/shared/PropertyIcon.vue';
|
||||
import { getPropertyName } from '/imports/constants/PROPERTIES.js';
|
||||
import ColorPicker from '/imports/ui/components/ColorPicker.vue';
|
||||
import getThemeColor from '/imports/ui/utility/getThemeColor.js';
|
||||
import PROPERTIES from '/imports/constants/PROPERTIES.js';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -171,7 +185,11 @@ export default {
|
||||
}
|
||||
}
|
||||
return model.name || getPropertyName(model.type);
|
||||
}
|
||||
},
|
||||
docsPath() {
|
||||
const propDef = PROPERTIES[this.model.type];
|
||||
return propDef && propDef.docsPath;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
colorChanged(value){
|
||||
@@ -180,6 +198,15 @@ export default {
|
||||
back(){
|
||||
this.$store.dispatch('popDialogStack');
|
||||
},
|
||||
helpDialog() {
|
||||
this.$store.commit('pushDialogStack', {
|
||||
component: 'help-dialog',
|
||||
elementId: 'property-toolbar-menu-button',
|
||||
data: {
|
||||
path: this.docsPath,
|
||||
},
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -11,6 +11,7 @@ const DeleteConfirmationDialog = () => import('/imports/ui/dialogStack/DeleteCon
|
||||
const DeleteUserAccountDialog = () => import('/imports/ui/user/DeleteUserAccountDialog.vue');
|
||||
const ExperienceInsertDialog = () => import( '/imports/ui/creature/experiences/ExperienceInsertDialog.vue');
|
||||
const ExperienceListDialog = () => import( '/imports/ui/creature/experiences/ExperienceListDialog.vue');
|
||||
const HelpDialog = () => import( '/imports/ui/dialogStack/HelpDialog.vue');
|
||||
const InviteDialog = () => import('/imports/ui/user/InviteDialog.vue');
|
||||
const LevelUpDialog = () => import('/imports/ui/creature/slots/LevelUpDialog.vue');
|
||||
const LibraryCollectionCreationDialog = () => import('/imports/ui/library/LibraryCollectionCreationDialog.vue');
|
||||
@@ -42,6 +43,7 @@ export default {
|
||||
DeleteUserAccountDialog,
|
||||
ExperienceInsertDialog,
|
||||
ExperienceListDialog,
|
||||
HelpDialog,
|
||||
InviteDialog,
|
||||
LevelUpDialog,
|
||||
LibraryCollectionCreationDialog,
|
||||
|
||||
107
app/imports/ui/dialogStack/HelpDialog.vue
Normal file
107
app/imports/ui/dialogStack/HelpDialog.vue
Normal file
@@ -0,0 +1,107 @@
|
||||
<template lang="html">
|
||||
<dialog-base>
|
||||
<v-icon
|
||||
slot="toolbar"
|
||||
class="mr-2"
|
||||
>
|
||||
mdi-help
|
||||
</v-icon>
|
||||
<v-toolbar-title slot="toolbar">
|
||||
Help: {{ title }}
|
||||
</v-toolbar-title>
|
||||
<div>
|
||||
<v-progress-circular
|
||||
v-if="!doc && !$subReady.docs"
|
||||
indeterminate
|
||||
color="primary"
|
||||
size="32"
|
||||
/>
|
||||
<div v-else-if="!doc">
|
||||
Help document not found for {{ title }}
|
||||
</div>
|
||||
<markdown-text
|
||||
v-else
|
||||
:markdown="doc"
|
||||
@click="linkClick"
|
||||
/>
|
||||
</div>
|
||||
<v-spacer slot="actions" />
|
||||
<v-btn
|
||||
slot="actions"
|
||||
text
|
||||
@click="$store.dispatch('popDialogStack')"
|
||||
>
|
||||
Close
|
||||
</v-btn>
|
||||
</dialog-base>
|
||||
</template>
|
||||
|
||||
<script lang="js">
|
||||
import DialogBase from '/imports/ui/dialogStack/DialogBase.vue';
|
||||
import { propsByDocsPath } from '/imports/constants/PROPERTIES.js';
|
||||
import MarkdownText from '/imports/ui/components/MarkdownText.vue';
|
||||
import Docs from '/imports/api/docs/Docs.js';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
DialogBase,
|
||||
MarkdownText,
|
||||
},
|
||||
props: {
|
||||
path: {
|
||||
type: String,
|
||||
required: true,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
prop() {
|
||||
return propsByDocsPath.get(this.path);
|
||||
},
|
||||
title() {
|
||||
if (this.prop) {
|
||||
return this.prop.name;
|
||||
} else {
|
||||
const titleCase = this.path.replace(
|
||||
/(\w*)(\W+)/g,
|
||||
function(txt, word) {
|
||||
return word.charAt(0).toUpperCase() + word.substr(1).toLowerCase() + ' ';
|
||||
}
|
||||
);
|
||||
return titleCase || 'Character Sheet';
|
||||
}
|
||||
}
|
||||
},
|
||||
meteor: {
|
||||
$subscribe: {
|
||||
'docs'(){
|
||||
return [this.path];
|
||||
},
|
||||
},
|
||||
doc() {
|
||||
const doc = Docs.findOne(this.path);
|
||||
return doc && doc.text;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
linkClick(e) {
|
||||
const target = e.target || e.srcElement;
|
||||
const href = target && target.href;
|
||||
if (!href) return;
|
||||
const path = href.split('/docs/')[1];
|
||||
if (!path) return;
|
||||
e.preventDefault();
|
||||
target.dataset.id = path;
|
||||
this.$store.commit('pushDialogStack', {
|
||||
component: 'help-dialog',
|
||||
elementId: path,
|
||||
data: {
|
||||
path,
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="css" scoped>
|
||||
</style>
|
||||
@@ -99,6 +99,7 @@
|
||||
{title: 'Files', icon: 'mdi-file-multiple', to: '/my-files'},
|
||||
{title: 'Feedback', icon: 'mdi-bug', to: '/feedback'},
|
||||
{title: 'About', icon: 'mdi-sign-text', to: '/about'},
|
||||
{title: 'Documentation', icon: 'mdi-book-open-variant', to: '/docs'},
|
||||
{title: 'Patreon', icon: 'mdi-patreon', href: 'https://www.patreon.com/dicecloud'},
|
||||
{title: 'Github', icon: 'mdi-github', href: 'https://github.com/ThaumRystra/DiceCloud/tree/version-2'},
|
||||
];
|
||||
|
||||
@@ -8,5 +8,5 @@ marked.setOptions({
|
||||
silent: true,
|
||||
smartLists: true,
|
||||
smartypants: true,
|
||||
baseUrl: 'https://dicecloud.com',
|
||||
//baseUrl: 'https://dicecloud.com',
|
||||
});
|
||||
|
||||
69
app/imports/ui/pages/Documentation.vue
Normal file
69
app/imports/ui/pages/Documentation.vue
Normal file
@@ -0,0 +1,69 @@
|
||||
<template>
|
||||
<v-container>
|
||||
<v-row>
|
||||
<v-col cols="12">
|
||||
<v-card>
|
||||
<v-card-text>
|
||||
<markdown-text
|
||||
:markdown="doc"
|
||||
/>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</template>
|
||||
|
||||
<script lang="js">
|
||||
import MarkdownText from '/imports/ui/components/MarkdownText.vue';
|
||||
import Docs from '/imports/api/docs/Docs.js';
|
||||
import { propsByDocsPath } from '/imports/constants/PROPERTIES.js';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
MarkdownText,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
action: undefined,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
path() {
|
||||
return this.$route.params.docPath;
|
||||
},
|
||||
prop() {
|
||||
return propsByDocsPath.get(this.path);
|
||||
},
|
||||
},
|
||||
meteor: {
|
||||
$subscribe: {
|
||||
'docs'(){
|
||||
return [this.path];
|
||||
},
|
||||
},
|
||||
doc() {
|
||||
const doc = Docs.findOne(this.path);
|
||||
return doc && doc.text;
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
path: {
|
||||
immediate: true,
|
||||
handler(value) {
|
||||
if (this.prop) {
|
||||
this.$store.commit('setPageTitle', this.prop.name + ' Docs');
|
||||
} else {
|
||||
const titleCase = value.replace(
|
||||
/(\w*)(\W+)/g,
|
||||
function(txt, word) {
|
||||
return word.charAt(0).toUpperCase() + word.substr(1).toLowerCase() + ' ';
|
||||
}
|
||||
);
|
||||
this.$store.commit('setPageTitle', titleCase || 'Character Sheet');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -34,6 +34,7 @@ const TabletopRightDrawer = () => import('/imports/ui/tabletop/TabletopRightDraw
|
||||
const Admin = () => import('/imports/ui/pages/Admin.vue');
|
||||
const Maintenance = () => import('/imports/ui/pages/Maintenance.vue');
|
||||
const Files = () => import('/imports/ui/pages/Files.vue');
|
||||
const Documentation = () => import('/imports/ui/pages/Documentation.vue');
|
||||
|
||||
// Not found
|
||||
const NotFound = () => import('/imports/ui/pages/NotFound.vue');
|
||||
@@ -242,6 +243,14 @@ RouterFactory.configure(router => {
|
||||
meta: {
|
||||
title: 'Feedback',
|
||||
},
|
||||
}, {
|
||||
path: '/docs/:docPath([^/]+.*)',
|
||||
components: {
|
||||
default: Documentation,
|
||||
},
|
||||
meta: {
|
||||
title: 'Documentation',
|
||||
},
|
||||
},{
|
||||
path: '/about',
|
||||
components: {
|
||||
|
||||
@@ -89,6 +89,10 @@
|
||||
background-color: rgba(0, 0, 0, 0.1)
|
||||
}
|
||||
|
||||
.markdown ul {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.theme--dark.v-application .markdown tbody>tr:nth-child(odd) {
|
||||
background-color: rgba(255, 255, 255, 0.1)
|
||||
}
|
||||
49
app/private/docs/FunctionReference.vue
Normal file
49
app/private/docs/FunctionReference.vue
Normal file
@@ -0,0 +1,49 @@
|
||||
<template lang="html">
|
||||
<div>
|
||||
<div
|
||||
v-for="fn in functions"
|
||||
:key="fn.name"
|
||||
class="mb-3"
|
||||
>
|
||||
<h3>{{ fn.name }}</h3>
|
||||
<div class="my-2">
|
||||
{{ fn.comment }}
|
||||
</div>
|
||||
<table>
|
||||
<tr
|
||||
v-for="example in fn.examples"
|
||||
:key="example.input"
|
||||
>
|
||||
<td>
|
||||
<code>{{ example.input }}</code>
|
||||
</td>
|
||||
<td>
|
||||
<v-icon>mdi-arrow-right-thick</v-icon>
|
||||
</td>
|
||||
<td>
|
||||
<code>{{ example.result }}</code>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="js">
|
||||
import functions from '/imports/parser/functions.js';
|
||||
export default {
|
||||
computed:{
|
||||
functions(){
|
||||
let fns = [];
|
||||
for (let name in functions){
|
||||
let f = functions[name];
|
||||
fns.push({name, ...f});
|
||||
}
|
||||
return fns;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="css" scoped>
|
||||
</style>
|
||||
113
app/private/docs/property/action.md
Normal file
113
app/private/docs/property/action.md
Normal file
@@ -0,0 +1,113 @@
|
||||
# Actions
|
||||
|
||||
Actions are things your character can do. When an action is taken, all the properties under it are applied.
|
||||
|
||||
Add actions to your character sheet, then add children under the action to determine what happenes when the action is applied.
|
||||
|
||||
When an action is applied it will create an entry in the character's log detailing all the properties that were applied and what their results were.
|
||||
|
||||
The following properties can all be applied by an action:
|
||||
|
||||
- [Attribute Damage](/docs/property/attribute-damage)
|
||||
- [Branches](/docs/property/branch)
|
||||
- [Buffs](/docs/property/buff)
|
||||
- [Buff Removers](/docs/property/remove-buff)
|
||||
- [Damage](/docs/property/damage)
|
||||
- [Notes](/docs/property/note)
|
||||
- [Rolls](/docs/property/roll)
|
||||
- [Saving Throws](/docs/property/saving-throw)
|
||||
- Other actions
|
||||
|
||||
---
|
||||
|
||||
### Name `#action.name`
|
||||
|
||||
The name of the action.
|
||||
|
||||
### Action type `#action.actionType`
|
||||
|
||||
How long the action takes to perform.
|
||||
|
||||
Allows [inline calculations](/docs/inline-calculations).
|
||||
|
||||
### Attack roll `#action.attackRoll`
|
||||
|
||||
A [computed field](/docs/computed-fields) which calculates the attack roll modifier. If this field is empty, no attack roll will be made. Use 0 to make an attack roll without a modifier.
|
||||
|
||||
The following variables may be added to the action scope when attack rolls are made:
|
||||
|
||||
- `$attackDiceRoll` The value of the d20 roll before any modifiers were applied.
|
||||
- `$attackRoll` The total attack roll after modifiers.
|
||||
- `$criticalHit` Set to `true` if the attack roll's d20 is a natural 20. If `criticalHitTarget` is set, the attack roll's d20 must instead be equal to or greater than `criticalHitTarget` for this to be set to `true`.
|
||||
- `$criticalMiss` Set to `true` if the attack roll was not a critical hit and rolled a natural 1 on the d20 roll.
|
||||
- `$attackHit` If the attack roll is higher than or equal to the target's AC or a critical hit this is set to `true`. Remains unset if there is no target for the attack unless the attack is a critical hit.
|
||||
- `$attackMiss` If the attack roll is lower than the target's AC or a critical miss, this is set to `true`. Remains unset if there is no target for the attack unless the attack is a critical miss.
|
||||
|
||||
### Summary `#action.summary`
|
||||
|
||||
A brief overview of what the action does. This will appear in the action card, and shows in the log when the action is applied.
|
||||
|
||||
Calculations inside of `{` curly bracers `}` will be computed.
|
||||
|
||||
### Description `#action.description`
|
||||
|
||||
A more detailed description of the action. The description does not show in the action card or the log when the action is applied.
|
||||
|
||||
Allows [inline calculations](/docs/inline-calculations).
|
||||
|
||||
### Resource
|
||||
|
||||
A resource can be any attribute that has a variable name. If the resource attribute is less than the amount required, the action can't be applied.
|
||||
|
||||
If you want to reduce an attribute when taking the action, but want the action to be applied regardless of the value of that attribute, consider using an [Attribute Damage](/docs/property/attribute-damage) property as a child of the action instead. Also use Attribute Damage when the amount to reduce the attribute is determined by a dice roll rather than a stable computed number.
|
||||
|
||||
#### Resource attribute
|
||||
|
||||
The variable name of the attribute that will be consumed when taking this action.
|
||||
|
||||
#### Resource quantity
|
||||
|
||||
A [computed field](/docs/computed-fields) which determines how much of the attribute is required to apply this action. This amount will be deducted from the attribute every time the action is taken.
|
||||
|
||||
### Ammo
|
||||
|
||||
Ammo represents items that are requied to take the action. If an item is not selected, or there is insufficient quantity of the selected item, the action can't be appled.
|
||||
|
||||
#### Ammo item
|
||||
|
||||
Specify what tag an item must have to be considered valid ammo for this action. Any item with this tag can be selected as ammo for this action.
|
||||
|
||||
#### Ammo quantity
|
||||
|
||||
A [computed field](/docs/computed-fields) which determines how many of the selected items are required to take this action. The quantity is deducted from the total quantity of the item when this action is applied.
|
||||
|
||||
### Tags
|
||||
|
||||
See [Tags](/docs/tags)
|
||||
|
||||
### Target
|
||||
|
||||
Who this action should apply to. The properties under the action will be applied to the target.
|
||||
|
||||
- **Self** The action will apply its properties to the creature taking the action
|
||||
- **Single Target** The action will apply its properties without a target (for now)
|
||||
- **Multiple Targets** The action will apply its properties without a target (for now)
|
||||
|
||||
### Uses
|
||||
|
||||
A [computed field](/docs/computed-fields) which determines how many times this action can be used before it needs to be reset.
|
||||
|
||||
### Uses used
|
||||
|
||||
How many of this action's uses have already been used. Should ideally be between 0 and the total uses available. This number is set to 0 when the action has uses and its uses are reset.
|
||||
|
||||
### Don't show in log
|
||||
|
||||
When this is true, the action does not show up in the log. This does not stop the action's children from appearing in the log when they are applied.
|
||||
|
||||
### Reset
|
||||
|
||||
If set, the uses used field is set to 0 at the appropriate time.
|
||||
|
||||
- **Long rest** Reset when the long rest button is pushed
|
||||
- **Short rest** Reset when either the long or short rest button is pushed
|
||||
33
app/private/docs/property/attribute-damage.md
Normal file
33
app/private/docs/property/attribute-damage.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# Attribute Damage
|
||||
|
||||
When applied, attribute damage reduces the value of the attribute by some amount or set the value of an attribute to some amount. Attribute damage can by applied by actions or triggers.
|
||||
|
||||
Using a negative value to damage an attribute will heal the attribute instead.
|
||||
|
||||
---
|
||||
|
||||
### Attribute
|
||||
|
||||
The variable name of the attribute to target.
|
||||
|
||||
### Amount
|
||||
|
||||
A [computed field](/docs/computed-fields) which determined the amount to damage the attribute or set the attribute's value to.
|
||||
|
||||
### Operation
|
||||
|
||||
- **Damage** Reduce the value of the attribute by the amount, negative values heal the attribute instead
|
||||
- **Set** Set the value of the attribute to the amount
|
||||
|
||||
### Target
|
||||
|
||||
- **Target** Apply the attribute damage to the same target as the action applying this property
|
||||
- **Self** Apply the attribute damage to the creature taking the action
|
||||
|
||||
### Tags
|
||||
|
||||
See [Tags](/docs/tags)
|
||||
|
||||
### Don't show in log
|
||||
|
||||
When this is set, the attribute damage is applied, but does not show in the log.
|
||||
76
app/private/docs/property/attribute.md
Normal file
76
app/private/docs/property/attribute.md
Normal file
@@ -0,0 +1,76 @@
|
||||
# Attribute
|
||||
|
||||
Attributes are the core properties of a DiceCloud creature. Each attribute represents some numerical value of the creature.
|
||||
|
||||
Attributes can be targeted by [effects](/docs/property/effect) which can change their total value in a non-destructive way. For example, if a class level gives you an ability score increase of +2 strength when it is taken, instead of directly editing the strength attribute, you add an effect to the class level that adds 2 to strength. The total value of strength will increase by 2 and it will show a record of that ability score increase and where it came from.
|
||||
|
||||
Attributes, [skills](/docs/properties/skill), and [effects](/docs/property/effect) are the core properties of DiceCloud's creature engine.
|
||||
|
||||
Attributes have the following fields that can be accessed in calculations with `variableName.field`:
|
||||
|
||||
- `.total` The total of the attribute before being damaged
|
||||
- `.damage` the amount of damage the attribute has taken
|
||||
- `.value` The current value of the attribute including damage. `variableName` and `variableName.value` are equivalent.
|
||||
- `.modifier` If the attribute is an ability, this is its roll modifier, eg. `strength.modifier` is +2 when `strength.value` is 14
|
||||
|
||||
---
|
||||
|
||||
### Base value
|
||||
|
||||
This is the starting value of the attribute before it is modified by effects and other properties. Multiple properties can set the base value for a given variable name, when this happens the highest base value is chosen, and then all other effects are applied.
|
||||
|
||||
### Name
|
||||
|
||||
The name of the attribute
|
||||
|
||||
### Variable name
|
||||
|
||||
The name used to refer to the attribute in calculations and by effects. Must start with a letter and be made up of only letters and numbers without spaces, symbols, or punctiation.
|
||||
|
||||
If multiple attributes share a variable name, only the last attribute on the [character tree](/docs/tree) will count as the defining attribute and appear on the sheet.
|
||||
|
||||
### Attribute type
|
||||
|
||||
- **Ability** Ablity scores like Strength, Dexterity, etc. Ability scores get a modifier which can be accessed in calculations as `variableName.modifier`,
|
||||
- **Stat** Any numerical value that appears on the sheet. Speed, armor class.
|
||||
- **Modifier** Any numical value that appears on the sheet with a `+` or `-` sign, eg. Proficiency bonus.
|
||||
- **Hit Dice** Hit dice let you select the appropriate hit dice size. Creatures regain half their total hit dice on long rest.
|
||||
- **Health Bar** Health bars can by made to take or ignore damage in a specified order
|
||||
- **Resource** Rages, sourcery points, things that are spent to use actions.
|
||||
- **Spell Slot** Spell slots have a specific level and are used to cast spells.
|
||||
- **Utility** Utility attributes don't show up anywhere on the sheet, but can still be used for calculations
|
||||
|
||||
### Description
|
||||
|
||||
A detailed description of the attribute.
|
||||
|
||||
Allows [inline calculations](/docs/inline-calculations).
|
||||
|
||||
### Health bar settings
|
||||
|
||||
Health bars can take or ignore damage and healing from applied damage properties targeting a creature. A lower ordered health bar will take damage before a higher ordered one.
|
||||
|
||||
Health bars can also change color depending on their value. At 50%+ full they are their property color, between 50% and 0% they fade from their half-full color to their empty color.
|
||||
|
||||
### Tags
|
||||
|
||||
See [Tags](/docs/tags)
|
||||
|
||||
### Allow decimal values
|
||||
|
||||
If this is set, the attribute will not round-down when its value has a decimal.
|
||||
|
||||
### Can be damaged into negative values
|
||||
|
||||
If this is set the attribute can be damaged past zero into negative values.
|
||||
|
||||
### Can be incremented above total
|
||||
|
||||
If this is set the attribute can have negative damage such that the value exceeds the total. This can be useful if you are using the attribute to count, it can start at zero and be healed upwards to keep count.
|
||||
|
||||
### Reset
|
||||
|
||||
If set, the damage on this attribute is reset to 0 at the appropriate time.
|
||||
|
||||
- **Long rest** Reset when the long rest button is pushed
|
||||
- **Short rest** Reset when either the long or short rest button is pushed
|
||||
24
app/private/docs/property/branch.md
Normal file
24
app/private/docs/property/branch.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# Branches
|
||||
|
||||
Branches are applied by actions, when they are applied they can control which of their immediate children are applied.
|
||||
|
||||
---
|
||||
|
||||
### Branch type
|
||||
|
||||
- **If condition is true** Apply children if the condition (a [computed field](/docs/computed-fields)) resolves to `true` or a non-zero number
|
||||
- **Attack hit** Apply children if the attack roll hit the target
|
||||
- **Attack hit** Apply children if the attack roll missed the target
|
||||
- **Save failed** Apply children if target failed its saving throw
|
||||
- **Save suceeded** Apply children if target made its saving throw
|
||||
- **Apply to each target** Apply children separately to each target
|
||||
- **Random** Apply one of the immediate children at random
|
||||
- **Calculated Index** Use the index (a [computed field](/docs/computed-fields)) to choose which child to apply, starting at 1 for the first child.
|
||||
|
||||
### Tags
|
||||
|
||||
See [Tags](/docs/tags)
|
||||
|
||||
### Don't show in log
|
||||
|
||||
When this is set, the branch is applied, but does not show in the log. This does not prevent its children from appearing in the log.
|
||||
32
app/private/docs/property/remove-buff.md
Normal file
32
app/private/docs/property/remove-buff.md
Normal file
@@ -0,0 +1,32 @@
|
||||
# Remove Buff
|
||||
|
||||
This property can remove a specific buff from a targeted creature.
|
||||
|
||||
### Name
|
||||
|
||||
The name of the property. This shows in the log when the property is applied.
|
||||
|
||||
### Remove parent buff
|
||||
|
||||
When this is set and the property is applied, the property will remove the nearest parent buff. If this property is not the child of any buffs, it will log an error.
|
||||
|
||||
### Remove all
|
||||
|
||||
When this is set, all buffs that match the target tags will be removed from the targeted creature. If not set, only the first buff found with the matching tags will be removed.
|
||||
|
||||
### Target
|
||||
|
||||
- **Target** Matching buffs will be removed from the targeted creature
|
||||
- **Self** Matching buffs will be removed from the creature that applied the action
|
||||
|
||||
### Tags required
|
||||
|
||||
Any buff that has all of the required tags will be removed when the property is applied.
|
||||
|
||||
### Tags
|
||||
|
||||
See [Tags](/docs/tags)
|
||||
|
||||
### Don't show in log
|
||||
|
||||
When this is set, the property is applied, but does not show in the log.
|
||||
Reference in New Issue
Block a user