-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
13 changed files
with
616 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"tabWidth": 4, | ||
"useTabs": false, | ||
"semi": true, | ||
"trailingComma": "all" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
# Classless Skill Tree 5E | ||
*`classless-skill-tree-5e`* | ||
|
||
An attempt at a classless skill tree Foundry addon module for DnD 5E inspired by [The Ugly Goblin](https://www.youtube.com/@TheUglyGoblin). | ||
Plans to provide tools for GMs to create their own skill trees or recreate existing ones, and for these skill trees to be added to and/or replacing character sheets. | ||
If given permission, will also include The Ugly Goblin's skill trees as presets. | ||
An attempt at a classless skill tree Foundry addon module for DnD 5E inspired by [The Ugly Goblin](https://www.youtube.com/@TheUglyGoblin). | ||
|
||
Plans to provide tools for GMs to create their own skill trees or recreate existing ones, and for these skill trees to be added to and/or replacing character sheets. | ||
|
||
If given permission, will also include The Ugly Goblin's skill trees as presets, but the intent is to be fully compatible with it regardless. | ||
|
||
In the meantime, I recommend giving their explanation video a watch! | ||
[](https://www.youtube.com/watch?v=L7ONm4qYaXI) | ||
|
||
This module is currently in VERY early stages, so for now you will have to manually download it yourself if you want to play around with it. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,40 @@ | ||
{ | ||
"authors": [ | ||
{ | ||
"discord": "Den_drummer", | ||
"flags": {}, | ||
"name": "Den_drummer" | ||
} | ||
], | ||
"compatibility": { | ||
"minimum": "12", | ||
"verified": "12.330" | ||
}, | ||
"description": "An attempt at a classless skill tree addon for 5E inspired by The Ugly Goblin on Youtube.\nPlans to include their skill trees as presets if given permission.", | ||
"documentTypes": {}, | ||
"esmodules": [ | ||
"scripts/Main.js" | ||
], | ||
"id": "classless-skill-tree-5e", | ||
"languages": [ | ||
{ | ||
"lang": "en", | ||
"name": "English", | ||
"path": "languages/en.json" | ||
} | ||
], | ||
"relationships": { | ||
"systems": [ | ||
{ | ||
"compatibility": { | ||
"minimum": "3", | ||
"verified": "3.3.1" | ||
}, | ||
"id": "dnd5e", | ||
"type": "system" | ||
} | ||
] | ||
}, | ||
"styles": [ | ||
"styles/SkillTree.css" | ||
], | ||
"title": "Classless Skill Tree 5e", | ||
"version": "0.0.1" | ||
"authors": [ | ||
{ | ||
"discord": "Den_drummer", | ||
"flags": {}, | ||
"name": "Den_drummer" | ||
} | ||
], | ||
"compatibility": { | ||
"minimum": "12", | ||
"verified": "12.330" | ||
}, | ||
"description": "An attempt at a classless skill tree addon for 5E inspired by The Ugly Goblin on Youtube.\nPlans to include their skill trees as presets if given permission.", | ||
"esmodules": ["scripts/Main.js"], | ||
"id": "classless-skill-tree-5e", | ||
"languages": [ | ||
{ | ||
"lang": "en", | ||
"name": "English", | ||
"path": "languages/en.json", | ||
"flags": {} | ||
} | ||
], | ||
"relationships": { | ||
"systems": [ | ||
{ | ||
"compatibility": { | ||
"minimum": "3", | ||
"verified": "3.3.1" | ||
}, | ||
"id": "dnd5e", | ||
"type": "system" | ||
} | ||
] | ||
}, | ||
"styles": ["styles/SkillTree.css"], | ||
"title": "Classless Skill Tree 5e", | ||
"version": "0.0.2", | ||
"url": "https://github.com/DenDrummer/classless-skill-tree-5e" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/** | ||
* A class representing the Classless Skill Tree 5E module | ||
* @typedef {Object} ClasslessSkillTree5E | ||
* @property {string} ID the full ID, used e.g. for Foundry | ||
* @property {string} SHORT_ID the short ID, used e.g. for logging | ||
* @property {Object} FLAGS (needed for Foundry?) | ||
* @property {Object} TEMPLATES (needed for Foundry?) | ||
*/ | ||
export class ClasslessSkillTree5E { | ||
static ID = "classless-skill-tree-5e"; | ||
static SHORT_ID = "CST5E"; | ||
|
||
static FLAGS = {}; | ||
|
||
static TEMPLATES = {}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,59 @@ | ||
import { ClasslessSkillTree5E } from "./ClassLessSkillTree.js"; | ||
import { RequiredSkill } from "./RequiredSkill.js"; | ||
import { SkillNode } from "./SkillNode.js"; | ||
import { SkillRequirement } from "./SkillRequirement.js"; | ||
import { SkillTree } from "./SkillTree.js"; | ||
import { SkillTreeUtils } from "./SkillTreeUtils.js"; | ||
|
||
SkillTreeUtils.log(false, "Main Loaded!"); | ||
|
||
console.log("CST5E | Main Loaded!"); | ||
Hooks.once("devModeReady", ({ registerPackageDebugFlag }) => { | ||
SkillTreeUtils.log(false, "Dev Mode Ready"); | ||
registerPackageDebugFlag(ClasslessSkillTree5E.ID); | ||
}); | ||
|
||
Hooks.on("init", () => { | ||
console.log("CST5E | Main Initialized!"); | ||
// Object.assign(CONFIG.JournalEntryPage.dataModels, { | ||
// "classless-skill-tree-5e": SkillTree | ||
// }); | ||
SkillTreeUtils.log(false, "Main Initialized!"); | ||
}); | ||
|
||
Hooks.on("init", () => { | ||
console.log("CST5E | Main Available!"); | ||
|
||
console.log(new SkillTree()); | ||
Hooks.on("ready", () => { | ||
SkillTreeUtils.log(false, "Main Available!"); | ||
|
||
const testSkillNode = new SkillNode( | ||
"TestNode", | ||
"Test Node", | ||
"This is a test node to see if the Skill Node class works.", | ||
"#FFFFFF", | ||
0, | ||
0, | ||
[] | ||
); | ||
|
||
const testDependentNode = new SkillNode( | ||
"DependentNode", | ||
"Dependent Node", | ||
"This is a test node to see if Skill Node requirements work", | ||
"#FFFFFF", | ||
100, | ||
0, | ||
[ | ||
new SkillRequirement("OR", [ | ||
new RequiredSkill(testSkillNode, 1, "<="), | ||
]), | ||
] | ||
); | ||
|
||
const testSkillTree = new SkillTree( | ||
"Test Tree", | ||
"This is a test to see if the Skill Tree class works.", | ||
[testSkillNode, testDependentNode] | ||
); | ||
|
||
const errorMessages = testSkillTree.validateTree(); | ||
if (errorMessages.length > 0) { | ||
SkillTreeUtils.log(false, "Errors found in the Skill Tree:"); | ||
errorMessages.forEach((errorMsg) => { | ||
console.warn(`CST5E | ${errorMsg}`); | ||
}); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { SkillRequirement } from "./SkillRequirement.js"; | ||
|
||
/** | ||
* A class representing a group of requirements of which the specified amount is required to unlock the parent item. | ||
* @typedef {Object} MultiSkillRequirement | ||
* @property {Array<RequiredSkill|SkillRequirement>} requiredItems An array of required items. \ | ||
* These items are either a {@link SkillNode} or a {@link RequiredSkill}. \ | ||
* This list must contain at least one valid item to be valid. | ||
* @property {number} requiredNumber The number of these items required to unlock the parent item. | ||
*/ | ||
export class MultiSkillRequirement extends SkillRequirement { | ||
/** | ||
* Create a requirement group | ||
* @param {Array<RequiredSkill|SkillRequirement>} requiredItems An array of required items. \ | ||
* These items are either a {@link SkillNode} or a {@link RequiredSkill}. \ | ||
* This list must contain at least one valid item to be valid. | ||
* @param {number} requiredNumber The number of these items required to unlock the parent item. \ | ||
* Default: 1 | ||
*/ | ||
constructor(requiredItems, requiredNumber = 1) { | ||
this.requiredNumber = requiredNumber; | ||
this.requiredItems = requiredItems; | ||
|
||
SkillTreeUtils.log(false, "MultiSkillRequirement created"); | ||
console.log(this); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { SkillNode } from "./SkillNode.js"; | ||
|
||
/** | ||
* A class representing a skill being required and at what level(s) the requirement is met. | ||
* @typedef {Object} RequiredSkill | ||
* @property {SkillNode} skill The {@link SkillNode} that is being depended on. | ||
* @property {number} requiredLevel The level the required skill is being compared to. \ | ||
* Default: 1 | ||
* @property {"<" | "<=" | "==" | ">=" | ">"} requirementType How the current level of the required skill is compared to the required level of said skill. \ | ||
* Default: "<=" | ||
* @property {boolean} drawLine Whether to draw the line of this node to the required node. \ | ||
* Default: true | ||
*/ | ||
export class RequiredSkill { | ||
/** | ||
* Create a dependency on a {@link SkillNode} and define at which level(s) this requirement is met. | ||
* @param {SkillNode} skill The {@link SkillNode} that is being depended on. | ||
* @param {number} requiredLevel The level the required skill is being compared to. \ | ||
* Defaults: 1 | ||
* @param {"<" | "<=" | "==" | ">=" | ">"} requirementType How the current level of the required skill is compared to the required level of said skill. \ | ||
* Default: "<=" | ||
* @param {boolean} drawLine Whether to draw the line of this node to the required node. \ | ||
* Default: true | ||
*/ | ||
constructor( | ||
skill, | ||
requiredLevel = 1, | ||
requirementType = "<=", | ||
drawLine = true, | ||
) { | ||
/** @type {SkillNode} */ | ||
this.skill = skill; | ||
/** @type {number} */ | ||
this.requiredLevel = requiredLevel; | ||
/** @type {"<" | "<=" | "==" | ">=" | ">"} */ | ||
this.requirementType = requirementType; | ||
/** @type {boolean} */ | ||
this.drawLine = drawLine; | ||
|
||
SkillTreeUtils.log(false, "RequiredSkill created"); | ||
console.log(this); | ||
} | ||
} |
Oops, something went wrong.