ENH: Blind attack roll

master
U~man 2020-07-31 11:30:55 +02:00
parent 1eaf480c5b
commit 3df063c2a9
2 changed files with 33 additions and 20 deletions

View File

@ -83,7 +83,10 @@ export class OseDice {
if (["gmroll", "blindroll"].includes(rollMode))
chatData["whisper"] = ChatMessage.getWhisperRecipients("GM");
if (rollMode === "selfroll") chatData["whisper"] = [game.user._id];
if (rollMode === "blindroll") chatData["blind"] = true;
if (rollMode === "blindroll") {
chatData["blind"] = true;
data.roll.blindroll = true;
}
templateData.result = OseDice.digestResult(data, roll);
@ -190,10 +193,18 @@ export class OseDice {
let rollMode = game.settings.get("core", "rollMode");
rollMode = form ? form.rollMode.value : rollMode;
// Force blind roll (ability formulas)
if (data.roll.blindroll) {
rollMode = game.user.isGM ? "selfroll" : "blindroll";
}
if (["gmroll", "blindroll"].includes(rollMode))
chatData["whisper"] = ChatMessage.getWhisperRecipients("GM");
if (rollMode === "selfroll") chatData["whisper"] = [game.user._id];
if (rollMode === "blindroll") chatData["blind"] = true;
if (rollMode === "blindroll") {
chatData["blind"] = true;
data.roll.blindroll = true;
}
templateData.result = OseDice.digestAttackResult(data, roll);

View File

@ -1,5 +1,5 @@
<div class="ose chat-card item-card" data-actor-id="{{data.actor._id}}" data-item-id="{{data.item._id}}"
{{#if tokenId}}data-token-id="{{tokenId}}"{{/if}}>
{{#if tokenId}}data-token-id="{{tokenId}}" {{/if}}>
<div class="ose chat-block">
<div class="flexrow chat-header">
<div class="chat-title">
@ -16,6 +16,7 @@
vs {{result.victim}}
</div>
{{/if}}
<div class="blindable" data-blind="{{data.roll.blindroll}}">
<div class="chat-details">
<div class="roll-result">{{{result.details}}}</div>
</div>
@ -34,4 +35,5 @@
{{/if}}
{{/if}}
</div>
</div>
</div>