ENH: Blind attack roll
							parent
							
								
									1eaf480c5b
								
							
						
					
					
						commit
						3df063c2a9
					
				|  | @ -83,7 +83,10 @@ export class OseDice { | ||||||
|     if (["gmroll", "blindroll"].includes(rollMode)) |     if (["gmroll", "blindroll"].includes(rollMode)) | ||||||
|       chatData["whisper"] = ChatMessage.getWhisperRecipients("GM"); |       chatData["whisper"] = ChatMessage.getWhisperRecipients("GM"); | ||||||
|     if (rollMode === "selfroll") chatData["whisper"] = [game.user._id]; |     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); |     templateData.result = OseDice.digestResult(data, roll); | ||||||
| 
 | 
 | ||||||
|  | @ -190,10 +193,18 @@ export class OseDice { | ||||||
|     let rollMode = game.settings.get("core", "rollMode"); |     let rollMode = game.settings.get("core", "rollMode"); | ||||||
|     rollMode = form ? form.rollMode.value : 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)) |     if (["gmroll", "blindroll"].includes(rollMode)) | ||||||
|       chatData["whisper"] = ChatMessage.getWhisperRecipients("GM"); |       chatData["whisper"] = ChatMessage.getWhisperRecipients("GM"); | ||||||
|     if (rollMode === "selfroll") chatData["whisper"] = [game.user._id]; |     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); |     templateData.result = OseDice.digestAttackResult(data, roll); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,5 +1,5 @@ | ||||||
| <div class="ose chat-card item-card" data-actor-id="{{data.actor._id}}" data-item-id="{{data.item._id}}" | <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="ose chat-block"> | ||||||
|         <div class="flexrow chat-header"> |         <div class="flexrow chat-header"> | ||||||
|             <div class="chat-title"> |             <div class="chat-title"> | ||||||
|  | @ -16,22 +16,24 @@ | ||||||
|             vs {{result.victim}} |             vs {{result.victim}} | ||||||
|         </div> |         </div> | ||||||
|         {{/if}} |         {{/if}} | ||||||
|         <div class="chat-details"> |         <div class="blindable" data-blind="{{data.roll.blindroll}}"> | ||||||
|             <div class="roll-result">{{{result.details}}}</div> |             <div class="chat-details"> | ||||||
|  |                 <div class="roll-result">{{{result.details}}}</div> | ||||||
|  |             </div> | ||||||
|  |             {{#if rollOSE}}<div>{{{rollOSE}}}</div>{{/if}} | ||||||
|  |             {{#if result.isSuccess}} | ||||||
|  |             <div class="chat-details"> | ||||||
|  |                 <div class="roll-result"><b>{{localize 'OSE.messages.InflictsDamage'}}</b></div> | ||||||
|  |             </div> | ||||||
|  |             <div class="damage-roll">{{{rollDamage}}}</div> | ||||||
|  |             {{#if data.roll.save}} | ||||||
|  |             <div class="card-buttons"> | ||||||
|  |                 <button data-action="save" data-save="{{data.roll.save}}" disabled> | ||||||
|  |                     {{lookup config.saves_long data.roll.save}} - {{localize "OSE.spells.Save"}} | ||||||
|  |                 </button> | ||||||
|  |             </div> | ||||||
|  |             {{/if}} | ||||||
|  |             {{/if}} | ||||||
|         </div> |         </div> | ||||||
|         {{#if rollOSE}}<div>{{{rollOSE}}}</div>{{/if}} |  | ||||||
|         {{#if result.isSuccess}} |  | ||||||
|         <div class="chat-details"> |  | ||||||
|             <div class="roll-result"><b>{{localize 'OSE.messages.InflictsDamage'}}</b></div> |  | ||||||
|         </div> |  | ||||||
|         <div class="damage-roll">{{{rollDamage}}}</div> |  | ||||||
|         {{#if data.roll.save}} |  | ||||||
|         <div class="card-buttons"> |  | ||||||
|             <button data-action="save" data-save="{{data.roll.save}}" disabled> |  | ||||||
|                 {{lookup config.saves_long data.roll.save}} - {{localize "OSE.spells.Save"}} |  | ||||||
|             </button> |  | ||||||
|         </div> |  | ||||||
|         {{/if}} |  | ||||||
|         {{/if}} |  | ||||||
|     </div> |     </div> | ||||||
| </div> | </div> | ||||||
		Loading…
	
		Reference in New Issue