Added color ring based on proficiency levels for skills and saves (pf2e and dnd5e)

This commit is contained in:
kyamsil
2022-04-08 20:26:33 +01:00
parent ccacd3e26e
commit 4d320a5f6c
10 changed files with 149 additions and 16 deletions

View File

@@ -1,5 +1,12 @@
import {compatibleCore} from "../misc.js";
const proficiencyColors = {
0: "#000000",
0.5: "#804A00",
1: "#C0C0C0",
2: "#FFD700"
}
export class dnd5e{
constructor(){
@@ -202,4 +209,19 @@ export class dnd5e{
rollItem(item) {
return item.roll()
}
/**
* Ring Colors
*/
getSkillRingColor(token, skill) {
const profLevel = token.actor.data.data?.skills[skill]?.proficient;
if (profLevel == undefined) return;
return proficiencyColors?.[profLevel];
}
getSaveRingColor(token, save) {
const profLevel = token.actor.data.data?.abilities[save]?.proficient;
if (profLevel == undefined) return;
return proficiencyColors?.[profLevel];
}
}