Skip to content

Commit

Permalink
fix: added decimal versions of crs
Browse files Browse the repository at this point in the history
  • Loading branch information
valentine195 committed Dec 16, 2021
1 parent 310cf98 commit 18307be
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions src/data/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,9 @@ export const Statblock5e: StatblockItem[] = [
display: "Challenge",
properties: ["cr"],
callback: `if ("cr" in monster && monster.cr in plugin.CR) {
return \`\${monster.cr} (\${plugin.CR[
return \`\${plugin.CR[
monster.cr
].cr} (\${plugin.CR[
monster.cr
].xp.toLocaleString()} XP)\`;
}
Expand All @@ -276,9 +278,9 @@ return "";`
id: nanoid(),
display: "Proficiency Bonus",
properties: ["cr"],
callback: `if ("cr" in monster) {
callback: `if ("cr" in monster && monster.cr in plugin.CR) {
return \`+\${Math.floor(
2 + (plugin.CR[monster.cr].value - 1) / 4
2 + ((plugin.CR[monster.cr]?.value ?? 0) - 1) / 4
)}\`;
}
return "";`
Expand Down Expand Up @@ -366,6 +368,22 @@ export const CR: { [key: string]: CR } = {
value: 0.5,
xp: 100
},
"0.125": {
cr: "1/8",
value: 0.125,
xp: 25
},
"0.25": {
cr: "1/4",

value: 0.25,
xp: 50
},
"0.5": {
cr: "1/2",
value: 0.5,
xp: 100
},
"1": {
cr: "1",
value: 1,
Expand Down

0 comments on commit 18307be

Please sign in to comment.