diff --git a/index.js b/index.js index 15ef06e..d1f2776 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\" || actionType === \"msak\" || actionType === \"rsak\") {\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 +{"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,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,CACRt0B,KAAM8F,KAAKI,KAAKC,SAAS,oDACzBlD,KAAM6C,KAAKI,KAAKC,SAAS,oDACzB2tB,MAAO,QACPC,QAAQ,EACRn4B,KAAMmJ,QACNivB,SAAS,EACTO,gBAAgB,EAChBN,SAAU,SAAAA,WAAA,OAAMpqB,GAAGb,MAAMmrB,SAAS,GAEtCK,YAAa,CACTx0B,KAAM8F,KAAKI,KAAKC,SAAS,qDACzBlD,KAAM6C,KAAKI,KAAKC,SAAS,qDACzB2tB,MAAO,QACPC,QAAQ,EACRn4B,KAAMmJ,QACNivB,SAAS,EACTC,SAAU,SAAAA,WAAA,OAAMpqB,GAAGb,MAAMmrB,SAAS,GAEtCjgB,mBAAoB,CAChBlU,KAAM8F,KAAKI,KAAKC,SAAS,4DACzBlD,KAAM6C,KAAKI,KAAKC,SAAS,4DACzB2tB,MAAO,QACPC,QAAQ,EACRn4B,KAAMmJ,QACNivB,SAAS,EACTC,SAAU,SAAAA,WAAA,OAAMpqB,GAAGb,MAAMmrB,SAAS,IAK9C,CCnEO,IAAM9oB,EAAY,0BAEzB3F,MAAMC,GAAG,SAAS,WACd+tB,mBACAjuB,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 console.log(\"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 (validTargets.includes(targetType) && affects.count) {\r\n return affects.count;\r\n } else if (actionType === \"mwak\" || actionType === \"rwak\" || actionType === \"msak\" || actionType === \"rsak\") {\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","console","log","_affects$count","validTargets","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 a11ea4f..aa74749 100644 --- a/scripts/config.js +++ b/scripts/config.js @@ -741,6 +741,7 @@ export function initConfig() { } get targets() { + console.log("Targets") const item = this.activity; const validTargets = ["creature", "ally", "enemy"]; const actionType = item.actionType; @@ -748,6 +749,8 @@ export function initConfig() { const targetType = affects.type; if (!item.target?.template?.units && validTargets.includes(targetType)) { return affects.count ?? 1; + } else if (validTargets.includes(targetType) && affects.count) { + return affects.count; } else if (actionType === "mwak" || actionType === "rwak" || actionType === "msak" || actionType === "rsak") { return affects.count || 1; }