diff --git a/index.js b/index.js index 889c06d..2b2ff78 100644 --- a/index.js +++ b/index.js @@ -1,3 +1,3 @@ /*! For license information please see index.js.LICENSE.txt */ -(()=>{"use strict";var t={d:(r,a)=>{for(var i in a)t.o(a,i)&&!t.o(r,i)&&Object.defineProperty(r,i,{enumerable:!0,get:a[i]})},o:(t,r)=>Object.prototype.hasOwnProperty.call(t,r)};function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}function _createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();return c=t.done,t},e:function e(t){u=!0,l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],d=!0,p=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;d=!1}else for(;!(d=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);d=!0);}catch(t){p=!0,o=t}finally{try{if(!d&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(p)throw o}}return u}}(t,r)||_unsupportedIterableToArray(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _toConsumableArray(t){return function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}(t)||function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||_unsupportedIterableToArray(t)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a=0;--i){var o=this.tryEntries[i],l=o.completion;if("root"===o.tryLoc)return handle("end");if(o.tryLoc<=this.prev){var c=a.call(o,"catchLoc"),u=a.call(o,"finallyLoc");if(c&&u){if(this.prev=0;--i){var o=this.tryEntries[i];if(o.tryLoc<=this.prev&&a.call(o,"finallyLoc")&&this.prev=0;--r){var a=this.tryEntries[r];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),resetTryEntry(a),d}},catch:function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc===t){var i=a.completion;if("throw"===i.type){var o=i.arg;resetTryEntry(a)}return o}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(t,r,a){return this.delegate={iterator:values(t),resultName:r,nextLoc:a},"next"===this.method&&(this.arg=void 0),d}},t}function asyncGeneratorStep(t,r,a,i,o,l,c){try{var u=t[l](c),d=u.value}catch(t){return void a(t)}u.done?r(d):Promise.resolve(d).then(i,o)}function _asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(i,o){var l=t.apply(r,a);function _next(t){asyncGeneratorStep(l,i,o,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(l,i,o,_next,_throw,"throw",t)}_next(void 0)}))}}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var a=0;aa});var r={};function initConfig(){Hooks.on("argonInit",(function(t){var i;if("dnd5e"===game.system.id){!function registerItems(){r[game.i18n.localize("enhancedcombathud-dnd5e.items.disengage.name")]={name:game.i18n.localize("enhancedcombathud-dnd5e.items.disengage.name"),type:"feat",img:"modules/enhancedcombathud/icons/journey.webp",system:{type:{value:"",subtype:""},description:{value:game.i18n.localize("enhancedcombathud-dnd5e.items.disengage.desc"),chat:"",unidentified:""},source:"",quantity:1,weight:0,price:0,attuned:!1,attunement:0,equipped:!1,rarity:"",identified:!0,activation:{type:"action",cost:1,condition:""},duration:{value:1,units:"turn"},target:{value:null,width:null,units:"",type:"self"},range:{value:null,long:null,units:""},consume:{type:"",target:"",amount:null},ability:"",actionType:"util",attackBonus:0,chatFlavor:"",critical:null,damage:{parts:[],versatile:""},formula:"",save:{ability:"",dc:null,scaling:"spell"}},sort:0,flags:{core:{sourceId:"Item.wyQkeuZkttllAFB1"},"midi-qol":{onUseMacroName:""}}},r[game.i18n.localize("enhancedcombathud-dnd5e.items.dodge.name")]={name:game.i18n.localize("enhancedcombathud-dnd5e.items.dodge.name"),type:"feat",img:"modules/enhancedcombathud/icons/armor-upgrade.webp",system:{type:{value:"",subtype:""},description:{value:game.i18n.localize("enhancedcombathud-dnd5e.items.dodge.desc"),chat:"",unidentified:""},source:"",quantity:1,weight:0,price:0,attuned:!1,attunement:0,equipped:!1,rarity:"",identified:!0,activation:{type:"action",cost:1,condition:""},duration:{value:1,units:"round"},target:{value:null,width:null,units:"",type:"self"},range:{value:null,long:null,units:""},consume:{type:"",target:"",amount:null},ability:"",actionType:"util",attackBonus:0,chatFlavor:"",critical:null,damage:{parts:[],versatile:""},formula:"",save:{ability:"",dc:null,scaling:"spell"},consumableType:"trinket"},sort:0,flags:{"midi-qol":{onUseMacroName:""}}},r[game.i18n.localize("enhancedcombathud-dnd5e.items.ready.name")]={name:game.i18n.localize("enhancedcombathud-dnd5e.items.ready.name"),type:"feat",img:"modules/enhancedcombathud/icons/clockwork.webp",system:{type:{value:"",subtype:""},description:{value:game.i18n.localize("enhancedcombathud-dnd5e.items.ready.desc"),chat:"",unidentified:""},source:"",quantity:1,weight:0,price:0,attuned:!1,attunement:0,equipped:!1,rarity:"",identified:!0,activation:{type:"action",cost:1,condition:""},duration:{value:null,units:""},target:{value:null,width:null,units:"",type:"self"},range:{value:null,long:null,units:""},consume:{type:"",target:"",amount:null},ability:"",actionType:"util",attackBonus:0,chatFlavor:"",critical:null,damage:{parts:[],versatile:""},formula:"",save:{ability:"",dc:null,scaling:"spell"},consumableType:"trinket"},sort:0,flags:{"midi-qol":{onUseMacroName:""}}},r[game.i18n.localize("enhancedcombathud-dnd5e.items.hide.name")]={name:game.i18n.localize("enhancedcombathud-dnd5e.items.hide.name"),type:"feat",img:"modules/enhancedcombathud/icons/cloak-dagger.webp",system:{type:{value:"",subtype:""},description:{value:game.i18n.localize("enhancedcombathud-dnd5e.items.hide.desc"),chat:"",unidentified:""},source:"",quantity:1,weight:0,price:0,attuned:!1,attunement:0,equipped:!1,rarity:"",identified:!0,activation:{type:"action",cost:1,condition:""},duration:{value:null,units:""},target:{value:null,width:null,units:"",type:"self"},range:{value:null,long:null,units:""},consume:{type:"",target:"",amount:null},recharge:{value:null,charged:!1},ability:"",actionType:"util",attackBonus:0,chatFlavor:"",critical:null,damage:{parts:[],versatile:""},formula:"",save:{ability:"",dc:null,scaling:"spell"},consumableType:"trinket"},sort:0,flags:{"midi-qol":{onUseMacroName:""}}},r[game.i18n.localize("enhancedcombathud-dnd5e.items.dash.name")]={name:game.i18n.localize("enhancedcombathud-dnd5e.items.dash.name"),type:"feat",img:"modules/enhancedcombathud/icons/walking-boot.webp",system:{type:{value:"",subtype:""},description:{value:game.i18n.localize("enhancedcombathud-dnd5e.items.dash.desc"),chat:"",unidentified:""},source:"",quantity:1,weight:0,price:0,attuned:!1,attunement:0,equipped:!1,rarity:"",identified:!0,activation:{type:"action",cost:1,condition:""},duration:{value:null,units:""},target:{value:null,width:null,units:"",type:"self"},range:{value:null,long:null,units:""},consume:{type:"",target:"",amount:null},ability:"",actionType:"util",attackBonus:0,chatFlavor:"",critical:null,damage:{parts:[],versatile:""},formula:"",save:{ability:"",dc:null,scaling:"spell"},consumableType:"trinket"},sort:0,flags:{"midi-qol":{onUseMacroName:""}}},r[game.i18n.localize("enhancedcombathud-dnd5e.items.shove.name")]={name:game.i18n.localize("enhancedcombathud-dnd5e.items.shove.name"),type:"feat",img:"modules/enhancedcombathud/icons/shield-bash.webp",system:{type:{value:"",subtype:""},description:{value:game.i18n.localize("enhancedcombathud-dnd5e.items.shove.desc"),chat:"",unidentified:""},source:"",quantity:1,weight:0,price:0,attuned:!1,attunement:0,equipped:!1,rarity:"",identified:!0,activation:{type:"action",cost:1,condition:""},duration:{value:null,units:""},target:{value:1,width:null,units:"",type:"creature"},range:{value:null,long:null,units:"touch"},consume:{type:"",target:"",amount:null},ability:"",actionType:"util",attackBonus:0,chatFlavor:"",critical:null,damage:{parts:[],versatile:""},formula:"",save:{ability:"",dc:null,scaling:"spell"},consumableType:"trinket"},sort:0,flags:{"midi-qol":{onUseMacroName:""}}}}();var o=t.ARGON,l=function(t){_inherits(DND5eTooltip,t);var r=_createSuper(DND5eTooltip);function DND5eTooltip(){return _classCallCheck(this,DND5eTooltip),r.apply(this,arguments)}return _createClass(DND5eTooltip,[{key:"classes",get:function get(){return _get(_getPrototypeOf(DND5eTooltip.prototype),"classes",this).concat(["dnd5e2"])}}]),DND5eTooltip}(o.CORE.Tooltip),c=null===(i=game.modules.get("midi-qol"))||void 0===i?void 0:i.active,u=function getMidiFlag(t){var r,a;return c&&ui.ARGON._actor?null!==(a=(null!==(r=ui.ARGON._actor.getFlag("midi-qol","actions"))&&void 0!==r?r:{})[t])&&void 0!==a&&a?0:1:null},d=function getActivationType(t){var r,a;if(null!=t&&null!==(r=t.system)&&void 0!==r&&r.activities)return null===(a=Array.from(t.system.activities)[0])||void 0===a||null===(a=a.activation)||void 0===a?void 0:a.type},p=function getActionType(t){var r,a;if(null!=t&&null!==(r=t.system)&&void 0!==r&&r.activities)return null===(a=Array.from(t.system.activities)[0])||void 0===a?void 0:a.actionType},h={action:["action"],bonus:["bonus"],reaction:["reaction","reactiondamage","reactionmanual"],free:["special"]},m={spell:["spell"],feat:["feat"],consumable:["consumable","equipment","loot"]},y=[];game.settings.get(a,"showWeaponsItems")&&m.consumable.push("weapon"),game.settings.get(a,"showClassActions")&&y.push("class"),t.DND5E={actionTypes:h,itemTypes:m,mainBarFeatures:y,ECHItems:r},Hooks.callAll("enhanced-combat-hud.dnd5e.initConfig",{actionTypes:h,itemTypes:m,ECHItems:r});var v=function(t){_inherits(DND5ePortraitPanel,t);var r,a,i=_createSuper(DND5ePortraitPanel);function DND5ePortraitPanel(){_classCallCheck(this,DND5ePortraitPanel);for(var t=arguments.length,r=new Array(t),a=0;a=1||a.details.cr<=0?a.details.cr:"1/".concat(1/a.details.cr);return"CR ".concat(d," ").concat(u)}if(o){var p=Object.values(i.classes).map((function(t){return t.name})).join(" / ");return"Level ".concat(a.details.level," ").concat(p," (").concat(a.details.race,")")}return""}},{key:"isDead",get:function get(){return this.isDying&&"character"!==this.actor.type}},{key:"isDying",get:function get(){return this.actor.system.attributes.hp.value<=0}},{key:"successes",get:function get(){var t,r;return null!==(t=null===(r=this.actor.system.attributes)||void 0===r||null===(r=r.death)||void 0===r?void 0:r.success)&&void 0!==t?t:0}},{key:"failures",get:function get(){var t,r;return null!==(t=null===(r=this.actor.system.attributes)||void 0===r||null===(r=r.death)||void 0===r?void 0:r.failure)&&void 0!==t?t:0}},{key:"configurationTemplate",get:function get(){return"modules/enhancedcombathud-dnd5e/templates/argon-actor-config.hbs"}},{key:"_onDeathSave",value:(a=_asyncToGenerator(_regeneratorRuntime().mark((function _callee(t){return _regeneratorRuntime().wrap((function _callee$(t){for(;;)switch(t.prev=t.next){case 0:this.actor.rollDeathSave({});case 1:case"end":return t.stop()}}),_callee,this)}))),function _onDeathSave(t){return a.apply(this,arguments)})},{key:"getStatBlocks",value:(r=_asyncToGenerator(_regeneratorRuntime().mark((function _callee2(){var t,r,a,i,o,l,c,u;return _regeneratorRuntime().wrap((function _callee2$(d){for(;;)switch(d.prev=d.next){case 0:return a=game.i18n.localize("DND5E.HitPoints").split(" ").map((function(t){return t.charAt(0).toUpperCase()})).join(""),i=game.i18n.localize("DND5E.ArmorClass").split(" ").map((function(t){return t.charAt(0).toUpperCase()})).join(""),o=game.i18n.localize("DND5E.SaveDC").replace("{ability}","").replace("{dc}","").trim(),l=this.actor.system.attributes.hp.temp?"#6698f3":"rgb(0 255 170)",c=this.actor.system.attributes.hp.tempmax,u=c?c>0?"rgb(222 91 255)":"#ffb000":"rgb(255 255 255)",d.abrupt("return",[[{text:"".concat(this.actor.system.attributes.hp.value+(null!==(t=this.actor.system.attributes.hp.temp)&&void 0!==t?t:0)),color:l},{text:"/"},{text:"".concat(this.actor.system.attributes.hp.max+(null!==(r=this.actor.system.attributes.hp.tempmax)&&void 0!==r?r:0)),color:u},{text:a}],[{text:i},{text:this.actor.system.attributes.ac.value,color:"var(--ech-movement-baseMovement-background)"}],[{text:o},{text:this.actor.system.attributes.spelldc,color:"var(--ech-movement-baseMovement-background)"}]]);case 7:case"end":return d.stop()}}),_callee2,this)}))),function getStatBlocks(){return r.apply(this,arguments)})}]),DND5ePortraitPanel}(o.PORTRAIT.PortraitPanel),g=function(t){_inherits(DND5eDrawerButton,t);var r,a=_createSuper(DND5eDrawerButton);function DND5eDrawerButton(t,r,i){var o;return _classCallCheck(this,DND5eDrawerButton),(o=a.call(this,t)).item=r,o.type=i,o}return _createClass(DND5eDrawerButton,[{key:"hasTooltip",get:function get(){return!0}},{key:"tooltipOrientation",get:function get(){return TooltipManager.TOOLTIP_DIRECTIONS.RIGHT}},{key:"getTooltipData",value:(r=_asyncToGenerator(_regeneratorRuntime().mark((function _callee3(){var t;return _regeneratorRuntime().wrap((function _callee3$(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,getTooltipDetails(this.item,this.type);case 2:return t=r.sent,r.abrupt("return",t);case 4:case"end":return r.stop()}}),_callee3,this)}))),function getTooltipData(){return r.apply(this,arguments)})}]),DND5eDrawerButton}(o.DRAWER.DrawerButton),b=function(t){_inherits(DND5eDrawerPanel,t);var r=_createSuper(DND5eDrawerPanel);function DND5eDrawerPanel(){_classCallCheck(this,DND5eDrawerPanel);for(var t=arguments.length,a=new Array(t),i=0;i=0?"+".concat(t):t};return[{gridCols:"5fr 2fr 2fr",captions:[{label:"Abilities",align:"left"},{label:"Check",align:"center"},{label:"Save",align:"center"}],align:["left","center","center"],buttons:Object.keys(r).map((function(a){var i=r[a];return new g([{label:CONFIG.DND5E.abilities[a].label,onClick:function onClick(r){return t.actor.rollAbilityCheck({ability:a,event:r})}},{label:o(i.mod+(i.checkBonus||0)),onClick:function onClick(r){return t.actor.rollAbilityCheck({ability:a,event:r})}},{label:o(i.save),onClick:function onClick(r){return t.actor.rollSavingThrow({ability:a,event:r})}}],a,"save")}))},{gridCols:"7fr 2fr",captions:[{label:"Skills"},{label:""}],buttons:Object.keys(a).map((function(r){var i=a[r];return new g([{label:getProficiencyIcon(i.proficient)+CONFIG.DND5E.skills[r].label,onClick:function onClick(a){return t.actor.rollSkill({skill:r,event:a})}},{label:"".concat(o(i.total),'(').concat(i.passive,")"),style:"display: flex; justify-content: flex-end;"}],r,"skill")}))},{gridCols:"7fr 2fr",captions:[{label:"Tools"},{label:""}],buttons:i.map((function(a){return new g([{label:getProficiencyIcon(a.system.proficient)+a.name,onClick:function onClick(t){return a.rollToolCheck({event:t})}},{label:o(r[a.abilityMod].mod+a.system.proficiencyMultiplier*t.actor.system.attributes.prof)}],a)}))}]}},{key:"title",get:function get(){return"".concat(game.i18n.localize("enhancedcombathud-dnd5e.hud.saves.name")," / ").concat(game.i18n.localize("enhancedcombathud-dnd5e.hud.skills.name")," / ").concat(game.i18n.localize("enhancedcombathud-dnd5e.hud.tools.name"))}}]),DND5eDrawerPanel}(o.DRAWER.DrawerPanel),_=function(i){_inherits(DND5eActionActionPanel,i);var l,c=_createSuper(DND5eActionActionPanel);function DND5eActionActionPanel(){_classCallCheck(this,DND5eActionActionPanel);for(var t=arguments.length,r=new Array(t),a=0;a\n\n
\n\n
\n \n
\n ').concat(this.label,'\n \n Feature\n \n
\n \n
\n\n
\n
\n ').concat(this.item.system.description.value,"\n
\n
\n
\n\n\n\n ")});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),_callee18,this)}))),function createChatMessage(){return r.apply(this,arguments)})}]),DND5eSpecialActionButton}(o.MAIN.BUTTONS.ActionButton),O=function(t){_inherits(DND5eMovementHud,t);var r=_createSuper(DND5eMovementHud);function DND5eMovementHud(){var t,a;_classCallCheck(this,DND5eMovementHud);for(var i=arguments.length,o=new Array(i),l=0;l';case"bludgeoning":return'';case"cold":return'';case"fire":return'';case"force":return'';case"lightning":return'';case"necrotic":return'';case"piercing":return'';case"poison":return'';case"psychic":return'';case"radiant":return'';case"slashing":return'';case"thunder":return'';case"healing":return'';default:return""}}function getProficiencyIcon(t){return 0==t?' ':1==t?' ':2==t?' ':.5==t?' ':' '}function condenseItemButtons(t){if(!game.settings.get(a,"condenseClassActions"))return t.map((function(t){return new C({item:t,inActionPanel:!0})}));for(var r=[],i=t.length,l=i-i%2,c=null,u=0;ut.length)&&(r=t.length);for(var a=0,i=new Array(r);a{"use strict";var t={d:(r,a)=>{for(var i in a)t.o(a,i)&&!t.o(r,i)&&Object.defineProperty(r,i,{enumerable:!0,get:a[i]})},o:(t,r)=>Object.prototype.hasOwnProperty.call(t,r)};function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}function _createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();return c=t.done,t},e:function e(t){u=!0,l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],d=!0,p=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;d=!1}else for(;!(d=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);d=!0);}catch(t){p=!0,o=t}finally{try{if(!d&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(p)throw o}}return u}}(t,r)||_unsupportedIterableToArray(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _toConsumableArray(t){return function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}(t)||function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||_unsupportedIterableToArray(t)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a=0;--i){var o=this.tryEntries[i],l=o.completion;if("root"===o.tryLoc)return handle("end");if(o.tryLoc<=this.prev){var c=a.call(o,"catchLoc"),u=a.call(o,"finallyLoc");if(c&&u){if(this.prev=0;--i){var o=this.tryEntries[i];if(o.tryLoc<=this.prev&&a.call(o,"finallyLoc")&&this.prev=0;--r){var a=this.tryEntries[r];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),resetTryEntry(a),d}},catch:function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc===t){var i=a.completion;if("throw"===i.type){var o=i.arg;resetTryEntry(a)}return o}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(t,r,a){return this.delegate={iterator:values(t),resultName:r,nextLoc:a},"next"===this.method&&(this.arg=void 0),d}},t}function asyncGeneratorStep(t,r,a,i,o,l,c){try{var u=t[l](c),d=u.value}catch(t){return void a(t)}u.done?r(d):Promise.resolve(d).then(i,o)}function _asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(i,o){var l=t.apply(r,a);function _next(t){asyncGeneratorStep(l,i,o,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(l,i,o,_next,_throw,"throw",t)}_next(void 0)}))}}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var a=0;aa});var r={};function initConfig(){Hooks.on("argonInit",(function(t){var i;if("dnd5e"===game.system.id){!function registerItems(){r[game.i18n.localize("enhancedcombathud-dnd5e.items.disengage.name")]={name:game.i18n.localize("enhancedcombathud-dnd5e.items.disengage.name"),type:"feat",img:"modules/enhancedcombathud/icons/journey.webp",system:{type:{value:"",subtype:""},description:{value:game.i18n.localize("enhancedcombathud-dnd5e.items.disengage.desc"),chat:"",unidentified:""},source:"",quantity:1,weight:0,price:0,attuned:!1,attunement:0,equipped:!1,rarity:"",identified:!0,activation:{type:"action",cost:1,condition:""},duration:{value:1,units:"turn"},target:{value:null,width:null,units:"",type:"self"},range:{value:null,long:null,units:""},consume:{type:"",target:"",amount:null},ability:"",actionType:"util",attackBonus:0,chatFlavor:"",critical:null,damage:{parts:[],versatile:""},formula:"",save:{ability:"",dc:null,scaling:"spell"}},sort:0,flags:{core:{sourceId:"Item.wyQkeuZkttllAFB1"},"midi-qol":{onUseMacroName:""}}},r[game.i18n.localize("enhancedcombathud-dnd5e.items.dodge.name")]={name:game.i18n.localize("enhancedcombathud-dnd5e.items.dodge.name"),type:"feat",img:"modules/enhancedcombathud/icons/armor-upgrade.webp",system:{type:{value:"",subtype:""},description:{value:game.i18n.localize("enhancedcombathud-dnd5e.items.dodge.desc"),chat:"",unidentified:""},source:"",quantity:1,weight:0,price:0,attuned:!1,attunement:0,equipped:!1,rarity:"",identified:!0,activation:{type:"action",cost:1,condition:""},duration:{value:1,units:"round"},target:{value:null,width:null,units:"",type:"self"},range:{value:null,long:null,units:""},consume:{type:"",target:"",amount:null},ability:"",actionType:"util",attackBonus:0,chatFlavor:"",critical:null,damage:{parts:[],versatile:""},formula:"",save:{ability:"",dc:null,scaling:"spell"},consumableType:"trinket"},sort:0,flags:{"midi-qol":{onUseMacroName:""}}},r[game.i18n.localize("enhancedcombathud-dnd5e.items.ready.name")]={name:game.i18n.localize("enhancedcombathud-dnd5e.items.ready.name"),type:"feat",img:"modules/enhancedcombathud/icons/clockwork.webp",system:{type:{value:"",subtype:""},description:{value:game.i18n.localize("enhancedcombathud-dnd5e.items.ready.desc"),chat:"",unidentified:""},source:"",quantity:1,weight:0,price:0,attuned:!1,attunement:0,equipped:!1,rarity:"",identified:!0,activation:{type:"action",cost:1,condition:""},duration:{value:null,units:""},target:{value:null,width:null,units:"",type:"self"},range:{value:null,long:null,units:""},consume:{type:"",target:"",amount:null},ability:"",actionType:"util",attackBonus:0,chatFlavor:"",critical:null,damage:{parts:[],versatile:""},formula:"",save:{ability:"",dc:null,scaling:"spell"},consumableType:"trinket"},sort:0,flags:{"midi-qol":{onUseMacroName:""}}},r[game.i18n.localize("enhancedcombathud-dnd5e.items.hide.name")]={name:game.i18n.localize("enhancedcombathud-dnd5e.items.hide.name"),type:"feat",img:"modules/enhancedcombathud/icons/cloak-dagger.webp",system:{type:{value:"",subtype:""},description:{value:game.i18n.localize("enhancedcombathud-dnd5e.items.hide.desc"),chat:"",unidentified:""},source:"",quantity:1,weight:0,price:0,attuned:!1,attunement:0,equipped:!1,rarity:"",identified:!0,activation:{type:"action",cost:1,condition:""},duration:{value:null,units:""},target:{value:null,width:null,units:"",type:"self"},range:{value:null,long:null,units:""},consume:{type:"",target:"",amount:null},recharge:{value:null,charged:!1},ability:"",actionType:"util",attackBonus:0,chatFlavor:"",critical:null,damage:{parts:[],versatile:""},formula:"",save:{ability:"",dc:null,scaling:"spell"},consumableType:"trinket"},sort:0,flags:{"midi-qol":{onUseMacroName:""}}},r[game.i18n.localize("enhancedcombathud-dnd5e.items.dash.name")]={name:game.i18n.localize("enhancedcombathud-dnd5e.items.dash.name"),type:"feat",img:"modules/enhancedcombathud/icons/walking-boot.webp",system:{type:{value:"",subtype:""},description:{value:game.i18n.localize("enhancedcombathud-dnd5e.items.dash.desc"),chat:"",unidentified:""},source:"",quantity:1,weight:0,price:0,attuned:!1,attunement:0,equipped:!1,rarity:"",identified:!0,activation:{type:"action",cost:1,condition:""},duration:{value:null,units:""},target:{value:null,width:null,units:"",type:"self"},range:{value:null,long:null,units:""},consume:{type:"",target:"",amount:null},ability:"",actionType:"util",attackBonus:0,chatFlavor:"",critical:null,damage:{parts:[],versatile:""},formula:"",save:{ability:"",dc:null,scaling:"spell"},consumableType:"trinket"},sort:0,flags:{"midi-qol":{onUseMacroName:""}}},r[game.i18n.localize("enhancedcombathud-dnd5e.items.shove.name")]={name:game.i18n.localize("enhancedcombathud-dnd5e.items.shove.name"),type:"feat",img:"modules/enhancedcombathud/icons/shield-bash.webp",system:{type:{value:"",subtype:""},description:{value:game.i18n.localize("enhancedcombathud-dnd5e.items.shove.desc"),chat:"",unidentified:""},source:"",quantity:1,weight:0,price:0,attuned:!1,attunement:0,equipped:!1,rarity:"",identified:!0,activation:{type:"action",cost:1,condition:""},duration:{value:null,units:""},target:{value:1,width:null,units:"",type:"creature"},range:{value:null,long:null,units:"touch"},consume:{type:"",target:"",amount:null},ability:"",actionType:"util",attackBonus:0,chatFlavor:"",critical:null,damage:{parts:[],versatile:""},formula:"",save:{ability:"",dc:null,scaling:"spell"},consumableType:"trinket"},sort:0,flags:{"midi-qol":{onUseMacroName:""}}}}();var o=t.ARGON,l=function(t){_inherits(DND5eTooltip,t);var r=_createSuper(DND5eTooltip);function DND5eTooltip(){return _classCallCheck(this,DND5eTooltip),r.apply(this,arguments)}return _createClass(DND5eTooltip,[{key:"classes",get:function get(){return _get(_getPrototypeOf(DND5eTooltip.prototype),"classes",this).concat(["dnd5e2"])}}]),DND5eTooltip}(o.CORE.Tooltip),c=null===(i=game.modules.get("midi-qol"))||void 0===i?void 0:i.active,u=function getMidiFlag(t){var r,a;return c&&ui.ARGON._actor?null!==(a=(null!==(r=ui.ARGON._actor.getFlag("midi-qol","actions"))&&void 0!==r?r:{})[t])&&void 0!==a&&a?0:1:null},d=function getActivationType(t){var r,a;if(null!=t&&null!==(r=t.system)&&void 0!==r&&r.activities)return null===(a=Array.from(t.system.activities)[0])||void 0===a||null===(a=a.activation)||void 0===a?void 0:a.type},p=function getActionType(t){var r,a;if(null!=t&&null!==(r=t.system)&&void 0!==r&&r.activities)return null===(a=Array.from(t.system.activities)[0])||void 0===a?void 0:a.actionType},h={action:["action"],bonus:["bonus"],reaction:["reaction","reactiondamage","reactionmanual"],free:["special"]},m={spell:["spell"],feat:["feat"],consumable:["consumable","equipment","loot"]},y=[];game.settings.get(a,"showWeaponsItems")&&m.consumable.push("weapon"),game.settings.get(a,"showClassActions")&&y.push("class"),t.DND5E={actionTypes:h,itemTypes:m,mainBarFeatures:y,ECHItems:r},Hooks.callAll("enhanced-combat-hud.dnd5e.initConfig",{actionTypes:h,itemTypes:m,ECHItems:r});var v=function(t){_inherits(DND5ePortraitPanel,t);var r,a,i=_createSuper(DND5ePortraitPanel);function DND5ePortraitPanel(){_classCallCheck(this,DND5ePortraitPanel);for(var t=arguments.length,r=new Array(t),a=0;a=1||a.details.cr<=0?a.details.cr:"1/".concat(1/a.details.cr);return"CR ".concat(d," ").concat(u)}if(o){var p=Object.values(i.classes).map((function(t){return t.name})).join(" / ");return"Level ".concat(a.details.level," ").concat(p," (").concat(a.details.race,")")}return""}},{key:"isDead",get:function get(){return this.isDying&&"character"!==this.actor.type}},{key:"isDying",get:function get(){return this.actor.system.attributes.hp.value<=0}},{key:"successes",get:function get(){var t,r;return null!==(t=null===(r=this.actor.system.attributes)||void 0===r||null===(r=r.death)||void 0===r?void 0:r.success)&&void 0!==t?t:0}},{key:"failures",get:function get(){var t,r;return null!==(t=null===(r=this.actor.system.attributes)||void 0===r||null===(r=r.death)||void 0===r?void 0:r.failure)&&void 0!==t?t:0}},{key:"configurationTemplate",get:function get(){return"modules/enhancedcombathud-dnd5e/templates/argon-actor-config.hbs"}},{key:"_onDeathSave",value:(a=_asyncToGenerator(_regeneratorRuntime().mark((function _callee(t){return _regeneratorRuntime().wrap((function _callee$(t){for(;;)switch(t.prev=t.next){case 0:this.actor.rollDeathSave({});case 1:case"end":return t.stop()}}),_callee,this)}))),function _onDeathSave(t){return a.apply(this,arguments)})},{key:"getStatBlocks",value:(r=_asyncToGenerator(_regeneratorRuntime().mark((function _callee2(){var t,r,a,i,o,l,c,u;return _regeneratorRuntime().wrap((function _callee2$(d){for(;;)switch(d.prev=d.next){case 0:return a=game.i18n.localize("DND5E.HitPoints").split(" ").map((function(t){return t.charAt(0).toUpperCase()})).join(""),i=game.i18n.localize("DND5E.ArmorClass").split(" ").map((function(t){return t.charAt(0).toUpperCase()})).join(""),o=game.i18n.localize("DND5E.SaveDC").replace("{ability}","").replace("{dc}","").trim(),l=this.actor.system.attributes.hp.temp?"#6698f3":"rgb(0 255 170)",c=this.actor.system.attributes.hp.tempmax,u=c?c>0?"rgb(222 91 255)":"#ffb000":"rgb(255 255 255)",d.abrupt("return",[[{text:"".concat(this.actor.system.attributes.hp.value+(null!==(t=this.actor.system.attributes.hp.temp)&&void 0!==t?t:0)),color:l},{text:"/"},{text:"".concat(this.actor.system.attributes.hp.max+(null!==(r=this.actor.system.attributes.hp.tempmax)&&void 0!==r?r:0)),color:u},{text:a}],[{text:i},{text:this.actor.system.attributes.ac.value,color:"var(--ech-movement-baseMovement-background)"}],[{text:o},{text:this.actor.system.attributes.spelldc,color:"var(--ech-movement-baseMovement-background)"}]]);case 7:case"end":return d.stop()}}),_callee2,this)}))),function getStatBlocks(){return r.apply(this,arguments)})}]),DND5ePortraitPanel}(o.PORTRAIT.PortraitPanel),g=function(t){_inherits(DND5eDrawerButton,t);var r,a=_createSuper(DND5eDrawerButton);function DND5eDrawerButton(t,r,i){var o;return _classCallCheck(this,DND5eDrawerButton),(o=a.call(this,t)).item=r,o.type=i,o}return _createClass(DND5eDrawerButton,[{key:"hasTooltip",get:function get(){return!0}},{key:"tooltipOrientation",get:function get(){return TooltipManager.TOOLTIP_DIRECTIONS.RIGHT}},{key:"getTooltipData",value:(r=_asyncToGenerator(_regeneratorRuntime().mark((function _callee3(){var t;return _regeneratorRuntime().wrap((function _callee3$(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,getTooltipDetails(this.item,this.type);case 2:return t=r.sent,r.abrupt("return",t);case 4:case"end":return r.stop()}}),_callee3,this)}))),function getTooltipData(){return r.apply(this,arguments)})}]),DND5eDrawerButton}(o.DRAWER.DrawerButton),b=function(t){_inherits(DND5eDrawerPanel,t);var r=_createSuper(DND5eDrawerPanel);function DND5eDrawerPanel(){_classCallCheck(this,DND5eDrawerPanel);for(var t=arguments.length,a=new Array(t),i=0;i=0?"+".concat(t):t};return[{gridCols:"5fr 2fr 2fr",captions:[{label:"Abilities",align:"left"},{label:"Check",align:"center"},{label:"Save",align:"center"}],align:["left","center","center"],buttons:Object.keys(r).map((function(a){var i=r[a];return new g([{label:CONFIG.DND5E.abilities[a].label,onClick:function onClick(r){return t.actor.rollAbilityCheck({ability:a,event:r})}},{label:o(i.mod+(i.checkBonus||0)),onClick:function onClick(r){return t.actor.rollAbilityCheck({ability:a,event:r})}},{label:o(i.save),onClick:function onClick(r){return t.actor.rollSavingThrow({ability:a,event:r})}}],a,"save")}))},{gridCols:"7fr 2fr",captions:[{label:"Skills"},{label:""}],buttons:Object.keys(a).map((function(r){var i=a[r];return new g([{label:getProficiencyIcon(i.proficient)+CONFIG.DND5E.skills[r].label,onClick:function onClick(a){return t.actor.rollSkill({skill:r,event:a})}},{label:"".concat(o(i.total),'(').concat(i.passive,")"),style:"display: flex; justify-content: flex-end;"}],r,"skill")}))},{gridCols:"7fr 2fr",captions:[{label:"Tools"},{label:""}],buttons:i.map((function(a){return new g([{label:getProficiencyIcon(a.system.proficient)+a.name,onClick:function onClick(t){return a.rollToolCheck({event:t})}},{label:o(r[a.abilityMod].mod+a.system.proficiencyMultiplier*t.actor.system.attributes.prof)}],a)}))}]}},{key:"title",get:function get(){return"".concat(game.i18n.localize("enhancedcombathud-dnd5e.hud.saves.name")," / ").concat(game.i18n.localize("enhancedcombathud-dnd5e.hud.skills.name")," / ").concat(game.i18n.localize("enhancedcombathud-dnd5e.hud.tools.name"))}}]),DND5eDrawerPanel}(o.DRAWER.DrawerPanel),_=function(i){_inherits(DND5eActionActionPanel,i);var l,c=_createSuper(DND5eActionActionPanel);function DND5eActionActionPanel(){_classCallCheck(this,DND5eActionActionPanel);for(var t=arguments.length,r=new Array(t),a=0;a\n\n
\n\n
\n \n
\n ').concat(this.label,'\n \n Feature\n \n
\n \n
\n\n
\n
\n ').concat(this.item.system.description.value,"\n
\n
\n
\n\n\n\n ")});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),_callee18,this)}))),function createChatMessage(){return r.apply(this,arguments)})}]),DND5eSpecialActionButton}(o.MAIN.BUTTONS.ActionButton),O=function(t){_inherits(DND5eMovementHud,t);var r=_createSuper(DND5eMovementHud);function DND5eMovementHud(){var t,a;_classCallCheck(this,DND5eMovementHud);for(var i=arguments.length,o=new Array(i),l=0;l';case"bludgeoning":return'';case"cold":return'';case"fire":return'';case"force":return'';case"lightning":return'';case"necrotic":return'';case"piercing":return'';case"poison":return'';case"psychic":return'';case"radiant":return'';case"slashing":return'';case"thunder":return'';case"healing":return'';default:return""}}function getProficiencyIcon(t){return 0==t?' ':1==t?' ':2==t?' ':.5==t?' ':' '}function condenseItemButtons(t){if(!game.settings.get(a,"condenseClassActions"))return t.map((function(t){return new C({item:t,inActionPanel:!0})}));for(var r=[],i=t.length,l=i-i%2,c=null,u=0;ut.length)&&(r=t.length);for(var a=0,i=new Array(r);a {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","import { MODULE_ID } from \"./main.js\";\r\n\r\nconst ECHItems = {};\r\n\r\nexport function initConfig() {\r\n Hooks.on(\"argonInit\", (CoreHUD) => {\r\n if (game.system.id !== \"dnd5e\") return;\r\n registerItems();\r\n const ARGON = CoreHUD.ARGON;\r\n\r\n class DND5eTooltip extends ARGON.CORE.Tooltip{\r\n get classes() {\r\n const original = super.classes;\r\n return original.concat([\"dnd5e2\"]);\r\n }\r\n }\r\n\r\n const isMIDI = game.modules.get(\"midi-qol\")?.active;\r\n const getMidiFlag = (actionType) => {\r\n if (!isMIDI || !ui.ARGON._actor) return null;\r\n const flag = ui.ARGON._actor.getFlag(\"midi-qol\", \"actions\") ?? {};\r\n const value = flag[actionType] ?? false;\r\n const midiAction = value ? 0 : 1;\r\n return midiAction;\r\n };\r\n\r\n const getActivationType = (item) => {\r\n if (!item?.system?.activities) {\r\n return;\r\n }\r\n return Array.from(item.system.activities)[0]?.activation?.type;\r\n };\r\n\r\n const getActionType = (item) => {\r\n if (!item?.system?.activities) {\r\n return;\r\n }\r\n return Array.from(item.system.activities)[0]?.actionType;\r\n };\r\n\r\n const actionTypes = {\r\n action: [\"action\"],\r\n bonus: [\"bonus\"],\r\n reaction: [\"reaction\", \"reactiondamage\", \"reactionmanual\"],\r\n free: [\"special\"],\r\n };\r\n\r\n const itemTypes = {\r\n spell: [\"spell\"],\r\n feat: [\"feat\"],\r\n consumable: [\"consumable\", \"equipment\", \"loot\"],\r\n };\r\n\r\n const mainBarFeatures = [];\r\n\r\n if (game.settings.get(MODULE_ID, \"showWeaponsItems\")) itemTypes.consumable.push(\"weapon\");\r\n if (game.settings.get(MODULE_ID, \"showClassActions\")) mainBarFeatures.push(\"class\");\r\n\r\n CoreHUD.DND5E = {\r\n actionTypes,\r\n itemTypes,\r\n mainBarFeatures,\r\n ECHItems,\r\n };\r\n\r\n Hooks.callAll(\"enhanced-combat-hud.dnd5e.initConfig\", { actionTypes, itemTypes, ECHItems });\r\n\r\n async function getTooltipDetails(item, type) {\r\n let title, description, itemType, subtitle, target, range, dt;\r\n let damageTypes = [];\r\n let properties = [];\r\n let materialComponents = \"\";\r\n\r\n if (type == \"skill\") {\r\n title = CONFIG.DND5E.skills[item].label;\r\n description = game.i18n.localize(`enhancedcombathud-dnd5e.skills.${item}.tooltip`);\r\n } else if (type == \"save\") {\r\n title = CONFIG.DND5E.abilities[item].label;\r\n description = game.i18n.localize(`enhancedcombathud-dnd5e.abilities.${item}.tooltip`);\r\n } else {\r\n if (!item || !item.system) return;\r\n\r\n title = item.name;\r\n description = item.system.identified ? item.system.description.value : item.system.description.unidentified ?? item.system.description.value;\r\n itemType = item.type;\r\n target = item.labels?.target || \"-\";\r\n range = item.labels?.range || \"-\";\r\n properties = [];\r\n dt = item.labels?.damageTypes?.split(\", \");\r\n damageTypes = dt && dt.length ? dt : [];\r\n materialComponents = \"\";\r\n\r\n switch (itemType) {\r\n case \"weapon\":\r\n subtitle = CONFIG.DND5E.weaponTypes[item.system.weaponType];\r\n properties.push(CONFIG.DND5E.itemActionTypes[getActionType(item)]);\r\n for (let [key, value] of Object.entries(item.system.properties)) {\r\n let prop = value && CONFIG.DND5E.weaponProperties[key] ? CONFIG.DND5E.weaponProperties[key] : undefined;\r\n if (prop) properties.push(prop);\r\n }\r\n break;\r\n case \"spell\":\r\n subtitle = `${item.labels.level} ${item.labels.school}`;\r\n properties.push(CONFIG.DND5E.spellSchools[item.system.school]);\r\n properties.push(item.labels.duration);\r\n properties.push(item.labels.save);\r\n for (let comp of item.labels.components.all) {\r\n properties.push(comp.abbr);\r\n }\r\n if (item.labels.materials) materialComponents = item.labels.materials;\r\n break;\r\n case \"consumable\":\r\n subtitle = CONFIG.DND5E.consumableTypes[item.system.consumableType];\r\n properties.push(CONFIG.DND5E.itemActionTypes[getActionType(item)]);\r\n break;\r\n case \"feat\":\r\n subtitle = item.system.requirements;\r\n properties.push(CONFIG.DND5E.itemActionTypes[getActionType(item)]);\r\n break;\r\n }\r\n }\r\n\r\n if (description) description = await TextEditor.enrichHTML(description, { async: true, relativeTo: item.parent });\r\n let details = [];\r\n if (target || range) {\r\n details = [\r\n {\r\n label: \"enhancedcombathud-dnd5e.tooltip.target.name\",\r\n value: target,\r\n },\r\n {\r\n label: \"enhancedcombathud-dnd5e.tooltip.range.name\",\r\n value: range,\r\n },\r\n ];\r\n }\r\n if (item?.labels?.toHit) {\r\n details.push({\r\n label: \"enhancedcombathud-dnd5e.tooltip.toHit.name\",\r\n value: item.labels.toHit,\r\n });\r\n }\r\n if (item?.labels?.derivedDamage?.length) {\r\n let dmgString = \"\";\r\n item.labels.derivedDamage.forEach((dDmg) => {\r\n dmgString += dDmg.formula + \" \" + getDamageTypeIcon(dDmg.damageType) + \" \";\r\n });\r\n details.push({\r\n label: \"enhancedcombathud-dnd5e.tooltip.damage.name\",\r\n value: dmgString,\r\n });\r\n }\r\n\r\n const tooltipProperties = [];\r\n if (damageTypes?.length) damageTypes.forEach((d) => tooltipProperties.push({ label: d, primary: true }));\r\n if (properties?.length) properties.forEach((p) => tooltipProperties.push({ label: p?.label ?? p, secondary: true }));\r\n return { title, description, subtitle, details, properties: tooltipProperties, footerText: materialComponents };\r\n }\r\n\r\n function getDamageTypeIcon(damageType) {\r\n switch (damageType.toLowerCase()) {\r\n case \"acid\":\r\n return '';\r\n case \"bludgeoning\":\r\n return '';\r\n case \"cold\":\r\n return '';\r\n case \"fire\":\r\n return '';\r\n case \"force\":\r\n return '';\r\n case \"lightning\":\r\n return '';\r\n case \"necrotic\":\r\n return '';\r\n case \"piercing\":\r\n return '';\r\n case \"poison\":\r\n return '';\r\n case \"psychic\":\r\n return '';\r\n case \"radiant\":\r\n return '';\r\n case \"slashing\":\r\n return '';\r\n case \"thunder\":\r\n return '';\r\n case \"healing\":\r\n return '';\r\n default:\r\n return \"\";\r\n }\r\n }\r\n\r\n function getProficiencyIcon(proficiency) {\r\n if (proficiency == 0) return ' ';\r\n else if (proficiency == 1) return ' ';\r\n else if (proficiency == 2) return ' ';\r\n else if (proficiency == 0.5) return ' ';\r\n else return ' ';\r\n }\r\n\r\n function condenseItemButtons(items) {\r\n const condenseClassActions = game.settings.get(MODULE_ID, \"condenseClassActions\");\r\n if (!condenseClassActions) return items.map((item) => new DND5eItemButton({ item, inActionPanel: true }));\r\n const condensedItems = [];\r\n const barItemsLength = items.length;\r\n const barItemsMultipleOfTwo = barItemsLength - (barItemsLength % 2);\r\n let currentSplitButtonItemButton = null;\r\n for (let i = 0; i < barItemsLength; i++) {\r\n const isCondensedButton = i < barItemsMultipleOfTwo;\r\n const item = items[i];\r\n if (isCondensedButton) {\r\n if (currentSplitButtonItemButton) {\r\n const button = new DND5eItemButton({ item, inActionPanel: false });\r\n condensedItems.push(new ARGON.MAIN.BUTTONS.SplitButton(currentSplitButtonItemButton, button));\r\n currentSplitButtonItemButton = null;\r\n } else {\r\n currentSplitButtonItemButton = new DND5eItemButton({ item, inActionPanel: false });\r\n }\r\n } else {\r\n condensedItems.push(new DND5eItemButton({ item, inActionPanel: true }));\r\n }\r\n }\r\n return condensedItems;\r\n }\r\n\r\n class DND5ePortraitPanel extends ARGON.PORTRAIT.PortraitPanel {\r\n constructor(...args) {\r\n super(...args);\r\n }\r\n\r\n get description() {\r\n const { type, system } = this.actor;\r\n const actor = this.actor;\r\n const isNPC = type === \"npc\";\r\n const isPC = type === \"character\";\r\n if (isNPC) {\r\n const creatureType = game.i18n.localize(CONFIG.DND5E.creatureTypes[actor.system.details.type.value]?.label ?? actor.system.details.type.custom);\r\n const cr = system.details.cr >= 1 || system.details.cr <= 0 ? system.details.cr : `1/${1 / system.details.cr}`;\r\n return `CR ${cr} ${creatureType}`;\r\n } else if (isPC) {\r\n const classes = Object.values(actor.classes)\r\n .map((c) => c.name)\r\n .join(\" / \");\r\n return `Level ${system.details.level} ${classes} (${system.details.race})`;\r\n } else {\r\n return \"\";\r\n }\r\n }\r\n\r\n get isDead() {\r\n return this.isDying && this.actor.type !== \"character\";\r\n }\r\n\r\n get isDying() {\r\n return this.actor.system.attributes.hp.value <= 0;\r\n }\r\n\r\n get successes() {\r\n return this.actor.system.attributes?.death?.success ?? 0;\r\n }\r\n\r\n get failures() {\r\n return this.actor.system.attributes?.death?.failure ?? 0;\r\n }\r\n\r\n get configurationTemplate() {\r\n return \"modules/enhancedcombathud-dnd5e/templates/argon-actor-config.hbs\";\r\n }\r\n\r\n async _onDeathSave(event) {\r\n this.actor.rollDeathSave({});\r\n }\r\n\r\n async getStatBlocks() {\r\n const HPText = game.i18n\r\n .localize(\"DND5E.HitPoints\")\r\n .split(\" \")\r\n .map((word) => word.charAt(0).toUpperCase())\r\n .join(\"\");\r\n const ACText = game.i18n\r\n .localize(\"DND5E.ArmorClass\")\r\n .split(\" \")\r\n .map((word) => word.charAt(0).toUpperCase())\r\n .join(\"\");\r\n const SpellDC = game.i18n.localize(\"DND5E.SaveDC\").replace(\"{ability}\", \"\").replace(\"{dc}\", \"\").trim();\r\n\r\n const hpColor = this.actor.system.attributes.hp.temp ? \"#6698f3\" : \"rgb(0 255 170)\";\r\n const tempMax = this.actor.system.attributes.hp.tempmax;\r\n const hpMaxColor = tempMax ? (tempMax > 0 ? \"rgb(222 91 255)\" : \"#ffb000\") : \"rgb(255 255 255)\";\r\n\r\n return [\r\n [\r\n {\r\n text: `${this.actor.system.attributes.hp.value + (this.actor.system.attributes.hp.temp ?? 0)}`,\r\n color: hpColor,\r\n },\r\n {\r\n text: `/`,\r\n },\r\n {\r\n text: `${this.actor.system.attributes.hp.max + (this.actor.system.attributes.hp.tempmax ?? 0)}`,\r\n color: hpMaxColor,\r\n },\r\n {\r\n text: HPText,\r\n },\r\n ],\r\n [\r\n {\r\n text: ACText,\r\n },\r\n {\r\n text: this.actor.system.attributes.ac.value,\r\n color: \"var(--ech-movement-baseMovement-background)\",\r\n },\r\n ],\r\n [\r\n {\r\n text: SpellDC,\r\n },\r\n {\r\n text: this.actor.system.attributes.spelldc,\r\n color: \"var(--ech-movement-baseMovement-background)\",\r\n },\r\n ],\r\n ];\r\n }\r\n }\r\n\r\n class DND5eDrawerButton extends ARGON.DRAWER.DrawerButton {\r\n constructor(buttons, item, type) {\r\n super(buttons);\r\n this.item = item;\r\n this.type = type;\r\n }\r\n\r\n get hasTooltip() {\r\n return true;\r\n }\r\n\r\n get tooltipOrientation() {\r\n return TooltipManager.TOOLTIP_DIRECTIONS.RIGHT;\r\n }\r\n\r\n async getTooltipData() {\r\n const tooltipData = await getTooltipDetails(this.item, this.type);\r\n return tooltipData;\r\n }\r\n }\r\n\r\n class DND5eDrawerPanel extends ARGON.DRAWER.DrawerPanel {\r\n constructor(...args) {\r\n super(...args);\r\n }\r\n\r\n get categories() {\r\n const abilities = this.actor.system.abilities;\r\n const skills = this.actor.system.skills;\r\n const tools = this.actor.itemTypes.tool;\r\n\r\n const addSign = (value) => {\r\n if (value >= 0) return `+${value}`;\r\n return value;\r\n };\r\n\r\n const abilitiesButtons = Object.keys(abilities).map((ability) => {\r\n const abilityData = abilities[ability];\r\n return new DND5eDrawerButton(\r\n [\r\n {\r\n label: CONFIG.DND5E.abilities[ability].label,\r\n onClick: (event) => this.actor.rollAbilityCheck({ability, event}),\r\n },\r\n {\r\n label: addSign(abilityData.mod + (abilityData.checkBonus || 0)),\r\n onClick: (event) => this.actor.rollAbilityCheck({ability, event}),\r\n },\r\n {\r\n label: addSign(abilityData.save),\r\n onClick: (event) => this.actor.rollSavingThrow({ability, event }),\r\n },\r\n ],\r\n ability,\r\n \"save\",\r\n );\r\n });\r\n\r\n const skillsButtons = Object.keys(skills).map((skill) => {\r\n const skillData = skills[skill];\r\n return new DND5eDrawerButton(\r\n [\r\n {\r\n label: getProficiencyIcon(skillData.proficient) + CONFIG.DND5E.skills[skill].label,\r\n onClick: (event) => this.actor.rollSkill({skill, event}),\r\n },\r\n {\r\n label: `${addSign(skillData.total)}(${skillData.passive})`,\r\n style: \"display: flex; justify-content: flex-end;\",\r\n },\r\n ],\r\n skill,\r\n \"skill\",\r\n );\r\n });\r\n\r\n const toolButtons = tools.map((tool) => {\r\n return new DND5eDrawerButton(\r\n [\r\n {\r\n label: getProficiencyIcon(tool.system.proficient) + tool.name,\r\n onClick: (event) => tool.rollToolCheck({ event }),\r\n },\r\n {\r\n label: addSign(abilities[tool.abilityMod].mod + tool.system.proficiencyMultiplier * this.actor.system.attributes.prof),\r\n },\r\n ],\r\n tool,\r\n );\r\n });\r\n\r\n return [\r\n {\r\n gridCols: \"5fr 2fr 2fr\",\r\n captions: [\r\n {\r\n label: \"Abilities\",\r\n align: \"left\",\r\n },\r\n {\r\n label: \"Check\",\r\n align: \"center\",\r\n },\r\n {\r\n label: \"Save\",\r\n align: \"center\",\r\n },\r\n ],\r\n align: [\"left\", \"center\", \"center\"],\r\n buttons: abilitiesButtons,\r\n },\r\n {\r\n gridCols: \"7fr 2fr\",\r\n captions: [\r\n {\r\n label: \"Skills\",\r\n },\r\n {\r\n label: \"\",\r\n },\r\n ],\r\n buttons: skillsButtons,\r\n },\r\n {\r\n gridCols: \"7fr 2fr\",\r\n captions: [\r\n {\r\n label: \"Tools\",\r\n },\r\n {\r\n label: \"\",\r\n },\r\n ],\r\n buttons: toolButtons,\r\n },\r\n ];\r\n }\r\n\r\n get title() {\r\n return `${game.i18n.localize(\"enhancedcombathud-dnd5e.hud.saves.name\")} / ${game.i18n.localize(\"enhancedcombathud-dnd5e.hud.skills.name\")} / ${game.i18n.localize(\"enhancedcombathud-dnd5e.hud.tools.name\")}`;\r\n }\r\n }\r\n\r\n class DND5eActionActionPanel extends ARGON.MAIN.ActionPanel {\r\n constructor(...args) {\r\n super(...args);\r\n }\r\n\r\n get label() {\r\n return \"DND5E.Action\";\r\n }\r\n\r\n get maxActions() {\r\n return this.actor?.inCombat ? 1 : null;\r\n }\r\n\r\n get currentActions() {\r\n return getMidiFlag(\"action\") ?? (this.isActionUsed ? 0 : 1);\r\n }\r\n\r\n _onNewRound(combat) {\r\n this.isActionUsed = false;\r\n this.updateActionUse();\r\n }\r\n\r\n async _getButtons() {\r\n const spellItems = this.actor.items.filter((item) => itemTypes.spell.includes(item.type) && actionTypes.action.includes(getActivationType(item)) && !CoreHUD.DND5E.mainBarFeatures.includes(item.system.type?.value));\r\n const featItems = this.actor.items.filter((item) => itemTypes.feat.includes(item.type) && actionTypes.action.includes(getActivationType(item)) && !CoreHUD.DND5E.mainBarFeatures.includes(item.system.type?.value));\r\n const consumableItems = this.actor.items.filter((item) => itemTypes.consumable.includes(item.type) && actionTypes.action.includes(getActivationType(item)) && !CoreHUD.DND5E.mainBarFeatures.includes(item.system.type?.value));\r\n\r\n const spellButton = !spellItems.length ? [] : [new DND5eButtonPanelButton({ type: \"spell\", items: spellItems, color: 0 })].filter((button) => button.hasContents);\r\n\r\n const specialActions = Object.values(ECHItems);\r\n\r\n const showSpecialActions = game.settings.get(MODULE_ID, \"showSpecialActions\");\r\n const buttons = [];\r\n if (showSpecialActions) {\r\n buttons.push(...[new DND5eItemButton({ item: null, isWeaponSet: true, isPrimary: true }), new ARGON.MAIN.BUTTONS.SplitButton(new DND5eSpecialActionButton(specialActions[0]), new DND5eSpecialActionButton(specialActions[1])), ...spellButton, new DND5eButtonPanelButton({ type: \"feat\", items: featItems, color: 0 }), new ARGON.MAIN.BUTTONS.SplitButton(new DND5eSpecialActionButton(specialActions[2]), new DND5eSpecialActionButton(specialActions[3])), new ARGON.MAIN.BUTTONS.SplitButton(new DND5eSpecialActionButton(specialActions[4]), new DND5eSpecialActionButton(specialActions[5])), new DND5eButtonPanelButton({ type: \"consumable\", items: consumableItems, color: 0 })]);\r\n } else {\r\n buttons.push(...[new DND5eItemButton({ item: null, isWeaponSet: true, isPrimary: true }), ...spellButton, new DND5eButtonPanelButton({ type: \"feat\", items: featItems, color: 0 }), new DND5eButtonPanelButton({ type: \"consumable\", items: consumableItems, color: 0 })]);\r\n }\r\n\r\n const barItems = this.actor.items.filter((item) => CoreHUD.DND5E.mainBarFeatures.includes(item.system.type?.value) && actionTypes.action.includes(getActivationType(item)));\r\n buttons.push(...condenseItemButtons(barItems));\r\n\r\n return buttons.filter((button) => button.hasContents || button.items == undefined || button.items.length);\r\n }\r\n }\r\n\r\n class DND5eBonusActionPanel extends ARGON.MAIN.ActionPanel {\r\n constructor(...args) {\r\n super(...args);\r\n }\r\n\r\n get label() {\r\n return \"DND5E.BonusAction\";\r\n }\r\n\r\n get maxActions() {\r\n return this.actor?.inCombat ? 1 : null;\r\n }\r\n\r\n get currentActions() {\r\n return getMidiFlag(\"bonus\") ?? (this.isActionUsed ? 0 : 1);\r\n }\r\n\r\n _onNewRound(combat) {\r\n this.isActionUsed = false;\r\n this.updateActionUse();\r\n }\r\n\r\n async _getButtons() {\r\n const buttons = [new DND5eItemButton({ item: null, isWeaponSet: true, isPrimary: false })];\r\n for (const [type, types] of Object.entries(itemTypes)) {\r\n const items = this.actor.items.filter((item) => types.includes(item.type) && actionTypes.bonus.includes(getActivationType(item)) && !CoreHUD.DND5E.mainBarFeatures.includes(item.system.type?.value));\r\n if (!items.length) continue;\r\n const button = new DND5eButtonPanelButton({ type, items, color: 1 });\r\n if (button.hasContents) buttons.push(button);\r\n }\r\n\r\n const barItems = this.actor.items.filter((item) => CoreHUD.DND5E.mainBarFeatures.includes(item.system.type?.value) && actionTypes.bonus.includes(getActivationType(item)));\r\n buttons.push(...condenseItemButtons(barItems));\r\n\r\n return buttons;\r\n }\r\n }\r\n\r\n class DND5eReactionActionPanel extends ARGON.MAIN.ActionPanel {\r\n constructor(...args) {\r\n super(...args);\r\n }\r\n\r\n get label() {\r\n return \"DND5E.Reaction\";\r\n }\r\n\r\n get maxActions() {\r\n return this.actor?.inCombat ? 1 : null;\r\n }\r\n\r\n get currentActions() {\r\n return getMidiFlag(\"reaction\") ?? (this.isActionUsed ? 0 : 1);\r\n }\r\n\r\n _onNewRound(combat) {\r\n this.isActionUsed = false;\r\n this.updateActionUse();\r\n }\r\n\r\n async _getButtons() {\r\n const buttons = [new DND5eItemButton({ item: null, isWeaponSet: true, isPrimary: true })];\r\n //buttons.push(new DND5eEquipmentButton({slot: 1}));\r\n for (const [type, types] of Object.entries(itemTypes)) {\r\n const items = this.actor.items.filter((item) => types.includes(item.type) && actionTypes.reaction.includes(getActivationType(item)) && !CoreHUD.DND5E.mainBarFeatures.includes(item.system.type?.value));\r\n if (!items.length) continue;\r\n const button = new DND5eButtonPanelButton({ type, items, color: 3 });\r\n if (button.hasContents) buttons.push(button);\r\n }\r\n\r\n const barItems = this.actor.items.filter((item) => CoreHUD.DND5E.mainBarFeatures.includes(item.system.type?.value) && actionTypes.reaction.includes(getActivationType(item)));\r\n buttons.push(...condenseItemButtons(barItems));\r\n\r\n return buttons;\r\n }\r\n }\r\n\r\n class DND5eFreeActionPanel extends ARGON.MAIN.ActionPanel {\r\n constructor(...args) {\r\n super(...args);\r\n }\r\n\r\n get label() {\r\n return \"DND5E.Special\";\r\n }\r\n\r\n get maxActions() {\r\n return this.actor?.inCombat ? 1 : null;\r\n }\r\n\r\n get currentActions() {\r\n return this.isActionUsed ? 0 : 1;\r\n }\r\n\r\n _onNewRound(combat) {\r\n this.isActionUsed = false;\r\n this.updateActionUse();\r\n }\r\n\r\n async _getButtons() {\r\n const buttons = [];\r\n\r\n for (const [type, types] of Object.entries(itemTypes)) {\r\n const items = this.actor.items.filter((item) => types.includes(item.type) && actionTypes.free.includes(getActivationType(item)) && !CoreHUD.DND5E.mainBarFeatures.includes(item.system.type?.value));\r\n if (!items.length) continue;\r\n const button = new DND5eButtonPanelButton({ type, items, color: 2 });\r\n if (button.hasContents) buttons.push(button);\r\n }\r\n\r\n const barItems = this.actor.items.filter((item) => CoreHUD.DND5E.mainBarFeatures.includes(item.system.type?.value) && actionTypes.free.includes(getActivationType(item)));\r\n buttons.push(...condenseItemButtons(barItems));\r\n\r\n return buttons;\r\n }\r\n }\r\n\r\n class DND5eLegActionPanel extends ARGON.MAIN.ActionPanel {\r\n constructor(...args) {\r\n super(...args);\r\n }\r\n\r\n get label() {\r\n return \"DND5E.LegendaryActionLabel\";\r\n }\r\n\r\n get maxActions() {\r\n return this.actor?.inCombat ? this.actor.system.resources?.legact?.max ?? null : null;\r\n }\r\n\r\n get currentActions() {\r\n return this.actor.system.resources?.legact?.value ?? null;\r\n }\r\n\r\n async _getButtons() {\r\n const buttons = [];\r\n const legendary = this.actor.items.filter((item) => getActivationType(item) === \"legendary\");\r\n legendary.forEach((item) => {\r\n buttons.push(new DND5eItemButton({ item, inActionPanel: true }));\r\n });\r\n return buttons;\r\n }\r\n }\r\n\r\n class DND5eLairActionPanel extends ARGON.MAIN.ActionPanel {\r\n constructor(...args) {\r\n super(...args);\r\n }\r\n\r\n get label() {\r\n return \"DND5E.LairActionLabel\";\r\n }\r\n\r\n get maxActions() {\r\n return this.actor?.inCombat ? 1 : null;\r\n }\r\n\r\n get currentActions() {\r\n return this.actor.system.resources.lair?.value * 1;\r\n }\r\n\r\n async _getButtons() {\r\n const buttons = [];\r\n const lair = this.actor.items.filter((item) => getActivationType(item) === \"lair\");\r\n lair.forEach((item) => {\r\n buttons.push(new DND5eItemButton({ item, inActionPanel: true }));\r\n });\r\n return buttons;\r\n }\r\n }\r\n\r\n class DND5eMythicActionPanel extends ARGON.MAIN.ActionPanel {\r\n constructor(...args) {\r\n super(...args);\r\n }\r\n\r\n get label() {\r\n return \"DND5E.MythicActionLabel\";\r\n }\r\n\r\n get maxActions() {\r\n return null; //this.actor?.inCombat ? 1 : null;\r\n }\r\n\r\n get currentActions() {\r\n return null; //this.actor.system.resources.mythic?.value * 1;\r\n }\r\n\r\n async _getButtons() {\r\n const buttons = [];\r\n const mythic = this.actor.items.filter((item) => getActivationType(item) === \"mythic\");\r\n mythic.forEach((item) => {\r\n buttons.push(new DND5eItemButton({ item, inActionPanel: true }));\r\n });\r\n return buttons;\r\n }\r\n }\r\n\r\n class DND5eItemButton extends ARGON.MAIN.BUTTONS.ItemButton {\r\n constructor(...args) {\r\n super(...args);\r\n }\r\n\r\n get activity() {\r\n if (!this.item?.system?.activities) {\r\n return;\r\n }\r\n return Array.from(this.item.system.activities)[0];\r\n }\r\n\r\n get hasTooltip() {\r\n return true;\r\n }\r\n\r\n get ranges() {\r\n const item = this.activity;\r\n const touchRange = item.range.units == \"touch\" ? canvas?.scene?.grid?.distance : null;\r\n return {\r\n normal: item?.range?.value ?? touchRange,\r\n long: item?.range?.long ?? null,\r\n };\r\n }\r\n\r\n get targets() {\r\n const item = this.activity;\r\n const validTargets = [\"creature\", \"ally\", \"enemy\"];\r\n const actionType = item.actionType;\r\n const affects = item.target?.affects ?? {};\r\n const targetType = affects.type;\r\n if (!item.target?.template?.units && validTargets.includes(targetType)) {\r\n return affects.count ?? 1;\r\n } else if (actionType === \"mwak\" || actionType === \"rwak\") {\r\n return affects.count || 1;\r\n }\r\n return null;\r\n }\r\n\r\n get visible() {\r\n if (!this._isWeaponSet) return super.visible;\r\n const isReaction = this.parent instanceof DND5eReactionActionPanel;\r\n const isMelee = this.activity?.actionType === \"mwak\";\r\n if (isReaction && !isMelee) return false;\r\n if (this._isPrimary) return super.visible;\r\n if (this.activity?.type?.value === \"shield\") return false;\r\n return super.visible;\r\n }\r\n\r\n async getTooltipData() {\r\n const tooltipData = await getTooltipDetails(this.item);\r\n tooltipData.propertiesLabel = \"enhancedcombathud-dnd5e.tooltip.properties.name\";\r\n return tooltipData;\r\n }\r\n\r\n async _onLeftClick(event) {\r\n ui.ARGON.interceptNextDialog(event.currentTarget);\r\n const used = await this.item.use({event, legacy: false}, {event});\r\n if (used) {\r\n DND5eItemButton.consumeActionEconomy(this.activity);\r\n }\r\n }\r\n\r\n async _onRightClick(event) {\r\n this.activity?.sheet?.render(true);\r\n }\r\n\r\n static consumeActionEconomy(item) {\r\n const activationType = getActivationType(item);\r\n let actionType = null;\r\n for (const [type, types] of Object.entries(actionTypes)) {\r\n if (types.includes(activationType)) actionType = type;\r\n }\r\n if (!actionType) return;\r\n if (game.combat?.combatant?.actor !== item.parent) actionType = \"reaction\";\r\n if (actionType === \"action\") {\r\n ui.ARGON.components.main[0].isActionUsed = true;\r\n ui.ARGON.components.main[0].updateActionUse();\r\n } else if (actionType === \"bonus\") {\r\n ui.ARGON.components.main[1].isActionUsed = true;\r\n ui.ARGON.components.main[1].updateActionUse();\r\n } else if (actionType === \"reaction\") {\r\n ui.ARGON.components.main[2].isActionUsed = true;\r\n ui.ARGON.components.main[2].updateActionUse();\r\n } else if (actionType === \"free\") {\r\n ui.ARGON.components.main[3].isActionUsed = true;\r\n ui.ARGON.components.main[3].updateActionUse();\r\n } else if (actionType === \"legendary\") {\r\n ui.ARGON.components.main[4].isActionUsed = true;\r\n }\r\n }\r\n\r\n async render(...args) {\r\n await super.render(...args);\r\n if (this.activity) {\r\n const weapons = this.actor.items.filter((item) => item.consume?.target === this.activity.id);\r\n ui.ARGON.updateItemButtons(weapons);\r\n }\r\n }\r\n\r\n get quantity() {\r\n if (!this.activity) return null;\r\n const showQuantityItemTypes = [\"consumable\"];\r\n const consumeType = this.activity.consume?.type;\r\n if (consumeType === \"ammo\") {\r\n const ammoItem = this.actor.items.get(this.activity.consume.target);\r\n if (!ammoItem) return null;\r\n return Math.floor((ammoItem.quantity ?? 0) / this.activity.consume.amount);\r\n } else if (consumeType === \"attribute\") {\r\n return Math.floor(getProperty(this.actor, this.activity.consume.target) / this.activity.consume.amount);\r\n } else if (consumeType === \"charges\") {\r\n const chargesItem = this.actor.items.get(this.activity.consume.target);\r\n if (!chargesItem) return null;\r\n return Math.floor((chargesItem.uses?.value ?? 0) / this.activity.consume.amount);\r\n } else if (showQuantityItemTypes.includes(this.activity.type)) {\r\n return this.activity.uses?.value ?? this.activity.quantity;\r\n } else if (this.activity.uses.value !== null && this.activity.uses.per !== null && this.activity.uses.max) {\r\n return this.activity.uses.value;\r\n }\r\n return null;\r\n }\r\n }\r\n\r\n class DND5eButtonPanelButton extends ARGON.MAIN.BUTTONS.ButtonPanelButton {\r\n constructor({ type, items, color }) {\r\n super();\r\n this.type = type;\r\n this.items = items;\r\n this.color = color;\r\n this.itemsWithSpells = [];\r\n this._spells = this.prePrepareSpells();\r\n }\r\n\r\n get hasContents() {\r\n return this._spells ? !!this._spells.length || !!this.itemsWithSpells.length : !!this.items.length;\r\n }\r\n\r\n get colorScheme() {\r\n return this.color;\r\n }\r\n\r\n get id() {\r\n return `${this.type}-${this.color}`;\r\n }\r\n\r\n get label() {\r\n switch (this.type) {\r\n case \"spell\":\r\n return \"enhancedcombathud-dnd5e.hud.castspell.name\";\r\n case \"feat\":\r\n return \"enhancedcombathud-dnd5e.hud.usepower.name\";\r\n case \"consumable\":\r\n return \"enhancedcombathud-dnd5e.hud.useitem.name\";\r\n }\r\n }\r\n\r\n get icon() {\r\n switch (this.type) {\r\n case \"spell\":\r\n return \"modules/enhancedcombathud/icons/spell-book.webp\";\r\n case \"feat\":\r\n return \"modules/enhancedcombathud/icons/mighty-force.webp\";\r\n case \"consumable\":\r\n return \"modules/enhancedcombathud/icons/drink-me.webp\";\r\n }\r\n }\r\n\r\n get showPreparedOnly() {\r\n if (this.actor.type !== \"character\") return false;\r\n const preparedFlag = this.actor.getFlag(MODULE_ID, \"showPrepared\");\r\n if (preparedFlag === \"all\") return false;\r\n if (preparedFlag === \"preparedOnly\") return true;\r\n const classes = Object.keys(this.actor.classes);\r\n const requiresPreparation = [\"cleric\", \"druid\", \"paladin\", \"wizard\", \"artificer\"].some((className) => classes.includes(className));\r\n return requiresPreparation;\r\n }\r\n\r\n prePrepareSpells() {\r\n if (this.type !== \"spell\") return;\r\n\r\n const spellLevels = CONFIG.DND5E.spellLevels;\r\n const itemsToIgnore = [];\r\n if (game.modules.get(\"items-with-spells-5e\")?.active) {\r\n const IWSAPI = game.modules.get(\"items-with-spells-5e\").api;\r\n const actionType = this.items[0].system.activation?.type;\r\n const spellItems = this.actor.items.filter((item) => item.flags[\"items-with-spells-5e\"]?.[\"item-spells\"]?.length);\r\n for (const item of spellItems) {\r\n const spellData = item.flags[\"items-with-spells-5e\"][\"item-spells\"];\r\n const itemsInSpell = spellData.map((spell) => this.actor.items.get(spell.id)).filter((item) => item && getActivationType(item) === actionType);\r\n if (!itemsInSpell.length) continue;\r\n itemsToIgnore.push(...itemsInSpell);\r\n if (!IWSAPI.isUsableItem(item)) continue;\r\n this.itemsWithSpells.push({\r\n label: item.name,\r\n buttons: itemsInSpell.map((item) => new DND5eItemButton({ item })),\r\n uses: () => {\r\n return { max: item.system.uses?.max, value: item.system.uses?.value };\r\n },\r\n });\r\n }\r\n this.items = this.items.filter((item) => !itemsToIgnore.includes(item));\r\n }\r\n if (this.showPreparedOnly) {\r\n const allowIfNotPrepared = [\"atwill\", \"innate\", \"pact\", \"always\"];\r\n this.items = this.items.filter((item) => {\r\n if (allowIfNotPrepared.includes(item.system.preparation.mode)) return true;\r\n if (item.system.level == 0) return true;\r\n return item.system.preparation.prepared;\r\n });\r\n }\r\n\r\n const spells = [\r\n ...this.itemsWithSpells,\r\n {\r\n label: \"DND5E.SpellPrepAtWill\",\r\n buttons: this.items.filter((item) => item.system.preparation.mode === \"atwill\").map((item) => new DND5eItemButton({ item })),\r\n uses: { max: Infinity, value: Infinity },\r\n },\r\n {\r\n label: \"DND5E.SpellPrepInnate\",\r\n buttons: this.items.filter((item) => item.system.preparation.mode === \"innate\").map((item) => new DND5eItemButton({ item })),\r\n uses: { max: Infinity, value: Infinity },\r\n },\r\n {\r\n label: Object.values(spellLevels)[0],\r\n buttons: this.items.filter((item) => item.system.level == 0).map((item) => new DND5eItemButton({ item })),\r\n uses: { max: Infinity, value: Infinity },\r\n },\r\n {\r\n label: \"DND5E.PactMagic\",\r\n buttons: this.items.filter((item) => item.system.preparation.mode === \"pact\").map((item) => new DND5eItemButton({ item })),\r\n uses: () => {\r\n return this.actor.system.spells.pact;\r\n },\r\n },\r\n ];\r\n for (const [level, label] of Object.entries(spellLevels)) {\r\n const levelSpells = this.items.filter((item) => item.system.level == level && (item.system.preparation.mode === \"prepared\" || item.system.preparation.mode === \"always\"));\r\n if (!levelSpells.length || level == 0) continue;\r\n spells.push({\r\n label,\r\n buttons: levelSpells.map((item) => new DND5eItemButton({ item })),\r\n uses: () => {\r\n return this.actor.system.spells[`spell${level}`];\r\n },\r\n });\r\n }\r\n return spells.filter((spell) => spell.buttons.length);\r\n }\r\n\r\n async _getPanel() {\r\n if (this.type === \"spell\") {\r\n return new ARGON.MAIN.BUTTON_PANELS.ACCORDION.AccordionPanel({ id: this.id, accordionPanelCategories: this._spells.map(({ label, buttons, uses }) => new ARGON.MAIN.BUTTON_PANELS.ACCORDION.AccordionPanelCategory({ label, buttons, uses })) });\r\n } else {\r\n return new ARGON.MAIN.BUTTON_PANELS.ButtonPanel({ id: this.id, buttons: this.items.map((item) => new DND5eItemButton({ item })) });\r\n }\r\n }\r\n }\r\n\r\n class DND5eSpecialActionButton extends ARGON.MAIN.BUTTONS.ActionButton {\r\n constructor(specialItem) {\r\n super();\r\n const actorItem = this.actor.items.getName(specialItem.name);\r\n this.actorItem = actorItem;\r\n this.item =\r\n actorItem ??\r\n new CONFIG.Item.documentClass(specialItem, {\r\n parent: this.actor,\r\n });\r\n }\r\n\r\n get label() {\r\n return this.item.name;\r\n }\r\n\r\n get icon() {\r\n return this.item.img;\r\n }\r\n\r\n get hasTooltip() {\r\n return true;\r\n }\r\n\r\n get activity() {\r\n if (!this.item?.system?.activities) {\r\n return;\r\n }\r\n return Array.from(this.item.system.activities)[0];\r\n }\r\n\r\n async getTooltipData() {\r\n const tooltipData = await getTooltipDetails(this.item);\r\n tooltipData.propertiesLabel = \"enhancedcombathud-dnd5e.tooltip.properties.name\";\r\n return tooltipData;\r\n }\r\n\r\n async _onLeftClick(event) {\r\n const useCE = game.modules.get(\"dfreds-convenient-effects\")?.active && game.dfreds.effectInterface.findEffect({ effectName: this.label });\r\n let success = false;\r\n if (useCE) {\r\n success = true;\r\n await game.dfreds.effectInterface.toggleEffect({ effectName: this.label, overlay: false, uuids: [this.actor.uuid] });\r\n } else {\r\n success = this.actorItem ? await this.activity.use({ event }, { event }) : await this.createChatMessage();\r\n }\r\n if (success) {\r\n DND5eItemButton.consumeActionEconomy(this.item);\r\n }\r\n }\r\n\r\n async createChatMessage() {\r\n return await ChatMessage.create({\r\n user: game.user,\r\n speaker: {\r\n actor: this.actor,\r\n token: this.actor.token,\r\n alias: this.actor.name,\r\n },\r\n content: `\r\n
\r\n\r\n
\r\n\r\n
\r\n \r\n
\r\n ${this.label}\r\n \r\n Feature\r\n \r\n
\r\n \r\n
\r\n\r\n
\r\n
\r\n ${this.item.system.description.value}\r\n
\r\n
\r\n
\r\n\r\n\r\n
\r\n `,\r\n });\r\n }\r\n }\r\n\r\n class DND5eMovementHud extends ARGON.MovementHud {\r\n constructor(...args) {\r\n super(...args);\r\n this.getMovementMode = game.modules.get(\"elevation-drag-ruler\")?.api?.getMovementMode;\r\n }\r\n\r\n get visible() {\r\n return game.combat?.started;\r\n }\r\n\r\n get movementMode() {\r\n return this.getMovementMode ? this.getMovementMode(this.token) : \"walk\";\r\n }\r\n\r\n get movementMax() {\r\n if (!this.actor) return 0;\r\n return this.actor.system.attributes.movement[this.movementMode] / canvas.scene.dimensions.distance;\r\n }\r\n }\r\n\r\n class DND5eButtonHud extends ARGON.ButtonHud {\r\n constructor(...args) {\r\n super(...args);\r\n }\r\n\r\n get visible() {\r\n return !game.combat?.started;\r\n }\r\n\r\n async _getButtons() {\r\n return [\r\n {\r\n label: \"DND5E.LongRest\",\r\n onClick: (event) => this.actor.longRest(),\r\n icon: \"fas fa-bed\",\r\n },\r\n {\r\n label: \"DND5E.ShortRest\",\r\n onClick: (event) => this.actor.shortRest(),\r\n icon: \"fas fa-coffee\",\r\n },\r\n ];\r\n }\r\n }\r\n\r\n class DND5eWeaponSets extends ARGON.WeaponSets {\r\n async getDefaultSets() {\r\n const sets = await super.getDefaultSets();\r\n const isTransformed = this.actor.flags?.dnd5e?.isPolymorphed;\r\n if (this.actor.type !== \"npc\" && !isTransformed) return sets;\r\n const actions = this.actor.items.filter((item) => item.type === \"weapon\" && getActivationType(item) === \"action\");\r\n const bonus = this.actor.items.filter((item) => item.type === \"weapon\" && getActivationType(item) === \"bonus\");\r\n return {\r\n 1: {\r\n primary: actions[0]?.uuid ?? null,\r\n secondary: bonus[0]?.uuid ?? null,\r\n },\r\n 2: {\r\n primary: actions[1]?.uuid ?? null,\r\n secondary: bonus[1]?.uuid ?? null,\r\n },\r\n 3: {\r\n primary: actions[2]?.uuid ?? null,\r\n secondary: bonus[2]?.uuid ?? null,\r\n },\r\n };\r\n }\r\n\r\n async _getSets() {\r\n const isTransformed = this.actor.flags?.dnd5e?.isPolymorphed;\r\n\r\n const sets = isTransformed ? await this.getDefaultSets() : foundry.utils.mergeObject(await this.getDefaultSets(), foundry.utils.deepClone(this.actor.getFlag(\"enhancedcombathud\", \"weaponSets\") || {}));\r\n\r\n for (const [set, slots] of Object.entries(sets)) {\r\n slots.primary = slots.primary ? await fromUuid(slots.primary) : null;\r\n slots.secondary = slots.secondary ? await fromUuid(slots.secondary) : null;\r\n }\r\n return sets;\r\n }\r\n\r\n async _onSetChange({ sets, active }) {\r\n const switchEquip = game.settings.get(\"enhancedcombathud-dnd5e\", \"switchEquip\");\r\n if (!switchEquip) return;\r\n const updates = [];\r\n const activeSet = sets[active];\r\n const activeItems = Object.values(activeSet).filter((item) => item);\r\n const inactiveSets = Object.values(sets).filter((set) => set !== activeSet);\r\n const inactiveItems = inactiveSets\r\n .flatMap((set) => Object.values(set))\r\n .filter((item) => item)\r\n .filter((item) => !activeItems.includes(item));\r\n activeItems.forEach((item) => {\r\n if (!item.system?.equipped) updates.push({ _id: item.id, \"system.equipped\": true });\r\n });\r\n inactiveItems.forEach((item) => {\r\n if (item.system?.equipped) updates.push({ _id: item.id, \"system.equipped\": false });\r\n });\r\n return await this.actor.updateEmbeddedDocuments(\"Item\", updates);\r\n }\r\n }\r\n\r\n const enableMacroPanel = game.settings.get(MODULE_ID, \"macroPanel\");\r\n\r\n const mainPanels = [DND5eActionActionPanel, DND5eBonusActionPanel, DND5eReactionActionPanel, DND5eFreeActionPanel, DND5eLegActionPanel, DND5eLairActionPanel, DND5eMythicActionPanel];\r\n if (enableMacroPanel) mainPanels.push(ARGON.PREFAB.MacroPanel);\r\n mainPanels.push(ARGON.PREFAB.PassTurnPanel);\r\n\r\n CoreHUD.definePortraitPanel(DND5ePortraitPanel);\r\n CoreHUD.defineDrawerPanel(DND5eDrawerPanel);\r\n CoreHUD.defineMainPanels(mainPanels);\r\n CoreHUD.defineMovementHud(DND5eMovementHud);\r\n CoreHUD.defineButtonHud(DND5eButtonHud);\r\n CoreHUD.defineWeaponSets(DND5eWeaponSets);\r\n CoreHUD.defineTooltip(DND5eTooltip);\r\n CoreHUD.defineSupportedActorTypes([\"character\", \"npc\"]);\r\n });\r\n}\r\n\r\nfunction registerItems() {\r\n ECHItems[game.i18n.localize(\"enhancedcombathud-dnd5e.items.disengage.name\")] = {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.items.disengage.name\"),\r\n type: \"feat\",\r\n img: \"modules/enhancedcombathud/icons/journey.webp\",\r\n system: {\r\n type: {\r\n value: \"\",\r\n subtype: \"\",\r\n },\r\n description: {\r\n value: game.i18n.localize(\"enhancedcombathud-dnd5e.items.disengage.desc\"),\r\n chat: \"\",\r\n unidentified: \"\",\r\n },\r\n source: \"\",\r\n quantity: 1,\r\n weight: 0,\r\n price: 0,\r\n attuned: false,\r\n attunement: 0,\r\n equipped: false,\r\n rarity: \"\",\r\n identified: true,\r\n activation: {\r\n type: \"action\",\r\n cost: 1,\r\n condition: \"\",\r\n },\r\n duration: {\r\n value: 1,\r\n units: \"turn\",\r\n },\r\n target: {\r\n value: null,\r\n width: null,\r\n units: \"\",\r\n type: \"self\",\r\n },\r\n range: {\r\n value: null,\r\n long: null,\r\n units: \"\",\r\n },\r\n consume: {\r\n type: \"\",\r\n target: \"\",\r\n amount: null,\r\n },\r\n ability: \"\",\r\n actionType: \"util\",\r\n attackBonus: 0,\r\n chatFlavor: \"\",\r\n critical: null,\r\n damage: {\r\n parts: [],\r\n versatile: \"\",\r\n },\r\n formula: \"\",\r\n save: {\r\n ability: \"\",\r\n dc: null,\r\n scaling: \"spell\",\r\n },\r\n },\r\n sort: 0,\r\n flags: {\r\n core: {\r\n sourceId: \"Item.wyQkeuZkttllAFB1\",\r\n },\r\n\r\n \"midi-qol\": {\r\n onUseMacroName: \"\",\r\n },\r\n },\r\n };\r\n ECHItems[game.i18n.localize(\"enhancedcombathud-dnd5e.items.dodge.name\")] = {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.items.dodge.name\"),\r\n type: \"feat\",\r\n img: \"modules/enhancedcombathud/icons/armor-upgrade.webp\",\r\n system: {\r\n type: {\r\n value: \"\",\r\n subtype: \"\",\r\n },\r\n description: {\r\n value: game.i18n.localize(\"enhancedcombathud-dnd5e.items.dodge.desc\"),\r\n chat: \"\",\r\n unidentified: \"\",\r\n },\r\n source: \"\",\r\n quantity: 1,\r\n weight: 0,\r\n price: 0,\r\n attuned: false,\r\n attunement: 0,\r\n equipped: false,\r\n rarity: \"\",\r\n identified: true,\r\n activation: {\r\n type: \"action\",\r\n cost: 1,\r\n condition: \"\",\r\n },\r\n duration: {\r\n value: 1,\r\n units: \"round\",\r\n },\r\n target: {\r\n value: null,\r\n width: null,\r\n units: \"\",\r\n type: \"self\",\r\n },\r\n range: {\r\n value: null,\r\n long: null,\r\n units: \"\",\r\n },\r\n\r\n consume: {\r\n type: \"\",\r\n target: \"\",\r\n amount: null,\r\n },\r\n ability: \"\",\r\n actionType: \"util\",\r\n attackBonus: 0,\r\n chatFlavor: \"\",\r\n critical: null,\r\n damage: {\r\n parts: [],\r\n versatile: \"\",\r\n },\r\n formula: \"\",\r\n save: {\r\n ability: \"\",\r\n dc: null,\r\n scaling: \"spell\",\r\n },\r\n consumableType: \"trinket\",\r\n },\r\n sort: 0,\r\n flags: {\r\n \"midi-qol\": {\r\n onUseMacroName: \"\",\r\n },\r\n },\r\n };\r\n ECHItems[game.i18n.localize(\"enhancedcombathud-dnd5e.items.ready.name\")] = {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.items.ready.name\"),\r\n type: \"feat\",\r\n img: \"modules/enhancedcombathud/icons/clockwork.webp\",\r\n system: {\r\n type: {\r\n value: \"\",\r\n subtype: \"\",\r\n },\r\n description: {\r\n value: game.i18n.localize(\"enhancedcombathud-dnd5e.items.ready.desc\"),\r\n chat: \"\",\r\n unidentified: \"\",\r\n },\r\n source: \"\",\r\n quantity: 1,\r\n weight: 0,\r\n price: 0,\r\n attuned: false,\r\n attunement: 0,\r\n equipped: false,\r\n rarity: \"\",\r\n identified: true,\r\n activation: {\r\n type: \"action\",\r\n cost: 1,\r\n condition: \"\",\r\n },\r\n duration: {\r\n value: null,\r\n units: \"\",\r\n },\r\n target: {\r\n value: null,\r\n width: null,\r\n units: \"\",\r\n type: \"self\",\r\n },\r\n range: {\r\n value: null,\r\n long: null,\r\n units: \"\",\r\n },\r\n\r\n consume: {\r\n type: \"\",\r\n target: \"\",\r\n amount: null,\r\n },\r\n ability: \"\",\r\n actionType: \"util\",\r\n attackBonus: 0,\r\n chatFlavor: \"\",\r\n critical: null,\r\n damage: {\r\n parts: [],\r\n versatile: \"\",\r\n },\r\n formula: \"\",\r\n save: {\r\n ability: \"\",\r\n dc: null,\r\n scaling: \"spell\",\r\n },\r\n consumableType: \"trinket\",\r\n },\r\n sort: 0,\r\n flags: {\r\n \"midi-qol\": {\r\n onUseMacroName: \"\",\r\n },\r\n },\r\n };\r\n ECHItems[game.i18n.localize(\"enhancedcombathud-dnd5e.items.hide.name\")] = {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.items.hide.name\"),\r\n type: \"feat\",\r\n img: \"modules/enhancedcombathud/icons/cloak-dagger.webp\",\r\n system: {\r\n type: {\r\n value: \"\",\r\n subtype: \"\",\r\n },\r\n description: {\r\n value: game.i18n.localize(\"enhancedcombathud-dnd5e.items.hide.desc\"),\r\n chat: \"\",\r\n unidentified: \"\",\r\n },\r\n source: \"\",\r\n quantity: 1,\r\n weight: 0,\r\n price: 0,\r\n attuned: false,\r\n attunement: 0,\r\n equipped: false,\r\n rarity: \"\",\r\n identified: true,\r\n activation: {\r\n type: \"action\",\r\n cost: 1,\r\n condition: \"\",\r\n },\r\n duration: {\r\n value: null,\r\n units: \"\",\r\n },\r\n target: {\r\n value: null,\r\n width: null,\r\n units: \"\",\r\n type: \"self\",\r\n },\r\n range: {\r\n value: null,\r\n long: null,\r\n units: \"\",\r\n },\r\n\r\n consume: {\r\n type: \"\",\r\n target: \"\",\r\n amount: null,\r\n },\r\n recharge: {\r\n value: null,\r\n charged: false,\r\n },\r\n ability: \"\",\r\n actionType: \"util\",\r\n attackBonus: 0,\r\n chatFlavor: \"\",\r\n critical: null,\r\n damage: {\r\n parts: [],\r\n versatile: \"\",\r\n },\r\n formula: \"\",\r\n save: {\r\n ability: \"\",\r\n dc: null,\r\n scaling: \"spell\",\r\n },\r\n consumableType: \"trinket\",\r\n },\r\n sort: 0,\r\n flags: {\r\n \"midi-qol\": {\r\n onUseMacroName: \"\",\r\n },\r\n },\r\n };\r\n ECHItems[game.i18n.localize(\"enhancedcombathud-dnd5e.items.dash.name\")] = {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.items.dash.name\"),\r\n type: \"feat\",\r\n img: \"modules/enhancedcombathud/icons/walking-boot.webp\",\r\n system: {\r\n type: {\r\n value: \"\",\r\n subtype: \"\",\r\n },\r\n description: {\r\n value: game.i18n.localize(\"enhancedcombathud-dnd5e.items.dash.desc\"),\r\n chat: \"\",\r\n unidentified: \"\",\r\n },\r\n source: \"\",\r\n quantity: 1,\r\n weight: 0,\r\n price: 0,\r\n attuned: false,\r\n attunement: 0,\r\n equipped: false,\r\n rarity: \"\",\r\n identified: true,\r\n activation: {\r\n type: \"action\",\r\n cost: 1,\r\n condition: \"\",\r\n },\r\n duration: {\r\n value: null,\r\n units: \"\",\r\n },\r\n target: {\r\n value: null,\r\n width: null,\r\n units: \"\",\r\n type: \"self\",\r\n },\r\n range: {\r\n value: null,\r\n long: null,\r\n units: \"\",\r\n },\r\n\r\n consume: {\r\n type: \"\",\r\n target: \"\",\r\n amount: null,\r\n },\r\n ability: \"\",\r\n actionType: \"util\",\r\n attackBonus: 0,\r\n chatFlavor: \"\",\r\n critical: null,\r\n damage: {\r\n parts: [],\r\n versatile: \"\",\r\n },\r\n formula: \"\",\r\n save: {\r\n ability: \"\",\r\n dc: null,\r\n scaling: \"spell\",\r\n },\r\n consumableType: \"trinket\",\r\n },\r\n sort: 0,\r\n flags: {\r\n \"midi-qol\": {\r\n onUseMacroName: \"\",\r\n },\r\n },\r\n };\r\n ECHItems[game.i18n.localize(\"enhancedcombathud-dnd5e.items.shove.name\")] = {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.items.shove.name\"),\r\n type: \"feat\",\r\n img: \"modules/enhancedcombathud/icons/shield-bash.webp\",\r\n system: {\r\n type: {\r\n value: \"\",\r\n subtype: \"\",\r\n },\r\n description: {\r\n value: game.i18n.localize(\"enhancedcombathud-dnd5e.items.shove.desc\"),\r\n chat: \"\",\r\n unidentified: \"\",\r\n },\r\n source: \"\",\r\n quantity: 1,\r\n weight: 0,\r\n price: 0,\r\n attuned: false,\r\n attunement: 0,\r\n equipped: false,\r\n rarity: \"\",\r\n identified: true,\r\n activation: {\r\n type: \"action\",\r\n cost: 1,\r\n condition: \"\",\r\n },\r\n duration: {\r\n value: null,\r\n units: \"\",\r\n },\r\n target: {\r\n value: 1,\r\n width: null,\r\n units: \"\",\r\n type: \"creature\",\r\n },\r\n range: {\r\n value: null,\r\n long: null,\r\n units: \"touch\",\r\n },\r\n\r\n consume: {\r\n type: \"\",\r\n target: \"\",\r\n amount: null,\r\n },\r\n ability: \"\",\r\n actionType: \"util\",\r\n attackBonus: 0,\r\n chatFlavor: \"\",\r\n critical: null,\r\n damage: {\r\n parts: [],\r\n versatile: \"\",\r\n },\r\n formula: \"\",\r\n save: {\r\n ability: \"\",\r\n dc: null,\r\n scaling: \"spell\",\r\n },\r\n consumableType: \"trinket\",\r\n },\r\n sort: 0,\r\n flags: {\r\n \"midi-qol\": {\r\n onUseMacroName: \"\",\r\n },\r\n },\r\n };\r\n}\r\n","import { MODULE_ID } from \"./main.js\";\r\n\r\nexport function registerSettings() {\r\n const settings = {\r\n showWeaponsItems: {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.showWeaponsItems.name\"),\r\n hint: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.showWeaponsItems.hint\"),\r\n scope: \"world\",\r\n config: true,\r\n type: Boolean,\r\n default: false,\r\n onChange: (sett) => {\r\n ui.ARGON.constructor.DND5E.itemTypes.consumable = ui.ARGON.constructor.DND5E.itemTypes.consumable.filter(i => i !== \"weapon\");\r\n if(sett) ui.ARGON.constructor.DND5E.itemTypes.consumable.push(\"weapon\");\r\n ui.ARGON.refresh()\r\n },\r\n },\r\n showClassActions: {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.showClassActions.name\"),\r\n hint: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.showClassActions.hint\"),\r\n scope: \"world\",\r\n config: true,\r\n type: Boolean,\r\n default: true,\r\n onChange: (sett) => {\r\n ui.ARGON.constructor.DND5E.mainBarFeatures = ui.ARGON.constructor.DND5E.mainBarFeatures.filter(i => i !== \"class\");\r\n if(sett) ui.ARGON.constructor.DND5E.mainBarFeatures.push(\"class\");\r\n ui.ARGON.refresh()\r\n },\r\n },\r\n condenseClassActions: {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.condenseClassActions.name\"),\r\n hint: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.condenseClassActions.hint\"),\r\n scope: \"world\",\r\n config: true,\r\n type: Boolean,\r\n default: true,\r\n onChange: () => ui.ARGON.refresh(),\r\n },\r\n macroPanel: {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.macroPanel.name\"),\r\n hint: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.macroPanel.hint\"),\r\n scope: \"world\",\r\n config: true,\r\n type: Boolean,\r\n default: false,\r\n requiresReload: true,\r\n onChange: () => ui.ARGON.refresh(),\r\n },\r\n switchEquip: {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.switchEquip.name\"),\r\n hint: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.switchEquip.hint\"),\r\n scope: \"world\",\r\n config: true,\r\n type: Boolean,\r\n default: true,\r\n onChange: () => ui.ARGON.refresh(),\r\n },\r\n showSpecialActions: {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.showSpecialActions.name\"),\r\n hint: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.showSpecialActions.hint\"),\r\n scope: \"world\",\r\n config: true,\r\n type: Boolean,\r\n default: true,\r\n onChange: () => ui.ARGON.refresh(),\r\n },\r\n };\r\n\r\n registerSettingsArray(settings);\r\n}\r\n\r\nexport function getSetting(key) {\r\n return game.settings.get(MODULE_ID, key);\r\n}\r\n\r\nexport async function setSetting(key, value) {\r\n return await game.settings.set(MODULE_ID, key, value);\r\n}\r\n\r\nfunction registerSettingsArray(settings) {\r\n for(const [key, value] of Object.entries(settings)) {\r\n game.settings.register(MODULE_ID, key, value);\r\n }\r\n}","import {initConfig} from \"./config.js\";\r\nimport { registerSettings } from \"./settings.js\";\r\n\r\nexport const MODULE_ID = \"enhancedcombathud-dnd5e\";\r\n\r\nHooks.on(\"setup\", () => {\r\n registerSettings();\r\n initConfig();\r\n});"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","_regeneratorRuntime","Op","hasOwn","desc","value","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","protoGenerator","Generator","generator","create","context","Context","makeInvokeMethod","tryCatch","fn","arg","type","ContinueSentinel","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","method","_invoke","AsyncIterator","PromiseImpl","invoke","resolve","reject","record","result","_typeof","__await","then","unwrapped","error","previousPromise","callInvokeWithMethodAndArg","state","Error","doneResult","delegate","delegateResult","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","done","methodName","undefined","TypeError","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","length","i","displayName","isGeneratorFunction","genFun","ctor","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","iter","keys","val","object","reverse","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","_catch","thrown","delegateYield","asyncGeneratorStep","gen","_next","_throw","_asyncToGenerator","args","arguments","apply","_classCallCheck","instance","Constructor","_defineProperties","target","props","descriptor","_toPrimitive","input","hint","prim","toPrimitive","res","String","Number","_createClass","protoProps","staticProps","_get","Reflect","bind","property","receiver","base","_superPropBase","_getPrototypeOf","getOwnPropertyDescriptor","_inherits","subClass","superClass","_setPrototypeOf","p","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","construct","sham","Proxy","Boolean","valueOf","e","_createSuperInternal","Super","NewTarget","_possibleConstructorReturn","_assertThisInitialized","ReferenceError","ECHItems","initConfig","Hooks","on","CoreHUD","_game$modules$get","game","system","id","registerItems","i18n","localize","img","subtype","description","chat","unidentified","source","quantity","weight","price","attuned","attunement","equipped","rarity","identified","activation","cost","condition","duration","units","width","range","long","consume","amount","ability","actionType","attackBonus","chatFlavor","critical","damage","parts","versatile","formula","save","dc","scaling","sort","flags","core","sourceId","onUseMacroName","consumableType","recharge","charged","ARGON","DND5eTooltip","_ARGON$CORE$Tooltip","_super","concat","CORE","Tooltip","isMIDI","modules","active","getMidiFlag","_ui$ARGON$_actor$getF","_flag$actionType","ui","_actor","getFlag","getActivationType","item","_item$system","_Array$from$","activities","Array","from","getActionType","_item$system2","_Array$from$2","actionTypes","action","bonus","reaction","free","itemTypes","spell","feat","consumable","mainBarFeatures","settings","MODULE_ID","DND5E","callAll","DND5ePortraitPanel","_ARGON$PORTRAIT$Portr","_getStatBlocks","_onDeathSave2","_super2","_len","_key","_this$actor","this","actor","isPC","_CONFIG$DND5E$creatur","_CONFIG$DND5E$creatur2","creatureType","CONFIG","creatureTypes","details","label","custom","cr","classes","map","c","join","level","race","isDying","attributes","hp","_this$actor$system$at","_this$actor$system$at2","death","success","_this$actor$system$at3","_this$actor$system$at4","failure","_callee","event","_callee$","_context","rollDeathSave","_onDeathSave","_x3","_callee2","_this$actor$system$at5","_this$actor$system$at6","HPText","ACText","SpellDC","hpColor","tempMax","hpMaxColor","_callee2$","_context2","split","word","toUpperCase","replace","trim","temp","tempmax","text","color","max","ac","spelldc","getStatBlocks","PORTRAIT","PortraitPanel","DND5eDrawerButton","_ARGON$DRAWER$DrawerB","_getTooltipData","_super3","buttons","_this","TooltipManager","TOOLTIP_DIRECTIONS","RIGHT","_callee3","tooltipData","_callee3$","_context3","getTooltipDetails","getTooltipData","DRAWER","DrawerButton","DND5eDrawerPanel","_ARGON$DRAWER$DrawerP","_super4","_len2","_key2","_this2","abilities","skills","tools","tool","addSign","gridCols","captions","align","abilityData","onClick","rollAbilityCheck","mod","checkBonus","rollSavingThrow","skill","skillData","getProficiencyIcon","proficient","rollSkill","total","passive","style","rollToolCheck","abilityMod","proficiencyMultiplier","prof","DrawerPanel","DND5eActionActionPanel","_ARGON$MAIN$ActionPan","_getButtons2","_super5","_len3","_key3","_this$actor2","inCombat","_getMidiFlag","isActionUsed","_onNewRound","combat","updateActionUse","_callee4","spellItems","featItems","consumableItems","spellButton","specialActions","showSpecialActions","barItems","_callee4$","_context4","items","filter","_item$system$type","includes","_item$system$type2","_item$system$type3","DND5eButtonPanelButton","button","hasContents","DND5eItemButton","isWeaponSet","isPrimary","MAIN","BUTTONS","SplitButton","DND5eSpecialActionButton","_toConsumableArray","_item$system$type4","condenseItemButtons","_getButtons","ActionPanel","DND5eBonusActionPanel","_ARGON$MAIN$ActionPan2","_getButtons3","_super6","_len4","_key4","_this$actor3","_getMidiFlag2","_callee5","_loop","_i","_Object$entries","_this3","_callee5$","_context6","_Object$entries$_i","types","_loop$","_context5","_slicedToArray","_item$system$type5","entries","t0","_item$system$type6","DND5eReactionActionPanel","_ARGON$MAIN$ActionPan3","_getButtons4","_super7","_len5","_key5","_this$actor4","_getMidiFlag3","_callee6","_loop2","_i2","_Object$entries2","_this4","_callee6$","_context8","_Object$entries2$_i","_loop2$","_context7","_item$system$type7","_item$system$type8","DND5eFreeActionPanel","_ARGON$MAIN$ActionPan4","_getButtons5","_super8","_len6","_key6","_this$actor5","_callee7","_loop3","_i3","_Object$entries3","_this5","_callee7$","_context10","_Object$entries3$_i","_loop3$","_context9","_item$system$type9","_item$system$type10","DND5eLegActionPanel","_ARGON$MAIN$ActionPan5","_getButtons6","_super9","_len7","_key7","_this$actor6","_this$actor$system$re","_this$actor$system$re2","resources","legact","_this$actor$system$re3","_this$actor$system$re4","_callee8","_callee8$","_context11","inActionPanel","DND5eLairActionPanel","_ARGON$MAIN$ActionPan6","_getButtons7","_super10","_len8","_key8","_this$actor7","_this$actor$system$re5","lair","_callee9","_callee9$","_context12","DND5eMythicActionPanel","_ARGON$MAIN$ActionPan7","_getButtons8","_super11","_len9","_key9","_callee10","_callee10$","_context13","_ARGON$MAIN$BUTTONS$I","_render","_onRightClick2","_onLeftClick2","_getTooltipData2","_super12","_len10","_key10","_this$item","_canvas","_item$range$value","_item$range","_item$range$long","_item$range2","activity","touchRange","canvas","scene","grid","distance","normal","_item$target$affects","_item$target","_item$target2","_affects$count","affects","targetType","template","count","_this$activity","_this$activity2","_isWeaponSet","isReaction","parent","isMelee","_isPrimary","_callee11","_callee11$","_context14","propertiesLabel","_callee12","_callee12$","_context15","interceptNextDialog","currentTarget","use","legacy","consumeActionEconomy","_onLeftClick","_x4","_callee13","_this$activity3","_callee13$","_context16","sheet","render","_onRightClick","_x5","_callee14","_get2","_len11","_key11","weapons","_this6","_args17","_callee14$","_context17","_item$consume","updateItemButtons","_this$activity$consum","_this$activity$uses$v","_this$activity$uses","consumeType","_ammoItem$quantity","ammoItem","Math","floor","getProperty","_chargesItem$uses$val","_chargesItem$uses","chargesItem","uses","per","_game$combat","activationType","_i4","_Object$entries4","_Object$entries4$_i","combatant","components","main","ItemButton","_ARGON$MAIN$BUTTONS$B","_getPanel2","_super13","_ref","_this7","itemsWithSpells","_spells","prePrepareSpells","preparedFlag","some","className","_game$modules$get2","_this8","spellLevels","itemsToIgnore","_this$items$0$system$","_step","IWSAPI","api","_iterator","_createForOfIteratorHelper","_item$flags$itemsWit","_loop4","itemsInSpell","isUsableItem","_item$system$uses","_item$system$uses2","s","n","f","showPreparedOnly","allowIfNotPrepared","preparation","mode","prepared","spells","Infinity","pact","_loop5","_Object$entries5$_i","_Object$entries5","_i5","levelSpells","_callee15","_callee15$","_context18","BUTTON_PANELS","ACCORDION","AccordionPanel","accordionPanelCategories","_ref2","AccordionPanelCategory","ButtonPanel","_getPanel","ButtonPanelButton","_ARGON$MAIN$BUTTONS$A","_createChatMessage","_onLeftClick3","_getTooltipData3","_super14","specialItem","_this9","actorItem","getName","Item","documentClass","_this$item2","_callee16","_callee16$","_context19","_callee17","_game$modules$get3","useCE","_callee17$","_context20","dfreds","effectInterface","findEffect","effectName","toggleEffect","overlay","uuids","uuid","createChatMessage","_x6","_callee18","_callee18$","_context21","ChatMessage","user","speaker","token","alias","content","icon","ActionButton","DND5eMovementHud","_ARGON$MovementHud","_super15","_game$modules$get4","_this10","_len12","_key12","getMovementMode","_game$combat2","started","movement","movementMode","dimensions","MovementHud","DND5eButtonHud","_ARGON$ButtonHud","_getButtons9","_super16","_len13","_key13","_game$combat3","_callee19","_this11","_callee19$","_context22","longRest","shortRest","ButtonHud","DND5eWeaponSets","_ARGON$WeaponSets","_onSetChange2","_getSets2","_getDefaultSets","_super17","_callee20","_this$actor$flags","_actions$0$uuid","_actions$","_bonus$0$uuid","_bonus$","_actions$1$uuid","_actions$2","_bonus$1$uuid","_bonus$2","_actions$2$uuid","_actions$3","_bonus$2$uuid","_bonus$3","sets","isTransformed","actions","_callee20$","_context23","dnd5e","isPolymorphed","primary","secondary","getDefaultSets","_callee21","_this$actor$flags2","_i6","_Object$entries6","_Object$entries6$_i","slots","_callee21$","_context24","t1","foundry","utils","t2","t3","deepClone","mergeObject","fromUuid","t4","t5","_getSets","_callee22","_ref3","updates","activeSet","activeItems","inactiveSets","inactiveItems","_callee22$","_context25","set","flatMap","_item$system3","_id","_item$system4","updateEmbeddedDocuments","_onSetChange","_x7","WeaponSets","enableMacroPanel","mainPanels","PREFAB","MacroPanel","PassTurnPanel","definePortraitPanel","defineDrawerPanel","defineMainPanels","defineMovementHud","defineButtonHud","defineWeaponSets","defineTooltip","defineSupportedActorTypes","_x","_x2","_getTooltipDetails","_callee23","_item$labels4","_item$labels5","_damageTypes","_properties","title","itemType","subtitle","dt","damageTypes","properties","materialComponents","_item$system$descript","_item$labels","_item$labels2","_item$labels3","_i7","_Object$entries7","_Object$entries7$_i","_iterator2","_step2","comp","dmgString","tooltipProperties","_callee23$","_context26","labels","weaponTypes","weaponType","itemActionTypes","weaponProperties","school","spellSchools","all","abbr","materials","consumableTypes","requirements","TextEditor","enrichHTML","relativeTo","toHit","derivedDamage","dDmg","getDamageTypeIcon","damageType","d","_p$label","footerText","toLowerCase","proficiency","condensedItems","barItemsLength","barItemsMultipleOfTwo","currentSplitButtonItemButton","isCondensedButton","arr","_arrayWithHoles","isArray","_iterableToArrayLimit","_s","_e","_r","_arr","_n","_d","_unsupportedIterableToArray","minLen","_arrayLikeToArray","toString","test","_nonIterableRest","len","arr2","registerSettings","registerSettingsArray","register","showWeaponsItems","scope","config","default","onChange","sett","refresh","showClassActions","condenseClassActions","macroPanel","requiresReload","switchEquip"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"./index.js","mappings":";mBACA,IAAIA,EAAsB,CCA1BA,EAAwB,CAACC,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXF,EAAoBI,EAAEF,EAAYC,KAASH,EAAoBI,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDH,EAAwB,CAACS,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,wnFCClFI,oBAAA,SAAAA,sBAAA,OAAAb,CAAA,MAAAA,EAAA,GAAAc,EAAAV,OAAAM,UAAAK,EAAAD,EAAAH,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AMjqB,GAAGb,MAAMgrB,SAAS,GAEtCK,YAAa,CACTr0B,KAAM8F,KAAKI,KAAKC,SAAS,qDACzBlD,KAAM6C,KAAKI,KAAKC,SAAS,qDACzBwtB,MAAO,QACPC,QAAQ,EACRh4B,KAAMmJ,QACN8uB,SAAS,EACTC,SAAU,SAAAA,WAAA,OAAMjqB,GAAGb,MAAMgrB,SAAS,GAEtC9f,mBAAoB,CAChBlU,KAAM8F,KAAKI,KAAKC,SAAS,4DACzBlD,KAAM6C,KAAKI,KAAKC,SAAS,4DACzBwtB,MAAO,QACPC,QAAQ,EACRh4B,KAAMmJ,QACN8uB,SAAS,EACTC,SAAU,SAAAA,WAAA,OAAMjqB,GAAGb,MAAMgrB,SAAS,IAK9C,CCnEO,IAAM3oB,EAAY,0BAEzB3F,MAAMC,GAAG,SAAS,WACd4tB,mBACA9tB,YACJ","sources":["webpack:///webpack/bootstrap","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///./scripts/config.js","webpack:///./scripts/settings.js","webpack:///./scripts/main.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","import { MODULE_ID } from \"./main.js\";\r\n\r\nconst ECHItems = {};\r\n\r\nexport function initConfig() {\r\n Hooks.on(\"argonInit\", (CoreHUD) => {\r\n if (game.system.id !== \"dnd5e\") return;\r\n registerItems();\r\n const ARGON = CoreHUD.ARGON;\r\n\r\n class DND5eTooltip extends ARGON.CORE.Tooltip{\r\n get classes() {\r\n const original = super.classes;\r\n return original.concat([\"dnd5e2\"]);\r\n }\r\n }\r\n\r\n const isMIDI = game.modules.get(\"midi-qol\")?.active;\r\n const getMidiFlag = (actionType) => {\r\n if (!isMIDI || !ui.ARGON._actor) return null;\r\n const flag = ui.ARGON._actor.getFlag(\"midi-qol\", \"actions\") ?? {};\r\n const value = flag[actionType] ?? false;\r\n const midiAction = value ? 0 : 1;\r\n return midiAction;\r\n };\r\n\r\n const getActivationType = (item) => {\r\n if (!item?.system?.activities) {\r\n return;\r\n }\r\n return Array.from(item.system.activities)[0]?.activation?.type;\r\n };\r\n\r\n const getActionType = (item) => {\r\n if (!item?.system?.activities) {\r\n return;\r\n }\r\n return Array.from(item.system.activities)[0]?.actionType;\r\n };\r\n\r\n const actionTypes = {\r\n action: [\"action\"],\r\n bonus: [\"bonus\"],\r\n reaction: [\"reaction\", \"reactiondamage\", \"reactionmanual\"],\r\n free: [\"special\"],\r\n };\r\n\r\n const itemTypes = {\r\n spell: [\"spell\"],\r\n feat: [\"feat\"],\r\n consumable: [\"consumable\", \"equipment\", \"loot\"],\r\n };\r\n\r\n const mainBarFeatures = [];\r\n\r\n if (game.settings.get(MODULE_ID, \"showWeaponsItems\")) itemTypes.consumable.push(\"weapon\");\r\n if (game.settings.get(MODULE_ID, \"showClassActions\")) mainBarFeatures.push(\"class\");\r\n\r\n CoreHUD.DND5E = {\r\n actionTypes,\r\n itemTypes,\r\n mainBarFeatures,\r\n ECHItems,\r\n };\r\n\r\n Hooks.callAll(\"enhanced-combat-hud.dnd5e.initConfig\", { actionTypes, itemTypes, ECHItems });\r\n\r\n async function getTooltipDetails(item, type) {\r\n let title, description, itemType, subtitle, target, range, dt;\r\n let damageTypes = [];\r\n let properties = [];\r\n let materialComponents = \"\";\r\n\r\n if (type == \"skill\") {\r\n title = CONFIG.DND5E.skills[item].label;\r\n description = game.i18n.localize(`enhancedcombathud-dnd5e.skills.${item}.tooltip`);\r\n } else if (type == \"save\") {\r\n title = CONFIG.DND5E.abilities[item].label;\r\n description = game.i18n.localize(`enhancedcombathud-dnd5e.abilities.${item}.tooltip`);\r\n } else {\r\n if (!item || !item.system) return;\r\n\r\n title = item.name;\r\n description = item.system.identified ? item.system.description.value : item.system.description.unidentified ?? item.system.description.value;\r\n itemType = item.type;\r\n target = item.labels?.target || \"-\";\r\n range = item.labels?.range || \"-\";\r\n properties = [];\r\n dt = item.labels?.damageTypes?.split(\", \");\r\n damageTypes = dt && dt.length ? dt : [];\r\n materialComponents = \"\";\r\n\r\n switch (itemType) {\r\n case \"weapon\":\r\n subtitle = CONFIG.DND5E.weaponTypes[item.system.weaponType];\r\n properties.push(CONFIG.DND5E.itemActionTypes[getActionType(item)]);\r\n for (let [key, value] of Object.entries(item.system.properties)) {\r\n let prop = value && CONFIG.DND5E.weaponProperties[key] ? CONFIG.DND5E.weaponProperties[key] : undefined;\r\n if (prop) properties.push(prop);\r\n }\r\n break;\r\n case \"spell\":\r\n subtitle = `${item.labels.level} ${item.labels.school}`;\r\n properties.push(CONFIG.DND5E.spellSchools[item.system.school]);\r\n properties.push(item.labels.duration);\r\n properties.push(item.labels.save);\r\n for (let comp of item.labels.components.all) {\r\n properties.push(comp.abbr);\r\n }\r\n if (item.labels.materials) materialComponents = item.labels.materials;\r\n break;\r\n case \"consumable\":\r\n subtitle = CONFIG.DND5E.consumableTypes[item.system.consumableType];\r\n properties.push(CONFIG.DND5E.itemActionTypes[getActionType(item)]);\r\n break;\r\n case \"feat\":\r\n subtitle = item.system.requirements;\r\n properties.push(CONFIG.DND5E.itemActionTypes[getActionType(item)]);\r\n break;\r\n }\r\n }\r\n\r\n if (description) description = await TextEditor.enrichHTML(description, { async: true, relativeTo: item.parent });\r\n let details = [];\r\n if (target || range) {\r\n details = [\r\n {\r\n label: \"enhancedcombathud-dnd5e.tooltip.target.name\",\r\n value: target,\r\n },\r\n {\r\n label: \"enhancedcombathud-dnd5e.tooltip.range.name\",\r\n value: range,\r\n },\r\n ];\r\n }\r\n if (item?.labels?.toHit) {\r\n details.push({\r\n label: \"enhancedcombathud-dnd5e.tooltip.toHit.name\",\r\n value: item.labels.toHit,\r\n });\r\n }\r\n if (item?.labels?.derivedDamage?.length) {\r\n let dmgString = \"\";\r\n item.labels.derivedDamage.forEach((dDmg) => {\r\n dmgString += dDmg.formula + \" \" + getDamageTypeIcon(dDmg.damageType) + \" \";\r\n });\r\n details.push({\r\n label: \"enhancedcombathud-dnd5e.tooltip.damage.name\",\r\n value: dmgString,\r\n });\r\n }\r\n\r\n const tooltipProperties = [];\r\n if (damageTypes?.length) damageTypes.forEach((d) => tooltipProperties.push({ label: d, primary: true }));\r\n if (properties?.length) properties.forEach((p) => tooltipProperties.push({ label: p?.label ?? p, secondary: true }));\r\n return { title, description, subtitle, details, properties: tooltipProperties, footerText: materialComponents };\r\n }\r\n\r\n function getDamageTypeIcon(damageType) {\r\n switch (damageType.toLowerCase()) {\r\n case \"acid\":\r\n return '';\r\n case \"bludgeoning\":\r\n return '';\r\n case \"cold\":\r\n return '';\r\n case \"fire\":\r\n return '';\r\n case \"force\":\r\n return '';\r\n case \"lightning\":\r\n return '';\r\n case \"necrotic\":\r\n return '';\r\n case \"piercing\":\r\n return '';\r\n case \"poison\":\r\n return '';\r\n case \"psychic\":\r\n return '';\r\n case \"radiant\":\r\n return '';\r\n case \"slashing\":\r\n return '';\r\n case \"thunder\":\r\n return '';\r\n case \"healing\":\r\n return '';\r\n default:\r\n return \"\";\r\n }\r\n }\r\n\r\n function getProficiencyIcon(proficiency) {\r\n if (proficiency == 0) return ' ';\r\n else if (proficiency == 1) return ' ';\r\n else if (proficiency == 2) return ' ';\r\n else if (proficiency == 0.5) return ' ';\r\n else return ' ';\r\n }\r\n\r\n function condenseItemButtons(items) {\r\n const condenseClassActions = game.settings.get(MODULE_ID, \"condenseClassActions\");\r\n if (!condenseClassActions) return items.map((item) => new DND5eItemButton({ item, inActionPanel: true }));\r\n const condensedItems = [];\r\n const barItemsLength = items.length;\r\n const barItemsMultipleOfTwo = barItemsLength - (barItemsLength % 2);\r\n let currentSplitButtonItemButton = null;\r\n for (let i = 0; i < barItemsLength; i++) {\r\n const isCondensedButton = i < barItemsMultipleOfTwo;\r\n const item = items[i];\r\n if (isCondensedButton) {\r\n if (currentSplitButtonItemButton) {\r\n const button = new DND5eItemButton({ item, inActionPanel: false });\r\n condensedItems.push(new ARGON.MAIN.BUTTONS.SplitButton(currentSplitButtonItemButton, button));\r\n currentSplitButtonItemButton = null;\r\n } else {\r\n currentSplitButtonItemButton = new DND5eItemButton({ item, inActionPanel: false });\r\n }\r\n } else {\r\n condensedItems.push(new DND5eItemButton({ item, inActionPanel: true }));\r\n }\r\n }\r\n return condensedItems;\r\n }\r\n\r\n class DND5ePortraitPanel extends ARGON.PORTRAIT.PortraitPanel {\r\n constructor(...args) {\r\n super(...args);\r\n }\r\n\r\n get description() {\r\n const { type, system } = this.actor;\r\n const actor = this.actor;\r\n const isNPC = type === \"npc\";\r\n const isPC = type === \"character\";\r\n if (isNPC) {\r\n const creatureType = game.i18n.localize(CONFIG.DND5E.creatureTypes[actor.system.details.type.value]?.label ?? actor.system.details.type.custom);\r\n const cr = system.details.cr >= 1 || system.details.cr <= 0 ? system.details.cr : `1/${1 / system.details.cr}`;\r\n return `CR ${cr} ${creatureType}`;\r\n } else if (isPC) {\r\n const classes = Object.values(actor.classes)\r\n .map((c) => c.name)\r\n .join(\" / \");\r\n return `Level ${system.details.level} ${classes} (${system.details.race})`;\r\n } else {\r\n return \"\";\r\n }\r\n }\r\n\r\n get isDead() {\r\n return this.isDying && this.actor.type !== \"character\";\r\n }\r\n\r\n get isDying() {\r\n return this.actor.system.attributes.hp.value <= 0;\r\n }\r\n\r\n get successes() {\r\n return this.actor.system.attributes?.death?.success ?? 0;\r\n }\r\n\r\n get failures() {\r\n return this.actor.system.attributes?.death?.failure ?? 0;\r\n }\r\n\r\n get configurationTemplate() {\r\n return \"modules/enhancedcombathud-dnd5e/templates/argon-actor-config.hbs\";\r\n }\r\n\r\n async _onDeathSave(event) {\r\n this.actor.rollDeathSave({});\r\n }\r\n\r\n async getStatBlocks() {\r\n const HPText = game.i18n\r\n .localize(\"DND5E.HitPoints\")\r\n .split(\" \")\r\n .map((word) => word.charAt(0).toUpperCase())\r\n .join(\"\");\r\n const ACText = game.i18n\r\n .localize(\"DND5E.ArmorClass\")\r\n .split(\" \")\r\n .map((word) => word.charAt(0).toUpperCase())\r\n .join(\"\");\r\n const SpellDC = game.i18n.localize(\"DND5E.SaveDC\").replace(\"{ability}\", \"\").replace(\"{dc}\", \"\").trim();\r\n\r\n const hpColor = this.actor.system.attributes.hp.temp ? \"#6698f3\" : \"rgb(0 255 170)\";\r\n const tempMax = this.actor.system.attributes.hp.tempmax;\r\n const hpMaxColor = tempMax ? (tempMax > 0 ? \"rgb(222 91 255)\" : \"#ffb000\") : \"rgb(255 255 255)\";\r\n\r\n return [\r\n [\r\n {\r\n text: `${this.actor.system.attributes.hp.value + (this.actor.system.attributes.hp.temp ?? 0)}`,\r\n color: hpColor,\r\n },\r\n {\r\n text: `/`,\r\n },\r\n {\r\n text: `${this.actor.system.attributes.hp.max + (this.actor.system.attributes.hp.tempmax ?? 0)}`,\r\n color: hpMaxColor,\r\n },\r\n {\r\n text: HPText,\r\n },\r\n ],\r\n [\r\n {\r\n text: ACText,\r\n },\r\n {\r\n text: this.actor.system.attributes.ac.value,\r\n color: \"var(--ech-movement-baseMovement-background)\",\r\n },\r\n ],\r\n [\r\n {\r\n text: SpellDC,\r\n },\r\n {\r\n text: this.actor.system.attributes.spelldc,\r\n color: \"var(--ech-movement-baseMovement-background)\",\r\n },\r\n ],\r\n ];\r\n }\r\n }\r\n\r\n class DND5eDrawerButton extends ARGON.DRAWER.DrawerButton {\r\n constructor(buttons, item, type) {\r\n super(buttons);\r\n this.item = item;\r\n this.type = type;\r\n }\r\n\r\n get hasTooltip() {\r\n return true;\r\n }\r\n\r\n get tooltipOrientation() {\r\n return TooltipManager.TOOLTIP_DIRECTIONS.RIGHT;\r\n }\r\n\r\n async getTooltipData() {\r\n const tooltipData = await getTooltipDetails(this.item, this.type);\r\n return tooltipData;\r\n }\r\n }\r\n\r\n class DND5eDrawerPanel extends ARGON.DRAWER.DrawerPanel {\r\n constructor(...args) {\r\n super(...args);\r\n }\r\n\r\n get categories() {\r\n const abilities = this.actor.system.abilities;\r\n const skills = this.actor.system.skills;\r\n const tools = this.actor.itemTypes.tool;\r\n\r\n const addSign = (value) => {\r\n if (value >= 0) return `+${value}`;\r\n return value;\r\n };\r\n\r\n const abilitiesButtons = Object.keys(abilities).map((ability) => {\r\n const abilityData = abilities[ability];\r\n return new DND5eDrawerButton(\r\n [\r\n {\r\n label: CONFIG.DND5E.abilities[ability].label,\r\n onClick: (event) => this.actor.rollAbilityCheck({ability, event}),\r\n },\r\n {\r\n label: addSign(abilityData.mod + (abilityData.checkBonus || 0)),\r\n onClick: (event) => this.actor.rollAbilityCheck({ability, event}),\r\n },\r\n {\r\n label: addSign(abilityData.save),\r\n onClick: (event) => this.actor.rollSavingThrow({ability, event }),\r\n },\r\n ],\r\n ability,\r\n \"save\",\r\n );\r\n });\r\n\r\n const skillsButtons = Object.keys(skills).map((skill) => {\r\n const skillData = skills[skill];\r\n return new DND5eDrawerButton(\r\n [\r\n {\r\n label: getProficiencyIcon(skillData.proficient) + CONFIG.DND5E.skills[skill].label,\r\n onClick: (event) => this.actor.rollSkill({skill, event}),\r\n },\r\n {\r\n label: `${addSign(skillData.total)}(${skillData.passive})`,\r\n style: \"display: flex; justify-content: flex-end;\",\r\n },\r\n ],\r\n skill,\r\n \"skill\",\r\n );\r\n });\r\n\r\n const toolButtons = tools.map((tool) => {\r\n return new DND5eDrawerButton(\r\n [\r\n {\r\n label: getProficiencyIcon(tool.system.proficient) + tool.name,\r\n onClick: (event) => tool.rollToolCheck({ event }),\r\n },\r\n {\r\n label: addSign(abilities[tool.abilityMod].mod + tool.system.proficiencyMultiplier * this.actor.system.attributes.prof),\r\n },\r\n ],\r\n tool,\r\n );\r\n });\r\n\r\n return [\r\n {\r\n gridCols: \"5fr 2fr 2fr\",\r\n captions: [\r\n {\r\n label: \"Abilities\",\r\n align: \"left\",\r\n },\r\n {\r\n label: \"Check\",\r\n align: \"center\",\r\n },\r\n {\r\n label: \"Save\",\r\n align: \"center\",\r\n },\r\n ],\r\n align: [\"left\", \"center\", \"center\"],\r\n buttons: abilitiesButtons,\r\n },\r\n {\r\n gridCols: \"7fr 2fr\",\r\n captions: [\r\n {\r\n label: \"Skills\",\r\n },\r\n {\r\n label: \"\",\r\n },\r\n ],\r\n buttons: skillsButtons,\r\n },\r\n {\r\n gridCols: \"7fr 2fr\",\r\n captions: [\r\n {\r\n label: \"Tools\",\r\n },\r\n {\r\n label: \"\",\r\n },\r\n ],\r\n buttons: toolButtons,\r\n },\r\n ];\r\n }\r\n\r\n get title() {\r\n return `${game.i18n.localize(\"enhancedcombathud-dnd5e.hud.saves.name\")} / ${game.i18n.localize(\"enhancedcombathud-dnd5e.hud.skills.name\")} / ${game.i18n.localize(\"enhancedcombathud-dnd5e.hud.tools.name\")}`;\r\n }\r\n }\r\n\r\n class DND5eActionActionPanel extends ARGON.MAIN.ActionPanel {\r\n constructor(...args) {\r\n super(...args);\r\n }\r\n\r\n get label() {\r\n return \"DND5E.Action\";\r\n }\r\n\r\n get maxActions() {\r\n return this.actor?.inCombat ? 1 : null;\r\n }\r\n\r\n get currentActions() {\r\n return getMidiFlag(\"action\") ?? (this.isActionUsed ? 0 : 1);\r\n }\r\n\r\n _onNewRound(combat) {\r\n this.isActionUsed = false;\r\n this.updateActionUse();\r\n }\r\n\r\n async _getButtons() {\r\n const spellItems = this.actor.items.filter((item) => itemTypes.spell.includes(item.type) && actionTypes.action.includes(getActivationType(item)) && !CoreHUD.DND5E.mainBarFeatures.includes(item.system.type?.value));\r\n const featItems = this.actor.items.filter((item) => itemTypes.feat.includes(item.type) && actionTypes.action.includes(getActivationType(item)) && !CoreHUD.DND5E.mainBarFeatures.includes(item.system.type?.value));\r\n const consumableItems = this.actor.items.filter((item) => itemTypes.consumable.includes(item.type) && actionTypes.action.includes(getActivationType(item)) && !CoreHUD.DND5E.mainBarFeatures.includes(item.system.type?.value));\r\n\r\n const spellButton = !spellItems.length ? [] : [new DND5eButtonPanelButton({ type: \"spell\", items: spellItems, color: 0 })].filter((button) => button.hasContents);\r\n\r\n const specialActions = Object.values(ECHItems);\r\n\r\n const showSpecialActions = game.settings.get(MODULE_ID, \"showSpecialActions\");\r\n const buttons = [];\r\n if (showSpecialActions) {\r\n buttons.push(...[new DND5eItemButton({ item: null, isWeaponSet: true, isPrimary: true }), new ARGON.MAIN.BUTTONS.SplitButton(new DND5eSpecialActionButton(specialActions[0]), new DND5eSpecialActionButton(specialActions[1])), ...spellButton, new DND5eButtonPanelButton({ type: \"feat\", items: featItems, color: 0 }), new ARGON.MAIN.BUTTONS.SplitButton(new DND5eSpecialActionButton(specialActions[2]), new DND5eSpecialActionButton(specialActions[3])), new ARGON.MAIN.BUTTONS.SplitButton(new DND5eSpecialActionButton(specialActions[4]), new DND5eSpecialActionButton(specialActions[5])), new DND5eButtonPanelButton({ type: \"consumable\", items: consumableItems, color: 0 })]);\r\n } else {\r\n buttons.push(...[new DND5eItemButton({ item: null, isWeaponSet: true, isPrimary: true }), ...spellButton, new DND5eButtonPanelButton({ type: \"feat\", items: featItems, color: 0 }), new DND5eButtonPanelButton({ type: \"consumable\", items: consumableItems, color: 0 })]);\r\n }\r\n\r\n const barItems = this.actor.items.filter((item) => CoreHUD.DND5E.mainBarFeatures.includes(item.system.type?.value) && actionTypes.action.includes(getActivationType(item)));\r\n buttons.push(...condenseItemButtons(barItems));\r\n\r\n return buttons.filter((button) => button.hasContents || button.items == undefined || button.items.length);\r\n }\r\n }\r\n\r\n class DND5eBonusActionPanel extends ARGON.MAIN.ActionPanel {\r\n constructor(...args) {\r\n super(...args);\r\n }\r\n\r\n get label() {\r\n return \"DND5E.BonusAction\";\r\n }\r\n\r\n get maxActions() {\r\n return this.actor?.inCombat ? 1 : null;\r\n }\r\n\r\n get currentActions() {\r\n return getMidiFlag(\"bonus\") ?? (this.isActionUsed ? 0 : 1);\r\n }\r\n\r\n _onNewRound(combat) {\r\n this.isActionUsed = false;\r\n this.updateActionUse();\r\n }\r\n\r\n async _getButtons() {\r\n const buttons = [new DND5eItemButton({ item: null, isWeaponSet: true, isPrimary: false })];\r\n for (const [type, types] of Object.entries(itemTypes)) {\r\n const items = this.actor.items.filter((item) => types.includes(item.type) && actionTypes.bonus.includes(getActivationType(item)) && !CoreHUD.DND5E.mainBarFeatures.includes(item.system.type?.value));\r\n if (!items.length) continue;\r\n const button = new DND5eButtonPanelButton({ type, items, color: 1 });\r\n if (button.hasContents) buttons.push(button);\r\n }\r\n\r\n const barItems = this.actor.items.filter((item) => CoreHUD.DND5E.mainBarFeatures.includes(item.system.type?.value) && actionTypes.bonus.includes(getActivationType(item)));\r\n buttons.push(...condenseItemButtons(barItems));\r\n\r\n return buttons;\r\n }\r\n }\r\n\r\n class DND5eReactionActionPanel extends ARGON.MAIN.ActionPanel {\r\n constructor(...args) {\r\n super(...args);\r\n }\r\n\r\n get label() {\r\n return \"DND5E.Reaction\";\r\n }\r\n\r\n get maxActions() {\r\n return this.actor?.inCombat ? 1 : null;\r\n }\r\n\r\n get currentActions() {\r\n return getMidiFlag(\"reaction\") ?? (this.isActionUsed ? 0 : 1);\r\n }\r\n\r\n _onNewRound(combat) {\r\n this.isActionUsed = false;\r\n this.updateActionUse();\r\n }\r\n\r\n async _getButtons() {\r\n const buttons = [new DND5eItemButton({ item: null, isWeaponSet: true, isPrimary: true })];\r\n //buttons.push(new DND5eEquipmentButton({slot: 1}));\r\n for (const [type, types] of Object.entries(itemTypes)) {\r\n const items = this.actor.items.filter((item) => types.includes(item.type) && actionTypes.reaction.includes(getActivationType(item)) && !CoreHUD.DND5E.mainBarFeatures.includes(item.system.type?.value));\r\n if (!items.length) continue;\r\n const button = new DND5eButtonPanelButton({ type, items, color: 3 });\r\n if (button.hasContents) buttons.push(button);\r\n }\r\n\r\n const barItems = this.actor.items.filter((item) => CoreHUD.DND5E.mainBarFeatures.includes(item.system.type?.value) && actionTypes.reaction.includes(getActivationType(item)));\r\n buttons.push(...condenseItemButtons(barItems));\r\n\r\n return buttons;\r\n }\r\n }\r\n\r\n class DND5eFreeActionPanel extends ARGON.MAIN.ActionPanel {\r\n constructor(...args) {\r\n super(...args);\r\n }\r\n\r\n get label() {\r\n return \"DND5E.Special\";\r\n }\r\n\r\n get maxActions() {\r\n return this.actor?.inCombat ? 1 : null;\r\n }\r\n\r\n get currentActions() {\r\n return this.isActionUsed ? 0 : 1;\r\n }\r\n\r\n _onNewRound(combat) {\r\n this.isActionUsed = false;\r\n this.updateActionUse();\r\n }\r\n\r\n async _getButtons() {\r\n const buttons = [];\r\n\r\n for (const [type, types] of Object.entries(itemTypes)) {\r\n const items = this.actor.items.filter((item) => types.includes(item.type) && actionTypes.free.includes(getActivationType(item)) && !CoreHUD.DND5E.mainBarFeatures.includes(item.system.type?.value));\r\n if (!items.length) continue;\r\n const button = new DND5eButtonPanelButton({ type, items, color: 2 });\r\n if (button.hasContents) buttons.push(button);\r\n }\r\n\r\n const barItems = this.actor.items.filter((item) => CoreHUD.DND5E.mainBarFeatures.includes(item.system.type?.value) && actionTypes.free.includes(getActivationType(item)));\r\n buttons.push(...condenseItemButtons(barItems));\r\n\r\n return buttons;\r\n }\r\n }\r\n\r\n class DND5eLegActionPanel extends ARGON.MAIN.ActionPanel {\r\n constructor(...args) {\r\n super(...args);\r\n }\r\n\r\n get label() {\r\n return \"DND5E.LegendaryActionLabel\";\r\n }\r\n\r\n get maxActions() {\r\n return this.actor?.inCombat ? this.actor.system.resources?.legact?.max ?? null : null;\r\n }\r\n\r\n get currentActions() {\r\n return this.actor.system.resources?.legact?.value ?? null;\r\n }\r\n\r\n async _getButtons() {\r\n const buttons = [];\r\n const legendary = this.actor.items.filter((item) => getActivationType(item) === \"legendary\");\r\n legendary.forEach((item) => {\r\n buttons.push(new DND5eItemButton({ item, inActionPanel: true }));\r\n });\r\n return buttons;\r\n }\r\n }\r\n\r\n class DND5eLairActionPanel extends ARGON.MAIN.ActionPanel {\r\n constructor(...args) {\r\n super(...args);\r\n }\r\n\r\n get label() {\r\n return \"DND5E.LairActionLabel\";\r\n }\r\n\r\n get maxActions() {\r\n return this.actor?.inCombat ? 1 : null;\r\n }\r\n\r\n get currentActions() {\r\n return this.actor.system.resources.lair?.value * 1;\r\n }\r\n\r\n async _getButtons() {\r\n const buttons = [];\r\n const lair = this.actor.items.filter((item) => getActivationType(item) === \"lair\");\r\n lair.forEach((item) => {\r\n buttons.push(new DND5eItemButton({ item, inActionPanel: true }));\r\n });\r\n return buttons;\r\n }\r\n }\r\n\r\n class DND5eMythicActionPanel extends ARGON.MAIN.ActionPanel {\r\n constructor(...args) {\r\n super(...args);\r\n }\r\n\r\n get label() {\r\n return \"DND5E.MythicActionLabel\";\r\n }\r\n\r\n get maxActions() {\r\n return null; //this.actor?.inCombat ? 1 : null;\r\n }\r\n\r\n get currentActions() {\r\n return null; //this.actor.system.resources.mythic?.value * 1;\r\n }\r\n\r\n async _getButtons() {\r\n const buttons = [];\r\n const mythic = this.actor.items.filter((item) => getActivationType(item) === \"mythic\");\r\n mythic.forEach((item) => {\r\n buttons.push(new DND5eItemButton({ item, inActionPanel: true }));\r\n });\r\n return buttons;\r\n }\r\n }\r\n\r\n class DND5eItemButton extends ARGON.MAIN.BUTTONS.ItemButton {\r\n constructor(...args) {\r\n super(...args);\r\n }\r\n\r\n get activity() {\r\n if (!this.item?.system?.activities) {\r\n return;\r\n }\r\n return Array.from(this.item.system.activities)[0];\r\n }\r\n\r\n get hasTooltip() {\r\n return true;\r\n }\r\n\r\n get ranges() {\r\n const item = this.activity;\r\n const touchRange = item.range.units == \"touch\" ? canvas?.scene?.grid?.distance : null;\r\n return {\r\n normal: item?.range?.value ?? touchRange,\r\n long: item?.range?.long ?? null,\r\n };\r\n }\r\n\r\n get targets() {\r\n const item = this.activity;\r\n const validTargets = [\"creature\", \"ally\", \"enemy\"];\r\n const actionType = item.actionType;\r\n const affects = item.target?.affects ?? {};\r\n const targetType = affects.type;\r\n if (!item.target?.template?.units && validTargets.includes(targetType)) {\r\n return affects.count ?? 1;\r\n } else if (actionType === \"mwak\" || actionType === \"rwak\") {\r\n return affects.count || 1;\r\n }\r\n return null;\r\n }\r\n\r\n get visible() {\r\n if (!this._isWeaponSet) return super.visible;\r\n const isReaction = this.parent instanceof DND5eReactionActionPanel;\r\n const isMelee = this.activity?.actionType === \"mwak\";\r\n if (isReaction && !isMelee) return false;\r\n if (this._isPrimary) return super.visible;\r\n if (this.activity?.type?.value === \"shield\") return false;\r\n return super.visible;\r\n }\r\n\r\n async getTooltipData() {\r\n const tooltipData = await getTooltipDetails(this.item);\r\n tooltipData.propertiesLabel = \"enhancedcombathud-dnd5e.tooltip.properties.name\";\r\n return tooltipData;\r\n }\r\n\r\n async _onLeftClick(event) {\r\n ui.ARGON.interceptNextDialog(event.currentTarget);\r\n const used = await this.item.use({event, legacy: false}, {event});\r\n if (used) {\r\n DND5eItemButton.consumeActionEconomy(this.activity);\r\n }\r\n }\r\n\r\n async _onRightClick(event) {\r\n this.activity?.sheet?.render(true);\r\n }\r\n\r\n static consumeActionEconomy(item) {\r\n const activationType = getActivationType(item);\r\n let actionType = null;\r\n for (const [type, types] of Object.entries(actionTypes)) {\r\n if (types.includes(activationType)) actionType = type;\r\n }\r\n if (!actionType) return;\r\n if (game.combat?.combatant?.actor !== item.parent) actionType = \"reaction\";\r\n if (actionType === \"action\") {\r\n ui.ARGON.components.main[0].isActionUsed = true;\r\n ui.ARGON.components.main[0].updateActionUse();\r\n } else if (actionType === \"bonus\") {\r\n ui.ARGON.components.main[1].isActionUsed = true;\r\n ui.ARGON.components.main[1].updateActionUse();\r\n } else if (actionType === \"reaction\") {\r\n ui.ARGON.components.main[2].isActionUsed = true;\r\n ui.ARGON.components.main[2].updateActionUse();\r\n } else if (actionType === \"free\") {\r\n ui.ARGON.components.main[3].isActionUsed = true;\r\n ui.ARGON.components.main[3].updateActionUse();\r\n } else if (actionType === \"legendary\") {\r\n ui.ARGON.components.main[4].isActionUsed = true;\r\n }\r\n }\r\n\r\n async render(...args) {\r\n await super.render(...args);\r\n if (this.activity) {\r\n const weapons = this.actor.items.filter((item) => item.consume?.target === this.activity.id);\r\n ui.ARGON.updateItemButtons(weapons);\r\n }\r\n }\r\n\r\n get quantity() {\r\n if (!this.activity) return null;\r\n const showQuantityItemTypes = [\"consumable\"];\r\n const consumeType = this.activity?.consume?.type;\r\n const useAmmo = this.item.system.ammunition?.type;\r\n if (useAmmo) {\r\n const ammoItem = this.item.system.ammunitionOptions[0]?.item;\r\n if (!ammoItem) return null;\r\n return Math.floor((ammoItem.system.quantity ?? 0));\r\n } else if (consumeType === \"attribute\") {\r\n return Math.floor(getProperty(this.actor, this.activity.consume.target) / this.activity.consume.amount);\r\n } else if (consumeType === \"charges\") {\r\n const chargesItem = this.actor.items.get(this.activity.consume.target);\r\n if (!chargesItem) return null;\r\n return Math.floor((chargesItem.uses?.value ?? 0) / this.activity.consume.amount);\r\n } else if (showQuantityItemTypes.includes(this.item.type) && !this.activity.uses.max) {\r\n return this.item.system.quantity;\r\n } else if (this.activity.uses.value !== null && this.activity.uses.per !== null && this.activity.uses.max) {\r\n return this.activity.uses.value;\r\n }\r\n return null;\r\n }\r\n }\r\n\r\n class DND5eButtonPanelButton extends ARGON.MAIN.BUTTONS.ButtonPanelButton {\r\n constructor({ type, items, color }) {\r\n super();\r\n this.type = type;\r\n this.items = items;\r\n this.color = color;\r\n this.itemsWithSpells = [];\r\n this._spells = this.prePrepareSpells();\r\n }\r\n\r\n get hasContents() {\r\n return this._spells ? !!this._spells.length || !!this.itemsWithSpells.length : !!this.items.length;\r\n }\r\n\r\n get colorScheme() {\r\n return this.color;\r\n }\r\n\r\n get id() {\r\n return `${this.type}-${this.color}`;\r\n }\r\n\r\n get label() {\r\n switch (this.type) {\r\n case \"spell\":\r\n return \"enhancedcombathud-dnd5e.hud.castspell.name\";\r\n case \"feat\":\r\n return \"enhancedcombathud-dnd5e.hud.usepower.name\";\r\n case \"consumable\":\r\n return \"enhancedcombathud-dnd5e.hud.useitem.name\";\r\n }\r\n }\r\n\r\n get icon() {\r\n switch (this.type) {\r\n case \"spell\":\r\n return \"modules/enhancedcombathud/icons/spell-book.webp\";\r\n case \"feat\":\r\n return \"modules/enhancedcombathud/icons/mighty-force.webp\";\r\n case \"consumable\":\r\n return \"modules/enhancedcombathud/icons/drink-me.webp\";\r\n }\r\n }\r\n\r\n get showPreparedOnly() {\r\n if (this.actor.type !== \"character\") return false;\r\n const preparedFlag = this.actor.getFlag(MODULE_ID, \"showPrepared\");\r\n if (preparedFlag === \"all\") return false;\r\n if (preparedFlag === \"preparedOnly\") return true;\r\n const classes = Object.keys(this.actor.classes);\r\n const requiresPreparation = [\"cleric\", \"druid\", \"paladin\", \"wizard\", \"artificer\"].some((className) => classes.includes(className));\r\n return requiresPreparation;\r\n }\r\n\r\n prePrepareSpells() {\r\n if (this.type !== \"spell\") return;\r\n\r\n const spellLevels = CONFIG.DND5E.spellLevels;\r\n const itemsToIgnore = [];\r\n if (game.modules.get(\"items-with-spells-5e\")?.active) {\r\n const IWSAPI = game.modules.get(\"items-with-spells-5e\").api;\r\n const actionType = this.items[0].system.activation?.type;\r\n const spellItems = this.actor.items.filter((item) => item.flags[\"items-with-spells-5e\"]?.[\"item-spells\"]?.length);\r\n for (const item of spellItems) {\r\n const spellData = item.flags[\"items-with-spells-5e\"][\"item-spells\"];\r\n const itemsInSpell = spellData.map((spell) => this.actor.items.get(spell.id)).filter((item) => item && getActivationType(item) === actionType);\r\n if (!itemsInSpell.length) continue;\r\n itemsToIgnore.push(...itemsInSpell);\r\n if (!IWSAPI.isUsableItem(item)) continue;\r\n this.itemsWithSpells.push({\r\n label: item.name,\r\n buttons: itemsInSpell.map((item) => new DND5eItemButton({ item })),\r\n uses: () => {\r\n return { max: item.system.uses?.max, value: item.system.uses?.value };\r\n },\r\n });\r\n }\r\n this.items = this.items.filter((item) => !itemsToIgnore.includes(item));\r\n }\r\n if (this.showPreparedOnly) {\r\n const allowIfNotPrepared = [\"atwill\", \"innate\", \"pact\", \"always\"];\r\n this.items = this.items.filter((item) => {\r\n if (allowIfNotPrepared.includes(item.system.preparation.mode)) return true;\r\n if (item.system.level == 0) return true;\r\n return item.system.preparation.prepared;\r\n });\r\n }\r\n\r\n const spells = [\r\n ...this.itemsWithSpells,\r\n {\r\n label: \"DND5E.SpellPrepAtWill\",\r\n buttons: this.items.filter((item) => item.system.preparation.mode === \"atwill\").map((item) => new DND5eItemButton({ item })),\r\n uses: { max: Infinity, value: Infinity },\r\n },\r\n {\r\n label: \"DND5E.SpellPrepInnate\",\r\n buttons: this.items.filter((item) => item.system.preparation.mode === \"innate\").map((item) => new DND5eItemButton({ item })),\r\n uses: { max: Infinity, value: Infinity },\r\n },\r\n {\r\n label: Object.values(spellLevels)[0],\r\n buttons: this.items.filter((item) => item.system.level == 0).map((item) => new DND5eItemButton({ item })),\r\n uses: { max: Infinity, value: Infinity },\r\n },\r\n {\r\n label: \"DND5E.PactMagic\",\r\n buttons: this.items.filter((item) => item.system.preparation.mode === \"pact\").map((item) => new DND5eItemButton({ item })),\r\n uses: () => {\r\n return this.actor.system.spells.pact;\r\n },\r\n },\r\n ];\r\n for (const [level, label] of Object.entries(spellLevels)) {\r\n const levelSpells = this.items.filter((item) => item.system.level == level && (item.system.preparation.mode === \"prepared\" || item.system.preparation.mode === \"always\"));\r\n if (!levelSpells.length || level == 0) continue;\r\n spells.push({\r\n label,\r\n buttons: levelSpells.map((item) => new DND5eItemButton({ item })),\r\n uses: () => {\r\n return this.actor.system.spells[`spell${level}`];\r\n },\r\n });\r\n }\r\n return spells.filter((spell) => spell.buttons.length);\r\n }\r\n\r\n async _getPanel() {\r\n if (this.type === \"spell\") {\r\n return new ARGON.MAIN.BUTTON_PANELS.ACCORDION.AccordionPanel({ id: this.id, accordionPanelCategories: this._spells.map(({ label, buttons, uses }) => new ARGON.MAIN.BUTTON_PANELS.ACCORDION.AccordionPanelCategory({ label, buttons, uses })) });\r\n } else {\r\n return new ARGON.MAIN.BUTTON_PANELS.ButtonPanel({ id: this.id, buttons: this.items.map((item) => new DND5eItemButton({ item })) });\r\n }\r\n }\r\n }\r\n\r\n class DND5eSpecialActionButton extends ARGON.MAIN.BUTTONS.ActionButton {\r\n constructor(specialItem) {\r\n super();\r\n const actorItem = this.actor.items.getName(specialItem.name);\r\n this.actorItem = actorItem;\r\n this.item =\r\n actorItem ??\r\n new CONFIG.Item.documentClass(specialItem, {\r\n parent: this.actor,\r\n });\r\n }\r\n\r\n get label() {\r\n return this.item.name;\r\n }\r\n\r\n get icon() {\r\n return this.item.img;\r\n }\r\n\r\n get hasTooltip() {\r\n return true;\r\n }\r\n\r\n get activity() {\r\n if (!this.item?.system?.activities) {\r\n return;\r\n }\r\n return Array.from(this.item.system.activities)[0];\r\n }\r\n\r\n async getTooltipData() {\r\n const tooltipData = await getTooltipDetails(this.item);\r\n tooltipData.propertiesLabel = \"enhancedcombathud-dnd5e.tooltip.properties.name\";\r\n return tooltipData;\r\n }\r\n\r\n async _onLeftClick(event) {\r\n const useCE = game.modules.get(\"dfreds-convenient-effects\")?.active && game.dfreds.effectInterface.findEffect({ effectName: this.label });\r\n let success = false;\r\n if (useCE) {\r\n success = true;\r\n await game.dfreds.effectInterface.toggleEffect({ effectName: this.label, overlay: false, uuids: [this.actor.uuid] });\r\n } else {\r\n success = this.actorItem ? await this.activity.use({ event }, { event }) : await this.createChatMessage();\r\n }\r\n if (success) {\r\n DND5eItemButton.consumeActionEconomy(this.item);\r\n }\r\n }\r\n\r\n async createChatMessage() {\r\n return await ChatMessage.create({\r\n user: game.user,\r\n speaker: {\r\n actor: this.actor,\r\n token: this.actor.token,\r\n alias: this.actor.name,\r\n },\r\n content: `\r\n
\r\n\r\n
\r\n\r\n
\r\n \r\n
\r\n ${this.label}\r\n \r\n Feature\r\n \r\n
\r\n \r\n
\r\n\r\n
\r\n
\r\n ${this.item.system.description.value}\r\n
\r\n
\r\n
\r\n\r\n\r\n
\r\n `,\r\n });\r\n }\r\n }\r\n\r\n class DND5eMovementHud extends ARGON.MovementHud {\r\n constructor(...args) {\r\n super(...args);\r\n this.getMovementMode = game.modules.get(\"elevation-drag-ruler\")?.api?.getMovementMode;\r\n }\r\n\r\n get visible() {\r\n return game.combat?.started;\r\n }\r\n\r\n get movementMode() {\r\n return this.getMovementMode ? this.getMovementMode(this.token) : \"walk\";\r\n }\r\n\r\n get movementMax() {\r\n if (!this.actor) return 0;\r\n return this.actor.system.attributes.movement[this.movementMode] / canvas.scene.dimensions.distance;\r\n }\r\n }\r\n\r\n class DND5eButtonHud extends ARGON.ButtonHud {\r\n constructor(...args) {\r\n super(...args);\r\n }\r\n\r\n get visible() {\r\n return !game.combat?.started;\r\n }\r\n\r\n async _getButtons() {\r\n return [\r\n {\r\n label: \"DND5E.LongRest\",\r\n onClick: (event) => this.actor.longRest(),\r\n icon: \"fas fa-bed\",\r\n },\r\n {\r\n label: \"DND5E.ShortRest\",\r\n onClick: (event) => this.actor.shortRest(),\r\n icon: \"fas fa-coffee\",\r\n },\r\n ];\r\n }\r\n }\r\n\r\n class DND5eWeaponSets extends ARGON.WeaponSets {\r\n async getDefaultSets() {\r\n const sets = await super.getDefaultSets();\r\n const isTransformed = this.actor.flags?.dnd5e?.isPolymorphed;\r\n if (this.actor.type !== \"npc\" && !isTransformed) return sets;\r\n const actions = this.actor.items.filter((item) => item.type === \"weapon\" && getActivationType(item) === \"action\");\r\n const bonus = this.actor.items.filter((item) => item.type === \"weapon\" && getActivationType(item) === \"bonus\");\r\n return {\r\n 1: {\r\n primary: actions[0]?.uuid ?? null,\r\n secondary: bonus[0]?.uuid ?? null,\r\n },\r\n 2: {\r\n primary: actions[1]?.uuid ?? null,\r\n secondary: bonus[1]?.uuid ?? null,\r\n },\r\n 3: {\r\n primary: actions[2]?.uuid ?? null,\r\n secondary: bonus[2]?.uuid ?? null,\r\n },\r\n };\r\n }\r\n\r\n async _getSets() {\r\n const isTransformed = this.actor.flags?.dnd5e?.isPolymorphed;\r\n\r\n const sets = isTransformed ? await this.getDefaultSets() : foundry.utils.mergeObject(await this.getDefaultSets(), foundry.utils.deepClone(this.actor.getFlag(\"enhancedcombathud\", \"weaponSets\") || {}));\r\n\r\n for (const [set, slots] of Object.entries(sets)) {\r\n slots.primary = slots.primary ? await fromUuid(slots.primary) : null;\r\n slots.secondary = slots.secondary ? await fromUuid(slots.secondary) : null;\r\n }\r\n return sets;\r\n }\r\n\r\n async _onSetChange({ sets, active }) {\r\n const switchEquip = game.settings.get(\"enhancedcombathud-dnd5e\", \"switchEquip\");\r\n if (!switchEquip) return;\r\n const updates = [];\r\n const activeSet = sets[active];\r\n const activeItems = Object.values(activeSet).filter((item) => item);\r\n const inactiveSets = Object.values(sets).filter((set) => set !== activeSet);\r\n const inactiveItems = inactiveSets\r\n .flatMap((set) => Object.values(set))\r\n .filter((item) => item)\r\n .filter((item) => !activeItems.includes(item));\r\n activeItems.forEach((item) => {\r\n if (!item.system?.equipped) updates.push({ _id: item.id, \"system.equipped\": true });\r\n });\r\n inactiveItems.forEach((item) => {\r\n if (item.system?.equipped) updates.push({ _id: item.id, \"system.equipped\": false });\r\n });\r\n return await this.actor.updateEmbeddedDocuments(\"Item\", updates);\r\n }\r\n }\r\n\r\n const enableMacroPanel = game.settings.get(MODULE_ID, \"macroPanel\");\r\n\r\n const mainPanels = [DND5eActionActionPanel, DND5eBonusActionPanel, DND5eReactionActionPanel, DND5eFreeActionPanel, DND5eLegActionPanel, DND5eLairActionPanel, DND5eMythicActionPanel];\r\n if (enableMacroPanel) mainPanels.push(ARGON.PREFAB.MacroPanel);\r\n mainPanels.push(ARGON.PREFAB.PassTurnPanel);\r\n\r\n CoreHUD.definePortraitPanel(DND5ePortraitPanel);\r\n CoreHUD.defineDrawerPanel(DND5eDrawerPanel);\r\n CoreHUD.defineMainPanels(mainPanels);\r\n CoreHUD.defineMovementHud(DND5eMovementHud);\r\n CoreHUD.defineButtonHud(DND5eButtonHud);\r\n CoreHUD.defineWeaponSets(DND5eWeaponSets);\r\n CoreHUD.defineTooltip(DND5eTooltip);\r\n CoreHUD.defineSupportedActorTypes([\"character\", \"npc\"]);\r\n });\r\n}\r\n\r\nfunction registerItems() {\r\n ECHItems[game.i18n.localize(\"enhancedcombathud-dnd5e.items.disengage.name\")] = {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.items.disengage.name\"),\r\n type: \"feat\",\r\n img: \"modules/enhancedcombathud/icons/journey.webp\",\r\n system: {\r\n type: {\r\n value: \"\",\r\n subtype: \"\",\r\n },\r\n description: {\r\n value: game.i18n.localize(\"enhancedcombathud-dnd5e.items.disengage.desc\"),\r\n chat: \"\",\r\n unidentified: \"\",\r\n },\r\n source: \"\",\r\n quantity: 1,\r\n weight: 0,\r\n price: 0,\r\n attuned: false,\r\n attunement: 0,\r\n equipped: false,\r\n rarity: \"\",\r\n identified: true,\r\n activation: {\r\n type: \"action\",\r\n cost: 1,\r\n condition: \"\",\r\n },\r\n duration: {\r\n value: 1,\r\n units: \"turn\",\r\n },\r\n target: {\r\n value: null,\r\n width: null,\r\n units: \"\",\r\n type: \"self\",\r\n },\r\n range: {\r\n value: null,\r\n long: null,\r\n units: \"\",\r\n },\r\n consume: {\r\n type: \"\",\r\n target: \"\",\r\n amount: null,\r\n },\r\n ability: \"\",\r\n actionType: \"util\",\r\n attackBonus: 0,\r\n chatFlavor: \"\",\r\n critical: null,\r\n damage: {\r\n parts: [],\r\n versatile: \"\",\r\n },\r\n formula: \"\",\r\n save: {\r\n ability: \"\",\r\n dc: null,\r\n scaling: \"spell\",\r\n },\r\n },\r\n sort: 0,\r\n flags: {\r\n core: {\r\n sourceId: \"Item.wyQkeuZkttllAFB1\",\r\n },\r\n\r\n \"midi-qol\": {\r\n onUseMacroName: \"\",\r\n },\r\n },\r\n };\r\n ECHItems[game.i18n.localize(\"enhancedcombathud-dnd5e.items.dodge.name\")] = {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.items.dodge.name\"),\r\n type: \"feat\",\r\n img: \"modules/enhancedcombathud/icons/armor-upgrade.webp\",\r\n system: {\r\n type: {\r\n value: \"\",\r\n subtype: \"\",\r\n },\r\n description: {\r\n value: game.i18n.localize(\"enhancedcombathud-dnd5e.items.dodge.desc\"),\r\n chat: \"\",\r\n unidentified: \"\",\r\n },\r\n source: \"\",\r\n quantity: 1,\r\n weight: 0,\r\n price: 0,\r\n attuned: false,\r\n attunement: 0,\r\n equipped: false,\r\n rarity: \"\",\r\n identified: true,\r\n activation: {\r\n type: \"action\",\r\n cost: 1,\r\n condition: \"\",\r\n },\r\n duration: {\r\n value: 1,\r\n units: \"round\",\r\n },\r\n target: {\r\n value: null,\r\n width: null,\r\n units: \"\",\r\n type: \"self\",\r\n },\r\n range: {\r\n value: null,\r\n long: null,\r\n units: \"\",\r\n },\r\n\r\n consume: {\r\n type: \"\",\r\n target: \"\",\r\n amount: null,\r\n },\r\n ability: \"\",\r\n actionType: \"util\",\r\n attackBonus: 0,\r\n chatFlavor: \"\",\r\n critical: null,\r\n damage: {\r\n parts: [],\r\n versatile: \"\",\r\n },\r\n formula: \"\",\r\n save: {\r\n ability: \"\",\r\n dc: null,\r\n scaling: \"spell\",\r\n },\r\n consumableType: \"trinket\",\r\n },\r\n sort: 0,\r\n flags: {\r\n \"midi-qol\": {\r\n onUseMacroName: \"\",\r\n },\r\n },\r\n };\r\n ECHItems[game.i18n.localize(\"enhancedcombathud-dnd5e.items.ready.name\")] = {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.items.ready.name\"),\r\n type: \"feat\",\r\n img: \"modules/enhancedcombathud/icons/clockwork.webp\",\r\n system: {\r\n type: {\r\n value: \"\",\r\n subtype: \"\",\r\n },\r\n description: {\r\n value: game.i18n.localize(\"enhancedcombathud-dnd5e.items.ready.desc\"),\r\n chat: \"\",\r\n unidentified: \"\",\r\n },\r\n source: \"\",\r\n quantity: 1,\r\n weight: 0,\r\n price: 0,\r\n attuned: false,\r\n attunement: 0,\r\n equipped: false,\r\n rarity: \"\",\r\n identified: true,\r\n activation: {\r\n type: \"action\",\r\n cost: 1,\r\n condition: \"\",\r\n },\r\n duration: {\r\n value: null,\r\n units: \"\",\r\n },\r\n target: {\r\n value: null,\r\n width: null,\r\n units: \"\",\r\n type: \"self\",\r\n },\r\n range: {\r\n value: null,\r\n long: null,\r\n units: \"\",\r\n },\r\n\r\n consume: {\r\n type: \"\",\r\n target: \"\",\r\n amount: null,\r\n },\r\n ability: \"\",\r\n actionType: \"util\",\r\n attackBonus: 0,\r\n chatFlavor: \"\",\r\n critical: null,\r\n damage: {\r\n parts: [],\r\n versatile: \"\",\r\n },\r\n formula: \"\",\r\n save: {\r\n ability: \"\",\r\n dc: null,\r\n scaling: \"spell\",\r\n },\r\n consumableType: \"trinket\",\r\n },\r\n sort: 0,\r\n flags: {\r\n \"midi-qol\": {\r\n onUseMacroName: \"\",\r\n },\r\n },\r\n };\r\n ECHItems[game.i18n.localize(\"enhancedcombathud-dnd5e.items.hide.name\")] = {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.items.hide.name\"),\r\n type: \"feat\",\r\n img: \"modules/enhancedcombathud/icons/cloak-dagger.webp\",\r\n system: {\r\n type: {\r\n value: \"\",\r\n subtype: \"\",\r\n },\r\n description: {\r\n value: game.i18n.localize(\"enhancedcombathud-dnd5e.items.hide.desc\"),\r\n chat: \"\",\r\n unidentified: \"\",\r\n },\r\n source: \"\",\r\n quantity: 1,\r\n weight: 0,\r\n price: 0,\r\n attuned: false,\r\n attunement: 0,\r\n equipped: false,\r\n rarity: \"\",\r\n identified: true,\r\n activation: {\r\n type: \"action\",\r\n cost: 1,\r\n condition: \"\",\r\n },\r\n duration: {\r\n value: null,\r\n units: \"\",\r\n },\r\n target: {\r\n value: null,\r\n width: null,\r\n units: \"\",\r\n type: \"self\",\r\n },\r\n range: {\r\n value: null,\r\n long: null,\r\n units: \"\",\r\n },\r\n\r\n consume: {\r\n type: \"\",\r\n target: \"\",\r\n amount: null,\r\n },\r\n recharge: {\r\n value: null,\r\n charged: false,\r\n },\r\n ability: \"\",\r\n actionType: \"util\",\r\n attackBonus: 0,\r\n chatFlavor: \"\",\r\n critical: null,\r\n damage: {\r\n parts: [],\r\n versatile: \"\",\r\n },\r\n formula: \"\",\r\n save: {\r\n ability: \"\",\r\n dc: null,\r\n scaling: \"spell\",\r\n },\r\n consumableType: \"trinket\",\r\n },\r\n sort: 0,\r\n flags: {\r\n \"midi-qol\": {\r\n onUseMacroName: \"\",\r\n },\r\n },\r\n };\r\n ECHItems[game.i18n.localize(\"enhancedcombathud-dnd5e.items.dash.name\")] = {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.items.dash.name\"),\r\n type: \"feat\",\r\n img: \"modules/enhancedcombathud/icons/walking-boot.webp\",\r\n system: {\r\n type: {\r\n value: \"\",\r\n subtype: \"\",\r\n },\r\n description: {\r\n value: game.i18n.localize(\"enhancedcombathud-dnd5e.items.dash.desc\"),\r\n chat: \"\",\r\n unidentified: \"\",\r\n },\r\n source: \"\",\r\n quantity: 1,\r\n weight: 0,\r\n price: 0,\r\n attuned: false,\r\n attunement: 0,\r\n equipped: false,\r\n rarity: \"\",\r\n identified: true,\r\n activation: {\r\n type: \"action\",\r\n cost: 1,\r\n condition: \"\",\r\n },\r\n duration: {\r\n value: null,\r\n units: \"\",\r\n },\r\n target: {\r\n value: null,\r\n width: null,\r\n units: \"\",\r\n type: \"self\",\r\n },\r\n range: {\r\n value: null,\r\n long: null,\r\n units: \"\",\r\n },\r\n\r\n consume: {\r\n type: \"\",\r\n target: \"\",\r\n amount: null,\r\n },\r\n ability: \"\",\r\n actionType: \"util\",\r\n attackBonus: 0,\r\n chatFlavor: \"\",\r\n critical: null,\r\n damage: {\r\n parts: [],\r\n versatile: \"\",\r\n },\r\n formula: \"\",\r\n save: {\r\n ability: \"\",\r\n dc: null,\r\n scaling: \"spell\",\r\n },\r\n consumableType: \"trinket\",\r\n },\r\n sort: 0,\r\n flags: {\r\n \"midi-qol\": {\r\n onUseMacroName: \"\",\r\n },\r\n },\r\n };\r\n ECHItems[game.i18n.localize(\"enhancedcombathud-dnd5e.items.shove.name\")] = {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.items.shove.name\"),\r\n type: \"feat\",\r\n img: \"modules/enhancedcombathud/icons/shield-bash.webp\",\r\n system: {\r\n type: {\r\n value: \"\",\r\n subtype: \"\",\r\n },\r\n description: {\r\n value: game.i18n.localize(\"enhancedcombathud-dnd5e.items.shove.desc\"),\r\n chat: \"\",\r\n unidentified: \"\",\r\n },\r\n source: \"\",\r\n quantity: 1,\r\n weight: 0,\r\n price: 0,\r\n attuned: false,\r\n attunement: 0,\r\n equipped: false,\r\n rarity: \"\",\r\n identified: true,\r\n activation: {\r\n type: \"action\",\r\n cost: 1,\r\n condition: \"\",\r\n },\r\n duration: {\r\n value: null,\r\n units: \"\",\r\n },\r\n target: {\r\n value: 1,\r\n width: null,\r\n units: \"\",\r\n type: \"creature\",\r\n },\r\n range: {\r\n value: null,\r\n long: null,\r\n units: \"touch\",\r\n },\r\n\r\n consume: {\r\n type: \"\",\r\n target: \"\",\r\n amount: null,\r\n },\r\n ability: \"\",\r\n actionType: \"util\",\r\n attackBonus: 0,\r\n chatFlavor: \"\",\r\n critical: null,\r\n damage: {\r\n parts: [],\r\n versatile: \"\",\r\n },\r\n formula: \"\",\r\n save: {\r\n ability: \"\",\r\n dc: null,\r\n scaling: \"spell\",\r\n },\r\n consumableType: \"trinket\",\r\n },\r\n sort: 0,\r\n flags: {\r\n \"midi-qol\": {\r\n onUseMacroName: \"\",\r\n },\r\n },\r\n };\r\n}\r\n","import { MODULE_ID } from \"./main.js\";\r\n\r\nexport function registerSettings() {\r\n const settings = {\r\n showWeaponsItems: {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.showWeaponsItems.name\"),\r\n hint: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.showWeaponsItems.hint\"),\r\n scope: \"world\",\r\n config: true,\r\n type: Boolean,\r\n default: false,\r\n onChange: (sett) => {\r\n ui.ARGON.constructor.DND5E.itemTypes.consumable = ui.ARGON.constructor.DND5E.itemTypes.consumable.filter(i => i !== \"weapon\");\r\n if(sett) ui.ARGON.constructor.DND5E.itemTypes.consumable.push(\"weapon\");\r\n ui.ARGON.refresh()\r\n },\r\n },\r\n showClassActions: {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.showClassActions.name\"),\r\n hint: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.showClassActions.hint\"),\r\n scope: \"world\",\r\n config: true,\r\n type: Boolean,\r\n default: true,\r\n onChange: (sett) => {\r\n ui.ARGON.constructor.DND5E.mainBarFeatures = ui.ARGON.constructor.DND5E.mainBarFeatures.filter(i => i !== \"class\");\r\n if(sett) ui.ARGON.constructor.DND5E.mainBarFeatures.push(\"class\");\r\n ui.ARGON.refresh()\r\n },\r\n },\r\n condenseClassActions: {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.condenseClassActions.name\"),\r\n hint: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.condenseClassActions.hint\"),\r\n scope: \"world\",\r\n config: true,\r\n type: Boolean,\r\n default: true,\r\n onChange: () => ui.ARGON.refresh(),\r\n },\r\n macroPanel: {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.macroPanel.name\"),\r\n hint: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.macroPanel.hint\"),\r\n scope: \"world\",\r\n config: true,\r\n type: Boolean,\r\n default: false,\r\n requiresReload: true,\r\n onChange: () => ui.ARGON.refresh(),\r\n },\r\n switchEquip: {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.switchEquip.name\"),\r\n hint: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.switchEquip.hint\"),\r\n scope: \"world\",\r\n config: true,\r\n type: Boolean,\r\n default: true,\r\n onChange: () => ui.ARGON.refresh(),\r\n },\r\n showSpecialActions: {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.showSpecialActions.name\"),\r\n hint: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.showSpecialActions.hint\"),\r\n scope: \"world\",\r\n config: true,\r\n type: Boolean,\r\n default: true,\r\n onChange: () => ui.ARGON.refresh(),\r\n },\r\n };\r\n\r\n registerSettingsArray(settings);\r\n}\r\n\r\nexport function getSetting(key) {\r\n return game.settings.get(MODULE_ID, key);\r\n}\r\n\r\nexport async function setSetting(key, value) {\r\n return await game.settings.set(MODULE_ID, key, value);\r\n}\r\n\r\nfunction registerSettingsArray(settings) {\r\n for(const [key, value] of Object.entries(settings)) {\r\n game.settings.register(MODULE_ID, key, value);\r\n }\r\n}","import {initConfig} from \"./config.js\";\r\nimport { registerSettings } from \"./settings.js\";\r\n\r\nexport const MODULE_ID = \"enhancedcombathud-dnd5e\";\r\n\r\nHooks.on(\"setup\", () => {\r\n registerSettings();\r\n initConfig();\r\n});"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","_regeneratorRuntime","Op","hasOwn","desc","value","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","protoGenerator","Generator","generator","create","context","Context","makeInvokeMethod","tryCatch","fn","arg","type","ContinueSentinel","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","method","_invoke","AsyncIterator","PromiseImpl","invoke","resolve","reject","record","result","_typeof","__await","then","unwrapped","error","previousPromise","callInvokeWithMethodAndArg","state","Error","doneResult","delegate","delegateResult","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","done","methodName","undefined","TypeError","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","length","i","displayName","isGeneratorFunction","genFun","ctor","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","iter","keys","val","object","reverse","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","_catch","thrown","delegateYield","asyncGeneratorStep","gen","_next","_throw","_asyncToGenerator","args","arguments","apply","_classCallCheck","instance","Constructor","_defineProperties","target","props","descriptor","_toPrimitive","input","hint","prim","toPrimitive","res","String","Number","_createClass","protoProps","staticProps","_get","Reflect","bind","property","receiver","base","_superPropBase","_getPrototypeOf","getOwnPropertyDescriptor","_inherits","subClass","superClass","_setPrototypeOf","p","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","construct","sham","Proxy","Boolean","valueOf","e","_createSuperInternal","Super","NewTarget","_possibleConstructorReturn","_assertThisInitialized","ReferenceError","ECHItems","initConfig","Hooks","on","CoreHUD","_game$modules$get","game","system","id","registerItems","i18n","localize","img","subtype","description","chat","unidentified","source","quantity","weight","price","attuned","attunement","equipped","rarity","identified","activation","cost","condition","duration","units","width","range","long","consume","amount","ability","actionType","attackBonus","chatFlavor","critical","damage","parts","versatile","formula","save","dc","scaling","sort","flags","core","sourceId","onUseMacroName","consumableType","recharge","charged","ARGON","DND5eTooltip","_ARGON$CORE$Tooltip","_super","concat","CORE","Tooltip","isMIDI","modules","active","getMidiFlag","_ui$ARGON$_actor$getF","_flag$actionType","ui","_actor","getFlag","getActivationType","item","_item$system","_Array$from$","activities","Array","from","getActionType","_item$system2","_Array$from$2","actionTypes","action","bonus","reaction","free","itemTypes","spell","feat","consumable","mainBarFeatures","settings","MODULE_ID","DND5E","callAll","DND5ePortraitPanel","_ARGON$PORTRAIT$Portr","_getStatBlocks","_onDeathSave2","_super2","_len","_key","_this$actor","this","actor","isPC","_CONFIG$DND5E$creatur","_CONFIG$DND5E$creatur2","creatureType","CONFIG","creatureTypes","details","label","custom","cr","classes","map","c","join","level","race","isDying","attributes","hp","_this$actor$system$at","_this$actor$system$at2","death","success","_this$actor$system$at3","_this$actor$system$at4","failure","_callee","event","_callee$","_context","rollDeathSave","_onDeathSave","_x3","_callee2","_this$actor$system$at5","_this$actor$system$at6","HPText","ACText","SpellDC","hpColor","tempMax","hpMaxColor","_callee2$","_context2","split","word","toUpperCase","replace","trim","temp","tempmax","text","color","max","ac","spelldc","getStatBlocks","PORTRAIT","PortraitPanel","DND5eDrawerButton","_ARGON$DRAWER$DrawerB","_getTooltipData","_super3","buttons","_this","TooltipManager","TOOLTIP_DIRECTIONS","RIGHT","_callee3","tooltipData","_callee3$","_context3","getTooltipDetails","getTooltipData","DRAWER","DrawerButton","DND5eDrawerPanel","_ARGON$DRAWER$DrawerP","_super4","_len2","_key2","_this2","abilities","skills","tools","tool","addSign","gridCols","captions","align","abilityData","onClick","rollAbilityCheck","mod","checkBonus","rollSavingThrow","skill","skillData","getProficiencyIcon","proficient","rollSkill","total","passive","style","rollToolCheck","abilityMod","proficiencyMultiplier","prof","DrawerPanel","DND5eActionActionPanel","_ARGON$MAIN$ActionPan","_getButtons2","_super5","_len3","_key3","_this$actor2","inCombat","_getMidiFlag","isActionUsed","_onNewRound","combat","updateActionUse","_callee4","spellItems","featItems","consumableItems","spellButton","specialActions","showSpecialActions","barItems","_callee4$","_context4","items","filter","_item$system$type","includes","_item$system$type2","_item$system$type3","DND5eButtonPanelButton","button","hasContents","DND5eItemButton","isWeaponSet","isPrimary","MAIN","BUTTONS","SplitButton","DND5eSpecialActionButton","_toConsumableArray","_item$system$type4","condenseItemButtons","_getButtons","ActionPanel","DND5eBonusActionPanel","_ARGON$MAIN$ActionPan2","_getButtons3","_super6","_len4","_key4","_this$actor3","_getMidiFlag2","_callee5","_loop","_i","_Object$entries","_this3","_callee5$","_context6","_Object$entries$_i","types","_loop$","_context5","_slicedToArray","_item$system$type5","entries","t0","_item$system$type6","DND5eReactionActionPanel","_ARGON$MAIN$ActionPan3","_getButtons4","_super7","_len5","_key5","_this$actor4","_getMidiFlag3","_callee6","_loop2","_i2","_Object$entries2","_this4","_callee6$","_context8","_Object$entries2$_i","_loop2$","_context7","_item$system$type7","_item$system$type8","DND5eFreeActionPanel","_ARGON$MAIN$ActionPan4","_getButtons5","_super8","_len6","_key6","_this$actor5","_callee7","_loop3","_i3","_Object$entries3","_this5","_callee7$","_context10","_Object$entries3$_i","_loop3$","_context9","_item$system$type9","_item$system$type10","DND5eLegActionPanel","_ARGON$MAIN$ActionPan5","_getButtons6","_super9","_len7","_key7","_this$actor6","_this$actor$system$re","_this$actor$system$re2","resources","legact","_this$actor$system$re3","_this$actor$system$re4","_callee8","_callee8$","_context11","inActionPanel","DND5eLairActionPanel","_ARGON$MAIN$ActionPan6","_getButtons7","_super10","_len8","_key8","_this$actor7","_this$actor$system$re5","lair","_callee9","_callee9$","_context12","DND5eMythicActionPanel","_ARGON$MAIN$ActionPan7","_getButtons8","_super11","_len9","_key9","_callee10","_callee10$","_context13","_ARGON$MAIN$BUTTONS$I","_render","_onRightClick2","_onLeftClick2","_getTooltipData2","_super12","_len10","_key10","_this$item","_canvas","_item$range$value","_item$range","_item$range$long","_item$range2","activity","touchRange","canvas","scene","grid","distance","normal","_item$target$affects","_item$target","_item$target2","_affects$count","affects","targetType","template","count","_this$activity","_this$activity2","_isWeaponSet","isReaction","parent","isMelee","_isPrimary","_callee11","_callee11$","_context14","propertiesLabel","_callee12","_callee12$","_context15","interceptNextDialog","currentTarget","use","legacy","consumeActionEconomy","_onLeftClick","_x4","_callee13","_this$activity3","_callee13$","_context16","sheet","render","_onRightClick","_x5","_callee14","_get2","_len11","_key11","weapons","_this6","_args17","_callee14$","_context17","_item$consume","updateItemButtons","_this$activity4","_this$item$system$amm","consumeType","ammunition","_this$item$system$amm2","_ammoItem$system$quan","ammoItem","ammunitionOptions","Math","floor","getProperty","_chargesItem$uses$val","_chargesItem$uses","chargesItem","uses","per","_game$combat","activationType","_i4","_Object$entries4","_Object$entries4$_i","combatant","components","main","ItemButton","_ARGON$MAIN$BUTTONS$B","_getPanel2","_super13","_ref","_this7","itemsWithSpells","_spells","prePrepareSpells","preparedFlag","some","className","_game$modules$get2","_this8","spellLevels","itemsToIgnore","_this$items$0$system$","_step","IWSAPI","api","_iterator","_createForOfIteratorHelper","_item$flags$itemsWit","_loop4","itemsInSpell","isUsableItem","_item$system$uses","_item$system$uses2","s","n","f","showPreparedOnly","allowIfNotPrepared","preparation","mode","prepared","spells","Infinity","pact","_loop5","_Object$entries5$_i","_Object$entries5","_i5","levelSpells","_callee15","_callee15$","_context18","BUTTON_PANELS","ACCORDION","AccordionPanel","accordionPanelCategories","_ref2","AccordionPanelCategory","ButtonPanel","_getPanel","ButtonPanelButton","_ARGON$MAIN$BUTTONS$A","_createChatMessage","_onLeftClick3","_getTooltipData3","_super14","specialItem","_this9","actorItem","getName","Item","documentClass","_this$item2","_callee16","_callee16$","_context19","_callee17","_game$modules$get3","useCE","_callee17$","_context20","dfreds","effectInterface","findEffect","effectName","toggleEffect","overlay","uuids","uuid","createChatMessage","_x6","_callee18","_callee18$","_context21","ChatMessage","user","speaker","token","alias","content","icon","ActionButton","DND5eMovementHud","_ARGON$MovementHud","_super15","_game$modules$get4","_this10","_len12","_key12","getMovementMode","_game$combat2","started","movement","movementMode","dimensions","MovementHud","DND5eButtonHud","_ARGON$ButtonHud","_getButtons9","_super16","_len13","_key13","_game$combat3","_callee19","_this11","_callee19$","_context22","longRest","shortRest","ButtonHud","DND5eWeaponSets","_ARGON$WeaponSets","_onSetChange2","_getSets2","_getDefaultSets","_super17","_callee20","_this$actor$flags","_actions$0$uuid","_actions$","_bonus$0$uuid","_bonus$","_actions$1$uuid","_actions$2","_bonus$1$uuid","_bonus$2","_actions$2$uuid","_actions$3","_bonus$2$uuid","_bonus$3","sets","isTransformed","actions","_callee20$","_context23","dnd5e","isPolymorphed","primary","secondary","getDefaultSets","_callee21","_this$actor$flags2","_i6","_Object$entries6","_Object$entries6$_i","slots","_callee21$","_context24","t1","foundry","utils","t2","t3","deepClone","mergeObject","fromUuid","t4","t5","_getSets","_callee22","_ref3","updates","activeSet","activeItems","inactiveSets","inactiveItems","_callee22$","_context25","set","flatMap","_item$system3","_id","_item$system4","updateEmbeddedDocuments","_onSetChange","_x7","WeaponSets","enableMacroPanel","mainPanels","PREFAB","MacroPanel","PassTurnPanel","definePortraitPanel","defineDrawerPanel","defineMainPanels","defineMovementHud","defineButtonHud","defineWeaponSets","defineTooltip","defineSupportedActorTypes","_x","_x2","_getTooltipDetails","_callee23","_item$labels4","_item$labels5","_damageTypes","_properties","title","itemType","subtitle","dt","damageTypes","properties","materialComponents","_item$system$descript","_item$labels","_item$labels2","_item$labels3","_i7","_Object$entries7","_Object$entries7$_i","_iterator2","_step2","comp","dmgString","tooltipProperties","_callee23$","_context26","labels","weaponTypes","weaponType","itemActionTypes","weaponProperties","school","spellSchools","all","abbr","materials","consumableTypes","requirements","TextEditor","enrichHTML","relativeTo","toHit","derivedDamage","dDmg","getDamageTypeIcon","damageType","d","_p$label","footerText","toLowerCase","proficiency","condensedItems","barItemsLength","barItemsMultipleOfTwo","currentSplitButtonItemButton","isCondensedButton","arr","_arrayWithHoles","isArray","_iterableToArrayLimit","_s","_e","_r","_arr","_n","_d","_unsupportedIterableToArray","minLen","_arrayLikeToArray","toString","test","_nonIterableRest","len","arr2","registerSettings","registerSettingsArray","register","showWeaponsItems","scope","config","default","onChange","sett","refresh","showClassActions","condenseClassActions","macroPanel","requiresReload","switchEquip"],"sourceRoot":""} \ No newline at end of file diff --git a/scripts/config.js b/scripts/config.js index 206fdc6..11b081f 100644 --- a/scripts/config.js +++ b/scripts/config.js @@ -818,19 +818,20 @@ export function initConfig() { get quantity() { if (!this.activity) return null; const showQuantityItemTypes = ["consumable"]; - const consumeType = this.activity.consume?.type; - if (consumeType === "ammo") { - const ammoItem = this.actor.items.get(this.activity.consume.target); + const consumeType = this.activity?.consume?.type; + const useAmmo = this.item.system.ammunition?.type; + if (useAmmo) { + const ammoItem = this.item.system.ammunitionOptions[0]?.item; if (!ammoItem) return null; - return Math.floor((ammoItem.quantity ?? 0) / this.activity.consume.amount); + return Math.floor((ammoItem.system.quantity ?? 0)); } else if (consumeType === "attribute") { return Math.floor(getProperty(this.actor, this.activity.consume.target) / this.activity.consume.amount); } else if (consumeType === "charges") { const chargesItem = this.actor.items.get(this.activity.consume.target); if (!chargesItem) return null; return Math.floor((chargesItem.uses?.value ?? 0) / this.activity.consume.amount); - } else if (showQuantityItemTypes.includes(this.activity.type)) { - return this.activity.uses?.value ?? this.activity.quantity; + } else if (showQuantityItemTypes.includes(this.item.type) && !this.activity.uses.max) { + return this.item.system.quantity; } else if (this.activity.uses.value !== null && this.activity.uses.per !== null && this.activity.uses.max) { return this.activity.uses.value; }