Roll Mod - 0.1.4

Creature abilities now properly support the 'Roll' field.
This commit is contained in:
Martin Jencka
2021-02-19 10:15:30 -07:00
parent 945fa7ee41
commit 7ce819bbbf
3 changed files with 18 additions and 2 deletions
+15
View File
@@ -527,12 +527,27 @@ export class MothershipActor extends Actor {
if (!item.name && isNaN(itemName))
itemName = item.charAt(0)?.toUpperCase() + item.toLowerCase().slice(1);
var rollInsert = '';
if(item.data.roll){
let r = new Roll(item.data.roll, {});
r.roll();
rollInsert = '\
<div class="rollh2" style="text-transform: lowercase;">'+item.data.roll+'</div>\
<div class="roll-grid">\
<div class="roll-result">'+r._total+'</div>\
</div>';
}
var templateData = {
actor: this,
stat: {
name: itemName.toUpperCase()
},
item: item,
insert: rollInsert,
onlyDesc: true,
};
+2 -2
View File
@@ -2,9 +2,9 @@
"name": "mosh",
"title": "MoSh - Unofficial Mothership",
"description": "The unofficial Mothership system for FoundryVTT.",
"version": "0.1.3c",
"version": "0.1.4",
"minimumCoreVersion": "0.7.0",
"compatibleCoreVersion": "0.7.7",
"compatibleCoreVersion": "0.7.9",
"templateVersion": 2,
"author": "Futilrevenge",
"esmodules": ["module/mosh.js"],
+1
View File
@@ -10,6 +10,7 @@
</div>
<div style="text-align: right"><img class="roll-image" src="{{item.img}}" title="{{item.name}}" /></div>
</div>
{{{insert}}}
<div class="description">
<div class="body">{{{item.data.description}}}</div>
<br />