Skip to content

Commit

Permalink
Roll Mod - 0.1.4
Browse files Browse the repository at this point in the history
Creature abilities now properly support the 'Roll' field.
  • Loading branch information
Futil committed Feb 19, 2021
1 parent 945fa7e commit 7ce819b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
15 changes: 15 additions & 0 deletions module/actor/actor.js
Expand Up @@ -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,
};

Expand Down
4 changes: 2 additions & 2 deletions system.json
Expand Up @@ -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"],
Expand Down
1 change: 1 addition & 0 deletions templates/chat/statroll.html
Expand Up @@ -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 />
Expand Down

0 comments on commit 7ce819b

Please sign in to comment.