From 7ce819bbbf787dba29183ff7637fb0812ed30b2a Mon Sep 17 00:00:00 2001 From: Martin Jencka Date: Fri, 19 Feb 2021 10:15:30 -0700 Subject: [PATCH] Roll Mod - 0.1.4 Creature abilities now properly support the 'Roll' field. --- module/actor/actor.js | 15 +++++++++++++++ system.json | 4 ++-- templates/chat/statroll.html | 1 + 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/module/actor/actor.js b/module/actor/actor.js index ad7d814..dabd937 100644 --- a/module/actor/actor.js +++ b/module/actor/actor.js @@ -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 = '\ +
'+item.data.roll+'
\ +
\ +
'+r._total+'
\ +
'; + } + var templateData = { actor: this, stat: { name: itemName.toUpperCase() }, item: item, + insert: rollInsert, onlyDesc: true, }; diff --git a/system.json b/system.json index 8459d49..9452d9f 100644 --- a/system.json +++ b/system.json @@ -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"], diff --git a/templates/chat/statroll.html b/templates/chat/statroll.html index 00f2413..d2cc8a0 100644 --- a/templates/chat/statroll.html +++ b/templates/chat/statroll.html @@ -10,6 +10,7 @@
+ {{{insert}}}
{{{item.data.description}}}