give luck roll modifier on shift click

This commit is contained in:
TheLastScrub
2021-06-05 19:04:29 -07:00
parent 0da115054e
commit d23c5cafcb
2 changed files with 31 additions and 18 deletions
+5 -3
View File
@@ -1,14 +1,16 @@
## Release/Patch Notes
### Verion 1.0.0 - 2021-06-03 [BREAKING CHANGE: COMPATIBILE WITH FOUNDRY 0.8.6 OR HIGHER ONLY!]
### Verion 1.0.0 - 2021-06-03 [BREAKING CHANGE: THIS VERSION FORWARD COMPATIBILE WITH FOUNDRY 0.8.6 OR HIGHER ONLY!!!]
* Changes to support 0.8.6+ Foundry
* Revamped data model for actor sheet. Note due to the changes, the new system is not backwards compatible with older versions of Foundry now.
* Rolls all asynchronous now. Should allow less work to be required in future versions when asynchronous rolls are required.
* Enhancement - Added option to choose roll mode in the roll modifier dialogue for both percentile/lethality tests and damage rolls.
* Enhancement - Based on a character's strength, formula will automatically adjust for Melee and Unarmed damage rolls per the rules on page 55 of the Agent's Handbook (+1 for 13-16 STR, etc...). Some adjustment to damage formulas on existing weapons may need to be made if it was manually added already.
* Enhancement - Changed d100 Roll Modifier dialogue to have a +/- dropdown instead of needing to type it into the box.
* Enhancement - Added a descriptor field, 'Relationship' to bonds, so you can give a name, and then the relationship as two separate fields.
* Enhancement - More CSS Improvements
* Enhancement - Can now SHIFT+CLICK to get the Roll Modifier Dialogue for LUCK rolls. Cannot seem to make it feasible to get the right-click option to work on the menu currently.
* Enhancement - Added a descriptor field, 'Relationship' to bonds, so you can give a name, and then the relationship as two separate fields. Makes discerning who is who on the bonds sheet easier at a glance.
* Enhancement - More CSS Improvements, mostly to Item Sheets.
* Cleaned up layout on bonds, armor, weapons, gear item sheets
* Made weapons, armor and gear Item Sheets slightly more uniform in how the same fields are laid out.
+26 -15
View File
@@ -82,6 +82,7 @@ export class DeltaGreenActorSheet extends ActorSheet {
let buttons = super._getHeaderButtons();
let label = "Roll Luck";
let label2 = "Luck";
try{
label = game.i18n.translations.DG.RollLuck;
label2 = game.i18n.translations.DG.Luck;
@@ -90,25 +91,35 @@ export class DeltaGreenActorSheet extends ActorSheet {
ui.notifications.warn('Missing translation key for either DG.RollLuck or DG.Luck key.')
}
buttons = [
{
label: label,
class: "test-extra-icon",
icon: "fas fa-dice",
onclick: (ev) => sendPercentileTestToChat(this.actor, label2, 50)
}].concat(buttons);
//buttons = [
// {
// label: "Active Effect",
// class: "test-extra-icon",
// icon: "fas fa-bolt",
// onclick: (ev) => this.activeEffectTest(this)
// }].concat(buttons);
buttons = [{
label: label,
class: "test-extra-icon",
icon: "fas fa-dice",
onclick: (ev) => this.luckRollOnClick(ev, this.actor, label2)
}].concat(buttons);
return buttons;
}
// This only exists to give a chance to activate the modifier dialogue if desired
// Cannot seem to trigger the event on a right-click, so unfortunately only applies to a shift-click currently.
luckRollOnClick(event, actor, label){
if(event && event.which === 2){
// probably don't want rolls to trigger from a middle mouse click so just kill it here
return;
}
let requestedModifyRoll = (event && event.shiftKey || event.which === 3);
let target = 50;
if(requestedModifyRoll){
showModifyPercentileTestDialogue(actor, label, target, false);
}
else{
sendPercentileTestToChat(actor, label, target, game.settings.get("core", "rollMode"));
}
}
activeEffectTest(sheet){
console.log(sheet.actor.uuid);
let owner = sheet.actor;