Compact Character View by @Greven145 #163
sigrunixia
started this conversation in
Show and tell
Replies: 1 comment
-
|
Hi. I'm really new to all this stuff so excuse my ignorance but I notice that in the stat blocks its registering pluses towards your attributes and i cant figure out where this comes from. I am trying to make a template so I can quickly make character blocks for my players so i want to make sure my info is as accurate as possible. Thank you. (Edit): I figured it out and I feel goofy for not realizing that those are the ability score modifiers. I am tracking now. Thank you. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This thread is for @Greven145 and their Compact Character View Statblock.
I wanted a very compact view of my character that I could just keep in a vertical stack in a vertically split pane. The stats are still a little big I think.
The JSON for the template and a sample statblock with preview below.
{"blocks":[{"type":"group","id":"99293949a878","properties":[],"nested":[{"type":"inline","id":"5ae9bbd85bda","properties":[],"hasRule":false,"nested":[{"type":"group","id":"b8d989194829","properties":[],"nested":[{"type":"heading","id":"6a4818784999","properties":["name"],"fallback":"-","conditioned":true},{"type":"subheading","id":"19788b1b8a4b","properties":["race","subtype","class","alignment"],"conditioned":true},{"type":"property","id":"c9f81beaa978","properties":[],"fallback":"-","callback":"let output = \"\";\nlet icons = {\n\t\"ac\": 0x26E8,\n\t\"hp\": 0x1F5A4,\n\t\"speed\": 0x1F97E,\n\t\"Perception\": 0x1F440,\n\t\"Investigation\": 0x1F50E,\n\t\"Insight\": 0x1F4A1,\n}\nlet statWithIcon = (targetStat, substat) => {\n\tif (targetStat == undefined || targetStat in monster === false) {\n\t\treturn \"\";\n\t}\n\t\n\tlet stat = monster[targetStat];\n\tlet icon = icons[targetStat];\n\tif ( substat !== undefined && substat in stat ){\n\t\tstat = stat[substat];\n\t\ticon = icons[substat];\n\t}\n\treturn `${String.fromCodePoint(icon)}${stat} `;\n}\noutput += statWithIcon(\"ac\");\noutput += statWithIcon(\"hp\");\noutput += statWithIcon(\"speed\");\noutput += statWithIcon(\"passives\", \"Perception\");\noutput += statWithIcon(\"passives\", \"Investigation\");\noutput += statWithIcon(\"passives\", \"Insight\");\nreturn output.trim();","display":" "}]},{"type":"image","id":"3bba8b8b0849","properties":["image"],"fallback":"-","conditioned":true}]},{"type":"property","id":"eb590b794afa","properties":[""],"fallback":"-","callback":"let getMod = (statVal) => {\n let mod = Math.floor(((statVal ?? 10) - 10) / 2);\n return `${mod > 0 ? \"+\" : mod < 0 ? \"-\" : \"\"}${Math.abs(mod)}`;\n}\n\nlet output = \"\";\nlet labels = [\"Str\",\"Dex\",\"Con\",\"Int\",\"Wis\",\"Cha\"];\nif (\"stats\" in monster) {\n let stats = monster.stats;\n for ( let x = 0; x < stats.length; x++){\n let stat = stats[x];\n let label = labels[x];\n let mod = getMod(stat);\n output += `${label}: ${stat} (${mod}) `;\n }\n return output.trim();\n}\nreturn \"\";","conditioned":false,"display":" ","markdown":false,"dice":false}]},{"type":"inline","id":"28dbfa9a199b","properties":[],"nested":[{"type":"saves","id":"684a1878690a","properties":["saves"],"fallback":"-","conditioned":true},{"type":"property","id":"e81b68d87929","properties":["damage_immunities"],"fallback":"-","display":"Immun","conditioned":true},{"type":"property","id":"799a6b18598a","properties":["condition_immunities"],"fallback":"-","display":" ","conditioned":true},{"type":"property","id":"6b4a1b2af8d9","properties":["damage_resistances"],"fallback":"-","display":"Resist","conditioned":true},{"type":"property","id":"49eab86929fb","properties":["damage_vulnerabilities"],"fallback":"-","display":"Vuln","conditioned":true}]},{"type":"inline","id":"696aea68d918","properties":[],"nested":[{"type":"property","id":"5ba93b3bdbdb","properties":["languages"],"fallback":"-","display":"Languages","conditioned":true},{"type":"property","id":"5b0a98581ae9","properties":["senses"],"fallback":"-","display":"Senses","conditioned":true}]}],"name":"Player"}Original Link: #41 (comment)
Beta Was this translation helpful? Give feedback.
All reactions