diff --git a/5eShaped/5eShaped.html b/5eShaped/5eShaped.html
index 3253c7234d..405f99aa5c 100644
--- a/5eShaped/5eShaped.html
+++ b/5eShaped/5eShaped.html
@@ -6,7 +6,7 @@
'use strict';Object.defineProperty(exports,"__esModule",{value:true});exports.AbilitiesUtil=undefined;var _createClass=function(){function defineProperties(target,props){for(var i=0;i=expertise){if((0,_utilities.exists)(data.expertise_as_advantage)){if(data.dice_system==='2d10'){data[repStringNew+'_skill_d20']='3d10kh2';}else if(data.dice_system==='3d6'){data[repStringNew+'_skill_d20']='4d6kh3';}else{data[repStringNew+'_skill_d20']='2d20kh1';}data[repStringNew+'_proficiency']='proficient';}else{data[repStringNew+'_proficiency']='expertise';}if(skillBonus>expertise){data[modifierRepString+'_name']='Skill import modifiers';data[modifierRepString+'_skill_'+_constants.SKILLS.indexOf(skillName.toUpperCase())+'_modifier']=skillBonus-expertise;}}else if(skillBonus>=pb){data[repStringNew+'_proficiency']='proficient';if(skillBonus>pb){data[modifierRepString+'_name']='Skill import modifiers';data[modifierRepString+'_skill_'+_constants.SKILLS.indexOf(skillName.toUpperCase())+'_modifier']=skillBonus-pb;}}}else{console.warn(skillName+' does not exist in the list of skills');}}}}},callback:function callback(){_this4.updateSkill();}});}},{key:'setup',value:function setup(){var _this5=this;var abilityCheckWatch=_constants.FIELDS.pb.concat(['initiative_ability','initiative_to_tracker','initiative_tie_breaker']).concat(['class_feature_bard_jack_of_all_trades_toggle','class_feature_fighter_champion_remarkable_athlete_toggle']).concat(_constants.ABILITIES);on(abilityCheckWatch.map(function(field){return'change:'+field;}).join(' '),function(){_this5.update();});on('change:repeating_skill',function(eventInfo){var repeatingInfo=(0,_utilities.getRepeatingInfo)('repeating_skill',eventInfo);if(repeatingInfo&&repeatingInfo.field==='prof_toggle'){_this5.updateSkillToggle(repeatingInfo);}if(repeatingInfo&&repeatingInfo.field!=='prof_toggle'&&repeatingInfo.field!=='total'&&repeatingInfo.field!=='total_with_sign'&&repeatingInfo.field!=='passive_total'&&repeatingInfo.field!=='passive_total_with_sign'&&repeatingInfo.field!=='formula'){_this5.updateSkill();}});var updateSkillWatch=_constants.FIELDS.pb.concat(['class_feature_bard_jack_of_all_trades_toggle','class_feature_fighter_champion_remarkable_athlete_toggle','class_feature_rogue_reliable_talent_toggle']).concat(_constants.ABILITIES).concat(_constants.ABILITIES.map(function(ability){return ability+'_check_formula';}));updateSkillWatch=updateSkillWatch.map(function(ability){return'change:'+ability;}).join(' ');on(updateSkillWatch,function(){_this5.updateSkill();});on('change:skills_srd',function(){_this5.updateSkillsFromSRD();});on('change:_reporder_repeating_skill remove:repeating_skill change:honor_toggle change:sanity_toggle',function(){_this5.updateMacro();});}}]);return AbilityChecks;}();
+'use strict';Object.defineProperty(exports,"__esModule",{value:true});exports.AbilityChecks=undefined;var _createClass=function(){function defineProperties(target,props){for(var i=0;i=expertise){if((0,_utilities.exists)(data.expertise_as_advantage)){if(data.dice_system==='2d10'){data[repStringNew+'_skill_d20']='3d10kh2';}else if(data.dice_system==='3d6'){data[repStringNew+'_skill_d20']='4d6kh3';}else{data[repStringNew+'_skill_d20']='2d20kh1';}data[repStringNew+'_proficiency']='proficient';}else{data[repStringNew+'_proficiency']='expertise';}if(skillBonus>expertise){data[modifierRepString+'_name']='Skill import modifiers';data[modifierRepString+'_skill_'+_constants.SKILLS.indexOf(skillName.toUpperCase())+'_modifier']=skillBonus-expertise;}}else if(skillBonus>=pb){data[repStringNew+'_proficiency']='proficient';if(skillBonus>pb){data[modifierRepString+'_name']='Skill import modifiers';data[modifierRepString+'_skill_'+_constants.SKILLS.indexOf(skillName.toUpperCase())+'_modifier']=skillBonus-pb;}}}else{console.warn(skillName+' does not exist in the list of skills');}}}}},callback:function callback(){_this4.updateSkill();}});}},{key:'setup',value:function setup(){var _this5=this;var abilityCheckWatch=_constants.FIELDS.pb.concat(['initiative_ability','initiative_to_tracker','initiative_tie_breaker']).concat(['class_feature_bard_jack_of_all_trades_toggle','class_feature_fighter_champion_remarkable_athlete_toggle']).concat(_constants.ABILITIES);on(abilityCheckWatch.map(function(field){return'change:'+field;}).join(' '),function(){_this5.update();});on('change:repeating_skill',function(eventInfo){var repeatingInfo=(0,_utilities.getRepeatingInfo)('repeating_skill',eventInfo);if(repeatingInfo&&repeatingInfo.field==='prof_toggle'){_this5.updateSkillToggle(repeatingInfo);}if(repeatingInfo&&repeatingInfo.field!=='prof_toggle'&&repeatingInfo.field!=='total'&&repeatingInfo.field!=='total_with_sign'&&repeatingInfo.field!=='passive_total'&&repeatingInfo.field!=='passive_total_with_sign'&&repeatingInfo.field!=='formula'){_this5.updateSkill();}});var updateSkillWatch=_constants.FIELDS.pb.concat(['class_feature_bard_jack_of_all_trades_toggle','class_feature_fighter_champion_remarkable_athlete_toggle','class_feature_rogue_reliable_talent_toggle']).concat(_constants.ABILITIES).concat(_constants.ABILITIES.map(function(ability){return ability+'_check_formula';}));updateSkillWatch=updateSkillWatch.map(function(ability){return'change:'+ability;}).join(' ');on(updateSkillWatch,function(){_this5.updateSkill();});on('change:skills_srd',function(){_this5.updateSkillsFromSRD();});on('change:_reporder_repeating_skill remove:repeating_skill change:honor_toggle change:sanity_toggle',function(){_this5.updateMacro();});}}]);return AbilityChecks;}();
},{"../scripts/Format":29,"../scripts/Server":33,"../scripts/constants":35,"../scripts/utilities":37,"./AbilitiesUtil":2}],4:[function(require,module,exports){
'use strict';Object.defineProperty(exports,"__esModule",{value:true});exports.ActionComponents=undefined;var _createClass=function(){function defineProperties(target,props){for(var i=0;i0){data[className+'_level']=classLevels[className];}else if(data[className+'_level']){data[className+'_level']=0;}});var classAndLevel=[];Object.keys(classLevels).forEach(function(prop){if(classLevels[prop]>0){classAndLevel.push(format.capitalize(prop)+' '+classLevels[prop]);}});if(classAndLevel.length>0){data.class_and_level=classAndLevel.join(', ');}data.level=totalLevel;proficiencyBonus.set(totalLevel);var xpForNextLevel=0;if(!totalLevel){totalLevel=0;}if(totalLevel>30){xpForNextLevel=_this.xpTable[30];}else{xpForNextLevel=_this.xpTable[totalLevel];}if(xpForNextLevel>0){data.xp_next_level=xpForNextLevel;}_constants.CLASSES.forEach(function(className){if(data[className+'_level']>0){data['has_'+className+'_levels']=1;data[className+'_toggle']=1;}else if(!(0,_utilities.isUndefinedOrEmpty)(data['has_'+className+'_levels'])){data['has_'+className+'_levels']=0;}});var casterLevel=0;if(!(0,_utilities.exists)(data.is_npc)){if(classesWithSpellcasting>1){casterLevel+=spellcasting.full;casterLevel+=Math.floor(spellcasting.half/2);casterLevel+=Math.floor(spellcasting.third/3);}else{casterLevel=spellcasting.full+spellcasting.half+spellcasting.third;}data.caster_level=casterLevel;}if(classesWithSpellcasting>1||spellcasting.full){data.caster_type='full';}else if(spellcasting.half){data.caster_type='half';}else if(spellcasting.third){data.caster_type='third';}if(spellcasting.warlock){data.show_spells=1;data.warlock_slots_toggle=1;var warlockSpellSlots=void 0;if(spellcasting.warlock>=17){warlockSpellSlots=4;}else if(spellcasting.warlock>=11){warlockSpellSlots=3;}else if(spellcasting.warlock>=2){warlockSpellSlots=2;}else{warlockSpellSlots=1;}data.warlock_spell_slots_calc=warlockSpellSlots;var warlockSpellsMaxLevel=void 0;if(spellcasting.warlock>=9){warlockSpellsMaxLevel=5;}else if(spellcasting.warlock>=7){warlockSpellsMaxLevel=4;}else if(spellcasting.warlock>=5){warlockSpellsMaxLevel=3;}else if(spellcasting.warlock>=3){warlockSpellsMaxLevel=2;}else{warlockSpellsMaxLevel=1;}data.warlock_spells_max_level=format.ordinalSpellLevel(warlockSpellsMaxLevel);}else{if(!(0,_utilities.isUndefined)(data.warlock_spell_slots_calc)){data.warlock_spell_slots_calc=0;}if(!(0,_utilities.isUndefined)(data.warlock_spells_max_level)){data.warlock_spells_max_level=format.ordinalSpellLevel(1);}}},callback:function callback(){hitDice.update();hitPoints.update();classFeatures.determineClassFeatures();if(eventInfo&&eventInfo.sourceType==='player'){spells.updateSlots();}spells.updateHasSpellSlots();spells.updateHasWarlockSlots();spells.updateHasSpellPoints();if(updateSavingThrows){savingThrows.updateSavingThrows();}}});}},{key:'watchForClassLevelChanges',value:function watchForClassLevelChanges(){var classFeatureWatch=_constants.ABILITIES.concat(_constants.ABILITIES.map(function(ability){return ability+'_score_modifier';}));on(classFeatureWatch.map(function(field){return'change:'+field;}).join(' '),function(){classFeatures.determineClassFeatures();});}},{key:'setup',value:function setup(){var _this2=this;on('change:repeating_class',function(eventInfo){_this2.updateLevels(eventInfo);});on('remove:repeating_class',function(){_this2.updateLevels();});this.watchForClassLevelChanges();}}]);return Classes;}();
+'use strict';Object.defineProperty(exports,"__esModule",{value:true});exports.Classes=undefined;var _createClass=function(){function defineProperties(target,props){for(var i=0;i0){data[className+'_level']=classLevels[className];}else if(data[className+'_level']){data[className+'_level']=0;}});var classAndLevel=[];Object.keys(classLevels).forEach(function(prop){if(classLevels[prop]>0){classAndLevel.push(format.capitalize(prop)+' '+classLevels[prop]);}});if(classAndLevel.length>0){data.class_and_level=classAndLevel.join(', ');}data.level=totalLevel;proficiencyBonus.set(totalLevel);var xpForNextLevel=0;if(!totalLevel){totalLevel=0;}if(totalLevel>30){xpForNextLevel=_this.xpTable[30];}else{xpForNextLevel=_this.xpTable[totalLevel];}if(xpForNextLevel>0){data.xp_next_level=xpForNextLevel;}_constants.CLASSES.forEach(function(className){if(data[className+'_level']>0){data['has_'+className+'_levels']=1;data[className+'_toggle']=1;}else if(!(0,_utilities.isUndefinedOrEmpty)(data['has_'+className+'_levels'])){data['has_'+className+'_levels']=0;}});var casterLevel=0;if(!(0,_utilities.exists)(data.is_npc)){if(classesWithSpellcasting>1){casterLevel+=spellcasting.full;casterLevel+=Math.floor(spellcasting.half/2);casterLevel+=Math.floor(spellcasting.third/3);}else{casterLevel=spellcasting.full+spellcasting.half+spellcasting.third;}data.caster_level=casterLevel;}if(classesWithSpellcasting>1||spellcasting.full){data.caster_type='full';}else if(spellcasting.half){data.caster_type='half';}else if(spellcasting.third){data.caster_type='third';}if(spellcasting.warlock){data.show_spells=1;data.warlock_slots_toggle=1;var warlockSpellSlots=void 0;if(spellcasting.warlock>=17){warlockSpellSlots=4;}else if(spellcasting.warlock>=11){warlockSpellSlots=3;}else if(spellcasting.warlock>=2){warlockSpellSlots=2;}else{warlockSpellSlots=1;}data.warlock_spell_slots_calc=warlockSpellSlots;var warlockSpellsMaxLevel=void 0;if(spellcasting.warlock>=9){warlockSpellsMaxLevel=5;}else if(spellcasting.warlock>=7){warlockSpellsMaxLevel=4;}else if(spellcasting.warlock>=5){warlockSpellsMaxLevel=3;}else if(spellcasting.warlock>=3){warlockSpellsMaxLevel=2;}else{warlockSpellsMaxLevel=1;}data.warlock_spells_max_level=format.ordinalSpellLevel(warlockSpellsMaxLevel);}else{if(!(0,_utilities.isUndefined)(data.warlock_spell_slots_calc)){data.warlock_spell_slots_calc=0;}if(!(0,_utilities.isUndefined)(data.warlock_spells_max_level)){data.warlock_spells_max_level=format.ordinalSpellLevel(1);}}},callback:function callback(){hitDice.update();hitPoints.update();classFeatures.determineClassFeatures();if(eventInfo&&eventInfo.sourceType==='player'){spells.updateSlots();}spells.updateHasSpellSlots();spells.updateHasWarlockSlots();spells.updateHasSpellPoints();if(updateSavingThrows){savingThrows.updateSavingThrows();}}});}},{key:'watchForClassLevelChanges',value:function watchForClassLevelChanges(){var classFeatureWatch=_constants.ABILITIES.concat(_constants.ABILITIES.map(function(ability){return ability+'_score_modifier';}));on(classFeatureWatch.map(function(field){return'change:'+field;}).join(' '),function(){classFeatures.determineClassFeatures();});}},{key:'setup',value:function setup(){var _this2=this;on('change:repeating_class',function(eventInfo){_this2.updateLevels(eventInfo);});on('remove:repeating_class',function(){_this2.updateLevels();});this.watchForClassLevelChanges();}}]);return Classes;}();
},{"../features/classFeatures/ClassFeatures":15,"../hitDice/HitDice":18,"../hitPoints/HitPoints":19,"../proficiencyBonus/ProficiencyBonus":23,"../savingThrows/SavingThrows":26,"../scripts/Format":29,"../scripts/Server":33,"../scripts/constants":35,"../scripts/utilities":37,"../spells/Spells":41}],13:[function(require,module,exports){
'use strict';Object.defineProperty(exports,"__esModule",{value:true});exports.Equipment=undefined;var _createClass=function(){function defineProperties(target,props){for(var i=0;ihighestACWithBase){data.ac_from_armor=data.ac_from_armor-highestACWithBase+(0,_utilities.getIntValue)(data[repString+'_ac_total']);return data[repString+'_ac_total'];}}else{data.ac_from_armor+=data[repString+'_ac_total'];}}return highestACWithBase;}},{key:'updateWeight',value:function updateWeight(){server.getSetItems('equipment.updateWeight',{collectionArray:['weight_offense','weight_utility','weight_ammo','weight_armor','weight_equipment','weight_coinage','weight_total'],process:function process(data){data.weight_total=format.round((0,_utilities.getFloatValue)(data.weight_offense)+(0,_utilities.getFloatValue)(data.weight_utility)+(0,_utilities.getFloatValue)(data.weight_ammo)+(0,_utilities.getFloatValue)(data.weight_armor)+(0,_utilities.getFloatValue)(data.weight_equipment)+(0,_utilities.getFloatValue)(data.weight_coinage));}});}},{key:'updateArmor',value:function updateArmor(repeatingInfo){var _this=this;var stealthPenalty=void 0;server.getSetItems('equipment.updateArmor '+(repeatingInfo?repeatingInfo.rowId:''),{collectionArray:['is_npc','ac_from_armor','medium_armor_max_dex','ac_srd','proficient_armor_weighs'].concat(['weight_system','weight_armor']).concat(_constants.FIELDS.abilityScores),repeatingSections:[{name:'repeating_armor',collectionArrayAddItems:['type','stealth'].concat(['ac_base','ac_ability','ac_second_ability','ac_bonus','ac_total']).concat(_constants.REPEATING_FIELDS.default).concat(_constants.REPEATING_FIELDS.content).concat(_constants.REPEATING_FIELDS.modifiersAndProperties).concat(_constants.REPEATING_FIELDS.uses).concat(_constants.REPEATING_FIELDS.recharge).concat(_constants.REPEATING_FIELDS.weight).concat(['worn'])}],process:function process(data,repStrings){if((0,_utilities.exists)(data.is_npc)||data.ac_srd){return;}data.ac_from_armor=10+abilitiesUtil.getAbilityMod(data,'dexterity');var highestACWithBase=data.ac_from_armor;data.weight_armor=0;repStrings.forEach(function(repString){data[repString+'_roll_formula']='';_this.parseModifiersFromSRD(data,repString);actionComponents.parse(data,repString,repeatingInfo);actionComponents.updateUses(data,repString);actionComponents.updateRecharge(data,repString);actionComponents.changeWeightSystem(data,repString);actionComponents.weigh(data,repString,{repeatingSectionTotal:'weight_armor',toggle:'worn',weightMultiplier:'proficient_armor_weighs'});actionComponents.updateContent(data,repString);if(repeatingInfo&&(repeatingInfo.field==='type'||repeatingInfo.field==='name')||(0,_utilities.isUndefinedOrEmpty)(data[repString+'_ac_ability'])){if(data[repString+'_type']==='LIGHT_ARMOR'){data[repString+'_ac_ability']='DEX';}else if(data[repString+'_type']==='MEDIUM_ARMOR'){data[repString+'_ac_ability']='DEX_MAX_X';}else{data[repString+'_ac_ability']='';}}if((0,_utilities.exists)(data[repString+'_worn'])||(0,_utilities.isUndefined)(data[repString+'_worn'])){highestACWithBase=_this.calculateAC(data,repString,highestACWithBase);if(data[repString+'_stealth']==='Disadvantage'){stealthPenalty=true;}}});if(stealthPenalty){_this.setAdvantageOnStealth('dis');}else{_this.setAdvantageOnStealth('normal');}data.weight_armor=format.round(data.weight_armor);},callback:function callback(){armorClass.update();_this.updateWeight();}});}},{key:'update',value:function update(repeatingInfo){var _this2=this;server.getSetItems('equipment.update',{collectionArray:['weight_system','weight_equipment'],repeatingSections:[{name:'repeating_equipment',collectionArrayAddItems:['parsed'].concat(_constants.REPEATING_FIELDS.default).concat(_constants.REPEATING_FIELDS.content).concat(_constants.REPEATING_FIELDS.modifiersAndProperties).concat(_constants.REPEATING_FIELDS.uses).concat(_constants.REPEATING_FIELDS.recharge).concat(_constants.REPEATING_FIELDS.weight).concat(['type','carried']),repeatingInfo:repeatingInfo}],process:function process(data,repStrings){if(!repeatingInfo||!repeatingInfo.rowId){data.weight_equipment=0;}repStrings.forEach(function(repString){data[repString+'_roll_formula']='';actionComponents.parse(data,repString);actionComponents.updateUses(data,repString);actionComponents.updateRecharge(data,repString);actionComponents.changeWeightSystem(data,repString);actionComponents.weigh(data,repString,{repeatingSectionTotal:'weight_equipment',repeatingInfo:repeatingInfo,toggle:'carried'});actionComponents.updateContent(data,repString);});data.weight_equipment=format.round(data.weight_equipment);},callback:function callback(){_this2.updateWeight();}});}},{key:'addCommonEquipmentItems',value:function addCommonEquipmentItems(){var _this3=this;server.getSetItems('equipment.addCommonEquipmentItems',{process:function process(data){var commonEquipment=[{name:'Backpack',type:'Adventuring Gear',content:'A backpack can hold one cubic foot or 30 pounds of gear. You can also strap items, such as a Bedroll or a coil of rope, to the outside of a backpack.',weight:5},{name:'Bedroll',type:'Adventuring Gear',weight:7},{name:'Traveler\'s Clothes',type:'Adventuring Gear',weight:4},{name:'Rations',type:'Adventuring Gear',content:'Rations consist of dry foods suitable for extended travel, including jerky, dried fruit, hardtack, and nuts.',weight:2},{name:'Waterskin',type:'Adventuring Gear',content:'A waterskin can hold up to 4 pints of liquid.',weight:5},{name:'Mess Kit',type:'Adventuring Gear',content:'This tin box contains a cup and simple cutlery. The box clamps together, and one side can be used as a cooking pan and the other as a plate or shallow bowl.',weight:1},{name:'Tinderbox',type:'Adventuring Gear',content:'This small container holds flint, fire steel, and tinder (usually dry cloth soaked in light oil) used to kindle a fire. Using it to light a torch - or anything else with abundant, exposed fuel - takes an action. Lighting any other fire takes 1 minute.',weight:1},{name:'Healer\'s Kit',type:'Adventuring Gear',content:'This kit is a leather pouch containing bandages, salves, and splints. The kit has ten uses. As an action, you can expend one use of the kit to stabilize a creature that has 0 hit points, without needing to make a Wisdom (Medicine) check.',weight:3}];commonEquipment.forEach(function(equipment){var repString='repeating_equipment_'+generateRowID();Object.keys(equipment).forEach(function(field){data[repString+'_'+field]=equipment[field];});});},callback:function callback(){_this3.update();}});}},{key:'weighAmmo',value:function weighAmmo(){var _this4=this;server.getSetItems('equipment.weighAmmo',{collectionArray:['weight_system','weight_ammo'],repeatingSections:[{name:'repeating_ammo',collectionArrayAddItems:['weight',''].concat(_constants.REPEATING_FIELDS.weight)}],process:function process(data,repStrings){data.weight_ammo=0;repStrings.forEach(function(repString){actionComponents.changeWeightSystem(data,repString,0.05);actionComponents.weigh(data,repString,{repeatingSectionTotal:'weight_ammo',weightDefault:0.05});});data.weight_ammo=format.round(data.weight_ammo);},callback:function callback(){_this4.updateWeight();}});}},{key:'calculateGold',value:function calculateGold(){var _this5=this;server.getSetItems('equipment.calculateGold',{collectionArray:['cp','copper_per_gold','sp','silver_per_gold','ep','electrum_per_gold','gp','pp','platinum_per_gold','weight_per_coin','total_gp','weight_coinage'],process:function process(data){var copperPieces=(0,_utilities.getFloatValue)(data.cp);var silverPieces=(0,_utilities.getFloatValue)(data.sp);var electrumPieces=(0,_utilities.getFloatValue)(data.ep);var goldPieces=(0,_utilities.getFloatValue)(data.gp);var platinumPieces=(0,_utilities.getFloatValue)(data.pp);var copperPerGold=(0,_utilities.getFloatValue)(data.copper_per_gold,100);var silverPerGold=(0,_utilities.getFloatValue)(data.silver_per_gold,10);var electrumPerGold=(0,_utilities.getFloatValue)(data.electrum_per_gold,2);var platinumPerGold=(0,_utilities.getFloatValue)(data.platinum_per_gold,10);var weightPerCoin=(0,_utilities.getFloatValue)(data.weight_per_coin,0);data.total_gp=(copperPieces/copperPerGold+silverPieces/silverPerGold+electrumPieces/electrumPerGold+goldPieces+platinumPieces*platinumPerGold).toFixed(2);data.weight_coinage=(copperPieces+silverPieces+electrumPieces+goldPieces+platinumPieces)*weightPerCoin;},callback:function callback(){_this5.updateWeight();}});}},{key:'updateCarryingCapacity',value:function updateCarryingCapacity(){server.getSetItems('equipment.updateCarryingCapacity',{collectionArray:['strength','strength_score_modifier','ability_score_modifier'].concat(['carrying_capacity','carrying_capacity_multiplier']).concat(['max_push_drag_lift','max_push_drag_lift_multiplier']).concat(['encumbered','encumbered_multiplier']).concat(['heavily_encumbered','heavily_encumbered_multiplier']).concat(['racial_feature_powerful_build']),process:function process(data){var strength=abilitiesUtil.getAbilityScore(data,'strength');var powerfulBuild=(0,_utilities.exists)(data.racial_feature_powerful_build)?2:1;data.carrying_capacity=format.round(strength*(0,_utilities.getFloatValue)(data.carrying_capacity_multiplier,15)*powerfulBuild);data.max_push_drag_lift=format.round(strength*(0,_utilities.getFloatValue)(data.max_push_drag_lift_multiplier,30)*powerfulBuild);data.encumbered=format.round(strength*(0,_utilities.getFloatValue)(data.encumbered_multiplier,5)*powerfulBuild);data.heavily_encumbered=format.round(strength*(0,_utilities.getFloatValue)(data.heavily_encumbered_multiplier,10)*powerfulBuild);}});}},{key:'setup',value:function setup(){var _this6=this;on('change:repeating_armor',function(eventInfo){var repeatingInfo=(0,_utilities.getRepeatingInfo)('repeating_armor',eventInfo);if(repeatingInfo&&repeatingInfo.field!=='parsed'&&repeatingInfo.field!=='ac_total'&&repeatingInfo.field!=='toggle_details'){_this6.updateArmor(repeatingInfo);}});var armorWatch=['medium_armor_max_dex'].concat(_constants.ABILITIES).concat(_constants.ABILITIES.map(function(ability){return ability+'_score_modifier';}));on(armorWatch.map(function(armorField){return'change:'+armorField;}).join(' ')+' remove:repeating_armor',function(){_this6.updateArmor();});on('change:repeating_equipment',function(eventInfo){var repeatingInfo=(0,_utilities.getRepeatingInfo)('repeating_equipment',eventInfo);if(repeatingInfo&&repeatingInfo.field!=='parsed'&&repeatingInfo.field!=='toggle_details'){_this6.update(repeatingInfo);}});on('remove:repeating_equipment',function(){_this6.update();});on('change:add_common_equipment_items',function(){_this6.addCommonEquipmentItems();});on('change:repeating_ammo:weight change:repeating_ammo:uses remove:repeating_ammo',function(){_this6.weighAmmo();});on('change:weight_offense change:weight_utility change:weight_ammo change:weight_armor change:weight_equipment change:weight_coinage',function(){_this6.updateWeight();});on('change:cp change:copper_per_gold change:sp change:silver_per_gold change:ep change:electrum_per_gold change:gp change:pp change:platinum_per_gold change:weight_per_coin',function(){_this6.calculateGold();});on('change:carrying_capacity_multiplier change:max_push_drag_lift_multiplier change:encumbered_multiplier change:heavily_encumbered_multiplier change:racial_feature_powerful_build',function(){_this6.updateCarryingCapacity();});on('change:weight_system',function(){_this6.updateArmor();_this6.update();_this6.weighAmmo();});on('change:proficient_armor_weighs',function(){_this6.updateArmor();});}}]);return Equipment;}();
@@ -99,7 +99,7 @@
'use strict';Object.defineProperty(exports,"__esModule",{value:true});exports.Server=undefined;var _createClass=function(){function defineProperties(target,props){for(var i=0;i0){var getProcesses=[];var repStrings=[];getAttrs(obj.repeatingSections.map(function(repeatingSection){return'_reporder_'+repeatingSection.name;}),function(correctRepOrder){obj.repeatingSections.forEach(function(repeatingSection){getSectionIDs(repeatingSection.name,function(ids){getProcesses.push(repeatingSection.name);if('repeatingInfo'in repeatingSection&&repeatingSection.repeatingInfo&&repeatingSection.repeatingInfo.rowId){ids=[];ids.push(repeatingSection.repeatingInfo.rowId);}if(correctRepOrder&&correctRepOrder['_reporder_'+repeatingSection.name]){ids=[].concat(_toConsumableArray(new Set(correctRepOrder['_reporder_'+repeatingSection.name].toLowerCase().split(',').filter(function(id){return ids.includes(id);}).concat(ids))));}ids.forEach(function(id){var repString=repeatingSection.name+'_'+id;repStrings.push(repString);if('collectionArrayAddItems'in repeatingSection){repeatingSection.collectionArrayAddItems.forEach(function(addItem){collectionArray.push(repString+'_'+addItem);});}});if(getProcesses&&obj.repeatingSections&&getProcesses.length===obj.repeatingSections.length){_this2.getSetData(collectionArray,name,obj,callID,repStrings);}});});});if(obj.repeatingSections&&obj.repeatingSections.length<1&&obj.alwaysExecuteCallback&&obj.callback){obj.callback();removeFromServerCalls(callID);}}else{this.getSetData(collectionArray,name,obj,callID);}}},{key:'emptyRepeatingSection',value:function emptyRepeatingSection(obj){if(obj.repeatingSections){obj.repeatingSections.forEach(function(repeatingSection){getSectionIDs(repeatingSection,function(ids){ids.forEach(function(id){removeRepeatingRow(repeatingSection+'_'+id);});});});}}}]);return Server;}();
},{"./utilities":37}],34:[function(require,module,exports){
-'use strict';Object.defineProperty(exports,"__esModule",{value:true});exports.Upgrade=undefined;var _createClass=function(){function defineProperties(target,props){for(var i=0;i10){data[repString+'_content']+='\n'+data[repString+'_display_text'];}data[repString+'_display_text']='';}if((0,_utilities.exists)(data[repString+'_freeform'])){data.show_freeform=1;}});}},{key:'addFeetAndMetersBack',value:function addFeetAndMetersBack(data,field){if((0,_utilities.exists)(data[field])){if((0,_utilities.isUndefinedOrEmpty)(data.distance_system)||data.distance_system==='FEET'){var unit='ft.';if(!isNaN(data[field])||!data[field].includes(unit)||!data[field].includes(' ft')){data[field]=data[field]+' '+unit;}}else if(data.distance_system==='METERS'){var _unit='m.';if(!isNaN(data[field])||!data[field].includes(_unit)){data[field]=data[field]+' '+_unit;}}}}},{key:'convertOldStorageName',value:function convertOldStorageName(data,name){var storageNames={'Magic Item Analysis':'CLASS_FEATURE_ARTIFICER_MAGIC_ITEM_ANALYSIS','Tool Expertise':'CLASS_FEATURE_ARTIFICER_TOOL_EXPERTISE','Wondrous Invention':'CLASS_FEATURE_ARTIFICER_WONDROUS_INVENTION','Infuse Magic':'CLASS_FEATURE_ARTIFICER_INFUSE_MAGIC','Superior Attunement':'CLASS_FEATURE_ARTIFICER_SUPERIOR_ATTUNEMENT','Mechanical Servant':'CLASS_FEATURE_ARTIFICER_MECHANICAL_SERVANT','Soul of Artifice':'CLASS_FEATURE_ARTIFICER_SOUL_OF_ARTIFICE',Rage:'CLASS_FEATURE_BARBARIAN_RAGE','Unarmored Defense Barbarian':'CLASS_FEATURE_BARBARIAN_UNARMORED_DEFENSE','Reckless Attack':'CLASS_FEATURE_BARBARIAN_RECKLESS_ATTACK','Danger Sense':'CLASS_FEATURE_BARBARIAN_DANGER_SENSE','Fast Movement':'CLASS_FEATURE_BARBARIAN_FAST_MOVEMENT','Feral Instinct':'CLASS_FEATURE_BARBARIAN_FERAL_INSTINCT','Brutal Critical':'CLASS_FEATURE_BARBARIAN_BRUTAL_CRITICAL','Relentless Rage':'CLASS_FEATURE_BARBARIAN_RELENTLESS_RAGE','Persistent Rage':'CLASS_FEATURE_BARBARIAN_PERSISTENT_RAGE','Indomitable Might':'CLASS_FEATURE_BARBARIAN_INDOMITABLE_MIGHT','Primal Champion':'CLASS_FEATURE_BARBARIAN_PRIMAL_CHAMPION','Bardic Inspiration':'CLASS_FEATURE_BARD_BARDIC_INSPIRATION','Song of Rest':'CLASS_FEATURE_BARD_SONG_OF_REST','Expertise Bard':'CLASS_FEATURE_BARD_EXPERTISE',Countercharm:'CLASS_FEATURE_BARD_COUNTERCHARM','Magical Secrets':'CLASS_FEATURE_BARD_MAGICAL_SECRETS','Superior Inspiration':'CLASS_FEATURE_BARD_SUPERIOR_INSPIRATION','Channel Divinity Cleric':'CLASS_FEATURE_CLERIC_CHANNEL_DIVINITY','Turn Undead':'CLASS_FEATURE_CLERIC_CHANNEL_DIVINITY_TURN_UNDEAD','Divine Intervention':'CLASS_FEATURE_CLERIC_DIVINE_INTERVENTION','Wild Shape':'CLASS_FEATURE_DRUID_WILD_SHAPE','Beast Spells':'CLASS_FEATURE_DRUID_BEAST_SPELLS',Archdruid:'CLASS_FEATURE_DRUID_ARCHDRUID','Fighting Style (Fighter)':'CLASS_FEATURE_FIGHTER_FIGHTING_STYLE','Second Wind':'CLASS_FEATURE_FIGHTER_SECOND_WIND','Action Surge':'CLASS_FEATURE_FIGHTER_ACTION_SURGE',Indomitable:'CLASS_FEATURE_FIGHTER_INDOMITABLE','Unarmored Defense Monk':'CLASS_FEATURE_MONK_UNARMORED_DEFENSE','Martial Arts':'CLASS_FEATURE_MONK_MARTIAL_ARTS',Ki:'CLASS_FEATURE_MONK_KI','Flurry of Blows':'CLASS_FEATURE_MONK_FLURRY_OF_BLOWS','Patient Defense':'CLASS_FEATURE_MONK_PATIENT_DEFENSE','Step of the Wind':'CLASS_FEATURE_MONK_STEP_OF_THE_WIND','Unarmored Movement':'CLASS_FEATURE_MONK_UNARMORED_MOVEMENT','Deflect Missiles':'CLASS_FEATURE_MONK_DEFLECT_MISSILES','Slow Fall':'CLASS_FEATURE_MONK_SLOW_FALL','Stunning Strike':'CLASS_FEATURE_MONK_STUNNING_STRIKE','Ki-Empowered Strikes':'CLASS_FEATURE_MONK_KI_EMPOWERED_STRIKES','Stillness of Mind':'CLASS_FEATURE_MONK_STILLNESS_OF_MIND','Purity of Body':'CLASS_FEATURE_MONK_PURITY_OF_BODY','Tongue of the Sun and Moon':'CLASS_FEATURE_MONK_TONGUE_OF_THE_SUN_AND_MOON','Diamond Soul':'CLASS_FEATURE_MONK_DIAMOND_SOUL','Empty Body':'CLASS_FEATURE_MONK_EMPTY_BODY','Perfect Self':'CLASS_FEATURE_MONK_PERFECT_SELF','Divine Sense':'CLASS_FEATURE_PALADIN_DIVINE_SENSE','Lay on Hands':'CLASS_FEATURE_PALADIN_LAY_ON_HANDS','Fighting Style (Paladin)':'CLASS_FEATURE_PALADIN_FIGHTING_STYLE','Divine Smite':'CLASS_FEATURE_PALADIN_DIVINE_SMITE','Divine Health':'CLASS_FEATURE_PALADIN_DIVINE_HEALTH','Channel Divinity Paladin':'CLASS_FEATURE_PALADIN_CHANNEL_DIVINITY','Aura of Protection':'CLASS_FEATURE_PALADIN_AURA_OF_PROTECTION','Aura of Courage':'CLASS_FEATURE_PALADIN_AURA_OF_COURAGE','Improved Divine Smite':'CLASS_FEATURE_PALADIN_IMPROVED_DIVINE_SMITE','Cleaning Touch':'CLASS_FEATURE_PALADIN_CLEANSING_TOUCH','Favored Enemy':'CLASS_FEATURE_RANGER_FAVORED_ENEMY','Natural Explorer':'CLASS_FEATURE_RANGER_NATURAL_EXPLORER','Primeval Awareness':'CLASS_FEATURE_RANGER_PRIMEVAL_AWARENESS','Land\'s Stride':'CLASS_FEATURE_RANGER_LANDS_STRIDE','Hide in Plain Sight':'CLASS_FEATURE_RANGER_HIDE_IN_PLAIN_SIGHT','Foe Slayer':'CLASS_FEATURE_RANGER_FOE_SLAYER','Favored Enemy UA':'CLASS_FEATURE_RANGERUA_FAVORED_ENEMY','Natural Explorer UA':'CLASS_FEATURE_RANGERUA_NATURAL_EXPLORER','Primeval Awareness UA':'CLASS_FEATURE_RANGERUA_PRIMEVAL_AWARENESS','Greater Favored Enemy':'CLASS_FEATURE_RANGERUA_GREATER_FAVORED_ENEMY','Fleet of Foot':'CLASS_FEATURE_RANGERUA_FLEET_OF_FOOT','Hide in Plain Sight UA':'CLASS_FEATURE_RANGERUA_HIDE_IN_PLAIN_SIGHT','Foe Slayer UA':'CLASS_FEATURE_RANGERUA_FOE_SLAYER','Expertise Rogue':'CLASS_FEATURE_ROGUE_EXPERTISE','Sneak Attack':'CLASS_FEATURE_ROGUE_SNEAK_ATTACK','Thieves\' Cant':'CLASS_FEATURE_ROGUE_THIEVES_CANT','Cunning Action':'CLASS_FEATURE_ROGUE_CUNNING_ACTION','Uncanny Dodge':'CLASS_FEATURE_ROGUE_UNCANNY_DODGE','Reliable Talent':'CLASS_FEATURE_ROGUE_RELIABLE_TALENT',Blindsense:'CLASS_FEATURE_ROGUE_BLINDSENSE','Slippery Mind':'CLASS_FEATURE_ROGUE_SLIPPERY_MIND',Elusive:'CLASS_FEATURE_ROGUE_ELUSIVE','Stroke of Luck':'CLASS_FEATURE_ROGUE_STROKE_OF_LUCK','Sorcery Points':'CLASS_FEATURE_SORCERER_SORCERY_POINTS','Flexible Casting':'CLASS_FEATURE_SORCERER_FLEXIBLE_CASTING',Metamagic:'CLASS_FEATURE_SORCERER_METAMAGIC','Careful Spell':'CLASS_FEATURE_SORCERER_METAMAGIC_CAREFUL_SPELL','Distant Spell':'CLASS_FEATURE_SORCERER_METAMAGIC_DISTANT_SPELL','Empowered Spell':'CLASS_FEATURE_SORCERER_METAMAGIC_EMPOWERED_SPELL','Extended Spell':'CLASS_FEATURE_SORCERER_METAMAGIC_EXTENDED_SPELL','Heightened Spell':'CLASS_FEATURE_SORCERER_METAMAGIC_HEIGHTENED_SPELL','Quickened Spell':'CLASS_FEATURE_SORCERER_METAMAGIC_QUICKENED_SPELL','Subtle Spell':'CLASS_FEATURE_SORCERER_METAMAGIC_SUBTLE_SPELL','Twinned Spell':'CLASS_FEATURE_SORCERER_METAMAGIC_TWINNED_SPELL','Sorcerous Restoration':'CLASS_FEATURE_SORCERER_SORCEROUS_RESTORATION','Eldritch Invocations':'CLASS_FEATURE_WARLOCK_ELDRITCH_INVOCATIONS','Pact Boon':'CLASS_FEATURE_WARLOCK_PACT_BOON','Mystic Arcanum':'CLASS_FEATURE_WARLOCK_MYSTIC_ARCANUM','Eldritch Master':'CLASS_FEATURE_WARLOCK_ELDRITCH_MASTER','Arcane Recovery':'CLASS_FEATURE_WIZARD_ARCANE_RECOVERY','Spell Mastery':'CLASS_FEATURE_WIZARD_SPELL_MASTERY','Signature Spells':'CLASS_FEATURE_WIZARD_SIGNATURE_SPELLS'};var newClassFeature=void 0;if(name==='Evasion'){if(data.monk_level>=0){newClassFeature='CLASS_FEATURE_MONK_EVASION';}else{newClassFeature='CLASS_FEATURE_ROGUE_EVASION';}}else if(name==='Vanish'){if(data.rangerua_level>=0){newClassFeature='CLASS_FEATURE_RANGERUA_VANISH';}else{newClassFeature='CLASS_FEATURE_RANGER_VANISH';}}else if(name==='Feral Senses'){if(data.rangerua_level>=0){newClassFeature='CLASS_FEATURE_RANGERUA_FERAL_SENSES';}else{newClassFeature='CLASS_FEATURE_RANGER_FERAL_SENSES';}}else if(name==='Fighting Style (Ranger)'){if(data.rangerua_level>=0){newClassFeature='CLASS_FEATURE_RANGERUA_FIGHTING_STYLE';}else{newClassFeature='CLASS_FEATURE_RANGER_FIGHTING_STYLE';}}else if(name==='Timeless Body'){if(data.druid_level>=0){newClassFeature='CLASS_FEATURE_DRUID_TIMELESS_BODY';}else{newClassFeature='CLASS_FEATURE_MONK_TIMELESS_BODY';}}else{newClassFeature=storageNames[name]||'';}return newClassFeature;}},{key:'handle9Point1Upgrade',value:function handle9Point1Upgrade(data){if((0,_utilities.exists)(data.halfling_luck)){data.halfling_luck=1;data.d20_mod='ro<1';}else{data.d20_mod='';}if((0,_utilities.exists)(data.initiative_to_tracker)){if(data.initiative_to_tracker==='@{initiative_formula}'){data.initiative_to_tracker=0;}else{data.initiative_to_tracker=1;}}if((0,_utilities.exists)(data.initiative_tie_breaker)&&data.initiative_tie_breaker==='[[@{initiative} / 100]][tie breaker]'){data.initiative_tie_breaker=1;}if((0,_utilities.exists)(data.critical_damage_maximized)){data.critical_damage_houserule='CRITICAL_DAMAGE_IS_MAXIMIZED';}if((0,_utilities.exists)(data.brutal_critical)){data.class_feature_barbarian_brutal_critical_toggle=1;}if((0,_utilities.exists)(data.distance_system)){data.distance_system=data.distance_system.toUpperCase();}if((0,_utilities.exists)(data.reliable_talent)){data.class_feature_rogue_reliable_talent_toggle=1;}}},{key:'restoreReachAndRange',value:function restoreReachAndRange(data){var _this3=this;_constants.SENSES.forEach(function(sense){_this3.addFeetAndMetersBack(data,sense);});_constants.SPEEDS.forEach(function(speed){_this3.addFeetAndMetersBack(data,speed);});actionsRepStrings(data).forEach(function(repString){_this3.addFeetAndMetersBack(data,repString+'_reach');_this3.addFeetAndMetersBack(data,repString+'_range');});}},{key:'traitsToClassFeatures',value:function traitsToClassFeatures(data){var _this4=this;traitsRepStrings(data).forEach(function(repString){if(data[repString+'_storage_name']){var newRepString='repeating_classfeature_'+generateRowID();var fieldsToConvert=['toggle_details','storage_name'].concat(_constants.REPEATING_FIELDS.default).concat(_constants.REPEATING_FIELDS.modifiersAndProperties).concat(_constants.REPEATING_FIELDS.parse).concat(_constants.REPEATING_FIELDS.recharge).concat(_constants.REPEATING_FIELDS.uses).concat(_constants.REPEATING_FIELDS.cost).concat(_constants.REPEATING_FIELDS.content).concat(_constants.REPEATING_FIELDS.savingThrow).concat(_constants.REPEATING_FIELDS.savingThrowDamage).concat(_constants.REPEATING_FIELDS.savingThrowSecondDamage).concat(_constants.REPEATING_FIELDS.otherDamage).concat(_constants.REPEATING_FIELDS.otherSecondDamage).concat(_constants.REPEATING_FIELDS.heal).concat(_constants.REPEATING_FIELDS.extras).concat(['roll_toggle','display_text','heal','higher_level_dice','type']).concat(['damage','damage_ability','damage_bonus','damage_type']).concat(['second_damage_toggle','second_damage','second_damage_ability','second_damage_bonus','second_damage_type']);fieldsToConvert.forEach(function(field){if(field==='storage_name'){data[newRepString+'_storage_name']=_this4.convertOldStorageName(data,data[repString+'_storage_name']);}else if(field==='recharge'){data[newRepString+'_recharge']=_this4.translateRecharge(data,repString);}else if((0,_utilities.exists)(data[repString+'_'+field])){data[newRepString+'_'+field]=data[repString+'_'+field];}});removeRepeatingRowAndFromData(data,repString);}});}},{key:'racialFeaturesToRacialTraits',value:function racialFeaturesToRacialTraits(data){racialFeaturesRepStrings(data).forEach(function(repString){var newRepString='repeating_racialtrait_'+generateRowID();var fieldsToConvert=['toggle_details','storage_name'].concat(_constants.REPEATING_FIELDS.default).concat(_constants.REPEATING_FIELDS.modifiersAndProperties).concat(_constants.REPEATING_FIELDS.parse).concat(_constants.REPEATING_FIELDS.recharge).concat(_constants.REPEATING_FIELDS.uses).concat(_constants.REPEATING_FIELDS.cost).concat(_constants.REPEATING_FIELDS.content).concat(_constants.REPEATING_FIELDS.savingThrow).concat(_constants.REPEATING_FIELDS.savingThrowDamage).concat(_constants.REPEATING_FIELDS.savingThrowSecondDamage).concat(_constants.REPEATING_FIELDS.otherDamage).concat(_constants.REPEATING_FIELDS.otherSecondDamage).concat(_constants.REPEATING_FIELDS.heal).concat(_constants.REPEATING_FIELDS.extras);fieldsToConvert.forEach(function(field){data[newRepString+'_'+field]=data[repString+'_'+field];});removeRepeatingRowAndFromData(data,repString);});}},{key:'newCantripFormula',value:function newCantripFormula(data){spellsRepStrings(data).forEach(function(repString){var prefixes=['attack','saving_throw','other'];prefixes.forEach(function(prefix){if(data[repString+'_'+prefix+'_damage_dice']==='((@{level} + 1) / 6 + 0.5)'){data[repString+'_'+prefix+'_damage_dice']='[[ceil((@{level} + 2) / 6)]]';}if(data[repString+'_'+prefix+'_damage_dice']==='((@{caster_level} + 1) / 6 + 0.5)'){data[repString+'_'+prefix+'_damage_dice']='[[ceil((@{caster_level} + 2) / 6)]]';}});});}},{key:'deathSaveProf',value:function deathSaveProf(data){if((0,_utilities.exists)(data.death_saving_throw_prof)){data.death_saving_throw_proficient=1;}}},{key:'savingThrowsSaveToSavingThrow',value:function savingThrowsSaveToSavingThrow(data){if((0,_utilities.exists)(data.death_save_output_option)){data.death_saving_throw_output_option=data.death_save_output_option;}_constants.SAVING_THROWS.concat(_constants.CUSTOM_SAVING_THROWS).forEach(function(savingThrow){if((0,_utilities.exists)(data[savingThrow+'_save_prof'])){data[savingThrow+'_saving_throw_proficient']=1;}if((0,_utilities.exists)(data[savingThrow+'_save_bonus'])){data[savingThrow+'_saving_throw_bonus']=data[savingThrow+'_save_bonus'];}});}},{key:'unarmoredToArmor',value:function unarmoredToArmor(data){var repString='repeating_armor_'+generateRowID();if((0,_utilities.exists)(data.ac_unarmored_ability)){data[repString+'_ac_base']=10;if((0,_utilities.exists)(data.ac_ability)){data[repString+'_ac_ability']=data.ac_ability;}else{data[repString+'_ac_ability']='DEX';}if(data.ac_unarmored_ability!=='CON'&&(0,_utilities.exists)(data.barbarian_level)){data[repString+'_name']=getTranslationByKey('CLASS_FEATURE_BARBARIAN_UNARMORED_DEFENSE');data[repString+'_ac_second_ability']='CON';}else if(data.ac_unarmored_ability!=='CON'&&(0,_utilities.exists)(data.monk_level)){data[repString+'_name']=getTranslationByKey('CLASS_FEATURE_MONK_UNARMORED_DEFENSE');data[repString+'_ac_second_ability']='WIS';}else{data[repString+'_name']='Old unarmored';data[repString+'_ac_second_ability']=data.ac_unarmored_ability;}data.ac_ability='';data.ac_unarmored_ability='';}else if((0,_utilities.exists)(data.ac_ability)&&data.ac_ability!=='DEX'){data[repString+'_name']='Old armor modifiers';data[repString+'_ac_base']=10;data[repString+'_ac_ability']=data.ac_ability;data.ac_ability='';}if((0,_utilities.exists)(data.ac_armored_bonus)){repString='repeating_armor_'+generateRowID();data[repString+'_name']='Old armor modifier';data[repString+'_ac_bonus']=data.ac_armored_bonus;data.ac_armored_bonus='';}if((0,_utilities.exists)(data.ac_unarmored_bonus)){repString='repeating_armor_'+generateRowID();data[repString+'_name']='Old armor modifier';data[repString+'_ac_bonus']=data.ac_unarmored_bonus;data.ac_unarmored_bonus='';}}},{key:'modifierForAbilitiesAndSavingThrows',value:function modifierForAbilitiesAndSavingThrows(data){modifiersRepStrings(data).forEach(function(repString){if((0,_utilities.exists)(data[repString+'_ability_checks_modifier'])){data[repString+'_ability_check_modifier']=data[repString+'_ability_checks_modifier'];data[repString+'_ability_checks_modifier']='';}if((0,_utilities.exists)(data[repString+'_saving_throws_modifier'])){data[repString+'_saving_throw_modifier']=data[repString+'_saving_throws_modifier'];data[repString+'_saving_throws_modifier']='';}});}},{key:'globalBonusesToModifiers',value:function globalBonusesToModifiers(data){var repString='repeating_modifier_'+generateRowID();if((0,_utilities.exists)(data.global_ability_bonus)||(0,_utilities.exists)(data.global_check_bonus)||(0,_utilities.exists)(data.global_saving_throw_bonus)||(0,_utilities.exists)(data.global_attack_bonus)||(0,_utilities.exists)(data.global_melee_attack_bonus)||(0,_utilities.exists)(data.global_ranged_attack_bonus)||(0,_utilities.exists)(data.global_spell_attack_bonus)||(0,_utilities.exists)(data.global_damage_bonus)||(0,_utilities.exists)(data.global_melee_damage_bonus)||(0,_utilities.exists)(data.global_ranged_damage_bonus)||(0,_utilities.exists)(data.global_spell_damage_bonus)||(0,_utilities.exists)(data.global_spell_dc_bonus)||(0,_utilities.exists)(data.global_spell_heal_bonus)){data[repString+'_name']='Old modifiers';}if((0,_utilities.exists)(data.global_ability_bonus)){data[repString+'_ability_score_modifier']=data.global_ability_bonus;data[repString+'_ability_score_toggle']=1;data.global_ability_bonus='';}if((0,_utilities.exists)(data.global_check_bonus)){data[repString+'_ability_check_modifier']=data.global_check_bonus;data[repString+'_ability_check_toggle']=1;data.global_check_bonus='';}if((0,_utilities.exists)(data.global_saving_throw_bonus)){data[repString+'_saving_throw_modifier']=data.global_saving_throw_bonus;data[repString+'_saving_throw_toggle']=1;data.global_saving_throw_bonus='';}if((0,_utilities.exists)(data.global_attack_bonus)){data[repString+'_attack_modifier']=data.global_attack_bonus;data[repString+'_attack_toggle']=1;data.global_attack_bonus='';}if((0,_utilities.exists)(data.global_melee_attack_bonus)){data[repString+'_melee_weapon_attack_modifier']=data.global_melee_attack_bonus;data[repString+'_attack_toggle']=1;data.global_melee_attack_bonus='';}if((0,_utilities.exists)(data.global_ranged_attack_bonus)){data[repString+'_ranged_weapon_attack_modifier']=data.global_ranged_attack_bonus;data[repString+'_attack_toggle']=1;data.global_ranged_attack_bonus='';}if((0,_utilities.exists)(data.global_spell_attack_bonus)){data[repString+'_spell_attack_modifier']=data.global_spell_attack_bonus;data[repString+'_attack_toggle']=1;data.global_spell_attack_bonus='';}if((0,_utilities.exists)(data.global_damage_bonus)){data[repString+'_damage_modifier']=data.global_damage_bonus;data[repString+'_damage_toggle']=1;data.global_damage_bonus='';}if((0,_utilities.exists)(data.global_melee_damage_bonus)){data[repString+'_melee_weapon_damage_modifier']=data.global_melee_damage_bonus;data[repString+'_damage_toggle']=1;data.global_melee_damage_bonus='';}if((0,_utilities.exists)(data.global_ranged_damage_bonus)){data[repString+'_ranged_weapon_damage_modifier']=data.global_ranged_damage_bonus;data[repString+'_damage_toggle']=1;data.global_ranged_damage_bonus='';}if((0,_utilities.exists)(data.global_spell_damage_bonus)){data[repString+'_spell_damage_modifier']=data.global_spell_damage_bonus;data[repString+'_damage_toggle']=1;data.global_spell_damage_bonus='';}if((0,_utilities.exists)(data.global_spell_dc_bonus)){data[repString+'_spell_dc_modifier']=data.global_spell_dc_bonus;data[repString+'_spell_toggle']=1;data.global_spell_dc_bonus='';}if((0,_utilities.exists)(data.global_spell_heal_bonus)){data[repString+'_spell_heal_modifier']=data.global_spell_heal_bonus;data[repString+'_spell_toggle']=1;data.global_spell_heal_bonus='';}}},{key:'abilityBonusesToModifiers',value:function abilityBonusesToModifiers(data){modifiersRepStrings(data).forEach(function(repString){if((0,_utilities.exists)(data[repString+'_active'])||(0,_utilities.isUndefined)(data[repString+'_active'])){data[repString+'_active']=1;}});modifiersRepStrings(data).forEach(function(repString){if((0,_utilities.exists)(data[repString+'_ability_toggle'])){data[repString+'_ability_score_toggle']=1;data[repString+'_ability_check_toggle']=1;data[repString+'_ability_toggle']='';}});var newRepString='repeating_modifier_'+generateRowID();_constants.ABILITIES.forEach(function(ability){if((0,_utilities.exists)(data[ability+'_bonus'])||(0,_utilities.exists)(data[ability+'_check_bonus'])){data[newRepString+'_name']='Old ability modifiers';}if((0,_utilities.exists)(data[ability+'_bonus'])){data[newRepString+'_ability_score_toggle']=1;data[newRepString+'_'+ability+'_score_modifier']=data[ability+'_bonus'];data[ability+'_bonus']='';}if((0,_utilities.exists)(data[ability+'_check_bonus'])){data[newRepString+'_ability_check_toggle']=1;data[newRepString+'_'+ability+'_check_modifier']=data[ability+'_check_bonus'];data[ability+'_check_bonus']='';}});if((0,_utilities.exists)(data.initiative_bonus)){data[newRepString+'_name']='Old ability modifiers';data[newRepString+'_ability_check_toggle']=1;data[newRepString+'_initiative_modifier']=data.initiative_bonus;data.initiative_bonus='';}if((0,_utilities.exists)(data.initiative_second_ability)){data[newRepString+'_name']='Old ability modifiers';data[newRepString+'_ability_check_toggle']=1;data[newRepString+'_initiative_modifier_ability']=data.initiative_second_ability;data.initiative_second_ability='';}var i=0;skillsRepStrings(data).forEach(function(repString){if((0,_utilities.exists)(data[repString+'_bonus'])){data[newRepString+'_ability_check_toggle']=1;data[newRepString+'_skill_'+i+'_modifier']=1;data[repString+'_bonus']='';}if((0,_utilities.exists)(data[repString+'_passive_bonus'])){data[newRepString+'_ability_check_toggle']=1;data[newRepString+'_skill_'+i+'_passive_modifier']=1;data[repString+'_passive_bonus']='';}i+=1;});}},{key:'savingThrowBonusesToModifiers',value:function savingThrowBonusesToModifiers(data){var repString='repeating_modifier_'+generateRowID();_constants.SAVING_THROWS.concat(_constants.CUSTOM_SAVING_THROWS).forEach(function(savingThrow){if((0,_utilities.exists)(data[savingThrow+'_bonus'])){data[repString+'_name']='Old saving throw modifiers';data[repString+'_'+savingThrow+'_modifier']=data[savingThrow+'_bonus'];data[savingThrow+'_bonus']='';}});}},{key:'armorTypeUpgrade',value:function armorTypeUpgrade(data){armorRepStrings(data).forEach(function(repString){if(!data[repString+'_type']){data[repString+'_type']='LIGHT_ARMOR';}});}},{key:'qtyToUses',value:function qtyToUses(data){ammoRepStrings(data).forEach(function(repString){if((0,_utilities.exists)(data[repString+'_qty'])){data[repString+'_uses']=data[repString+'_qty'];data[repString+'_qty']='';}});equipmentRepStrings(data).forEach(function(repString){if((0,_utilities.exists)(data[repString+'_qty'])){if((0,_utilities.exists)(data[repString+'_weight'])){data[repString+'_weight_per_use']=1;}data[repString+'_uses']=data[repString+'_qty'];data[repString+'_qty']='';}});}},{key:'clearUsesMax',value:function clearUsesMax(data){actionsRepStrings(data).concat(equipmentRepStrings(data)).concat(armorRepStrings(data)).forEach(function(repString){if((0,_utilities.exists)(data[repString+'_uses_max'])&&!(0,_utilities.exists)(data[repString+'_recharge'])){data[repString+'_uses_max']='';}});}},{key:'attacksToOffense',value:function attacksToOffense(data){var _this5=this;var fieldsToConvert=_constants.REPEATING_FIELDS.default.concat(_constants.REPEATING_FIELDS.modifiersAndProperties).concat(_constants.REPEATING_FIELDS.parse).concat(_constants.REPEATING_FIELDS.uses).concat(_constants.REPEATING_FIELDS.cost).concat(_constants.REPEATING_FIELDS.recharge).concat(_constants.REPEATING_FIELDS.content).concat(_constants.REPEATING_FIELDS.attack).concat(_constants.REPEATING_FIELDS.attackDamage).concat(_constants.REPEATING_FIELDS.attackSecondDamage).concat(_constants.REPEATING_FIELDS.savingThrow).concat(_constants.REPEATING_FIELDS.savingThrowDamage).concat(_constants.REPEATING_FIELDS.savingThrowSecondDamage).concat(_constants.REPEATING_FIELDS.otherDamage).concat(_constants.REPEATING_FIELDS.otherSecondDamage).concat(_constants.REPEATING_FIELDS.heal).concat(_constants.REPEATING_FIELDS.extras);attacksRepStrings(data).forEach(function(repString){if((0,_utilities.exists)(data[repString+'_name'])){var newRepeatingString='repeating_offense_'+generateRowID();fieldsToConvert.forEach(function(field){_this5.oldRepeatingValueToNew(data,repString,newRepeatingString,field);});}removeRepeatingRowAndFromData(data,repString);});}},{key:'weightPerUse',value:function weightPerUse(data){ammoRepStrings(data).forEach(function(repString){if((0,_utilities.exists)(data[repString+'_weight_per_use'])){data[repString+'_weight']=data[repString+'_weight_per_use'];data[repString+'_weight_per_use']=1;}});equipmentRepStrings(data).forEach(function(repString){if((0,_utilities.exists)(data[repString+'_weight_per_use'])){data[repString+'_weight']=data[repString+'_weight_per_use'];data[repString+'_weight_per_use']=1;}});}},{key:'versionCompare',value:function versionCompare(left,right){if(typeof left!=='string'||typeof right!=='string'){return false;}var a=left.split('.');var b=right.split('.');var len=Math.max(a.length,b.length);for(var i=0;i0||(0,_utilities.getIntValue)(a[i])>(0,_utilities.getIntValue)(b[i])){return 1;}else if(b[i]&&!a[i]&&(0,_utilities.getIntValue)(b[i])>0||(0,_utilities.getIntValue)(a[i])<(0,_utilities.getIntValue)(b[i])){return-1;}}return 0;}},{key:'runUpgrade',value:function runUpgrade(sheetVersion){var _this6=this;var repeatingSections=[];var collectionArray=[];if(this.versionCompare(sheetVersion,'8.0.0')<0){collectionArray=collectionArray.concat(_constants.FIELDS.d20).concat(['roll_setting']);repeatingSections=repeatingSections.concat({name:'repeating_skill',collectionArrayAddItems:['skill_d20']});}if(this.versionCompare(sheetVersion,'9.0.0')<0){collectionArray=collectionArray.concat(_constants.FIELDS.d20).concat(['roll_setting']).concat(['spell_ability','ac_ability','ac_unarmored_ability','initiative_ability','hide_spell_content','hide_content','spell_slots_toggle','spell_points_toggle','spell_condensed','spell_contents','attacks_vs_target_ac','attacks_vs_target_name','legendary_action_amount','auto_revert_advantage','saving_throws_half_proficiency','weight_system']).concat(['size','initiative_roll','ammo_used']);}if(this.versionCompare(sheetVersion,'9.1.0')<0){resistances.updateDamageResistances();collectionArray=collectionArray.concat(['halfling_luck','initiative_to_tracker','initiative_tie_breaker','critical_damage_maximized','brutal_critical','reliable_talent']).concat(['distance_system']).concat(_constants.SENSES).concat(_constants.SPEEDS);var actionTypes=['action','reaction','legendaryaction','lairaction','regionaleffect','trait'];var repeatingActionsAndSpells=actionTypes.map(function(actionType){return'repeating_'+actionType;}).concat(_constants.SPELL_LEVELS.map(function(spellLevel){return'repeating_spell'+spellLevel;}));repeatingSections=repeatingSections.concat(repeatingActionsAndSpells.map(function(repeatingSection){return{name:repeatingSection,collectionArrayAddItems:['storage_name'].concat(_constants.REPEATING_FIELDS.default).concat(_constants.REPEATING_FIELDS.modifiersAndProperties).concat(_constants.REPEATING_FIELDS.parse).concat(_constants.REPEATING_FIELDS.recharge).concat(_constants.REPEATING_FIELDS.uses).concat(_constants.REPEATING_FIELDS.cost).concat(_constants.REPEATING_FIELDS.content).concat(_constants.REPEATING_FIELDS.attack).concat(_constants.REPEATING_FIELDS.attackDamage).concat(_constants.REPEATING_FIELDS.attackSecondDamage).concat(_constants.REPEATING_FIELDS.savingThrow).concat(_constants.REPEATING_FIELDS.savingThrowDamage).concat(_constants.REPEATING_FIELDS.savingThrowSecondDamage).concat(_constants.REPEATING_FIELDS.otherDamage).concat(_constants.REPEATING_FIELDS.otherSecondDamage).concat(_constants.REPEATING_FIELDS.heal).concat(_constants.REPEATING_FIELDS.extras).concat(['roll_toggle','display_text','heal','higher_level_dice','type']).concat(['damage','damage_ability','damage_bonus','damage_type']).concat(['second_damage_toggle','second_damage','second_damage_ability','second_damage_bonus','second_damage_type'])};}));}if(this.versionCompare(sheetVersion,'9.2.0')<0){collectionArray=collectionArray.concat(['death_saving_throw_prof']);}if(this.versionCompare(sheetVersion,'10.0.0')<0){repeatingSections=repeatingSections.concat({name:'repeating_racialfeature',collectionArrayAddItems:['toggle_details','storage_name'].concat(_constants.REPEATING_FIELDS.default).concat(_constants.REPEATING_FIELDS.modifiersAndProperties).concat(_constants.REPEATING_FIELDS.parse).concat(_constants.REPEATING_FIELDS.recharge).concat(_constants.REPEATING_FIELDS.uses).concat(_constants.REPEATING_FIELDS.cost).concat(_constants.REPEATING_FIELDS.content).concat(_constants.REPEATING_FIELDS.attack).concat(_constants.REPEATING_FIELDS.attackDamage).concat(_constants.REPEATING_FIELDS.attackSecondDamage).concat(_constants.REPEATING_FIELDS.savingThrow).concat(_constants.REPEATING_FIELDS.savingThrowDamage).concat(_constants.REPEATING_FIELDS.savingThrowSecondDamage).concat(_constants.REPEATING_FIELDS.otherDamage).concat(_constants.REPEATING_FIELDS.otherSecondDamage).concat(_constants.REPEATING_FIELDS.heal).concat(_constants.REPEATING_FIELDS.extras)});}if(this.versionCompare(sheetVersion,'10.1.3')<0){var repeatingSpells=_constants.SPELL_LEVELS.map(function(spellLevel){return'repeating_spell'+spellLevel;});repeatingSections=repeatingSections.concat(repeatingSpells.map(function(repeatingSection){return{name:repeatingSection,collectionArrayAddItems:['attack_damage_dice','saving_throw_damage_dice','other_damage_dice']};}));}if(this.versionCompare(sheetVersion,'11.3.2')<0){collectionArray=collectionArray.concat(['death_save_prof','death_save_output_option']).concat(_constants.SAVING_THROWS.concat(_constants.CUSTOM_SAVING_THROWS).map(function(savingThrow){return savingThrow+'_save_prof';})).concat(_constants.SAVING_THROWS.concat(_constants.CUSTOM_SAVING_THROWS).map(function(savingThrow){return savingThrow+'_save_bonus';})).concat(_constants.SAVING_THROWS.concat(_constants.CUSTOM_SAVING_THROWS).map(function(savingThrow){return savingThrow+'_saving_throw_proficient';})).concat(_constants.SAVING_THROWS.concat(_constants.CUSTOM_SAVING_THROWS).map(function(savingThrow){return savingThrow+'_saving_throw_bonus';}));}if(this.versionCompare(sheetVersion,'12.0.0')<0){collectionArray=collectionArray.concat(['ac_ability','ac_unarmored_ability','ac_armored_bonus','ac_unarmored_bonus','barbarian_level','monk_level']);}if(this.versionCompare(sheetVersion,'12.0.4')<0){collectionArray=collectionArray.concat(['global_ability_bonus','global_check_bonus','global_attack_bonus','global_melee_attack_bonus','global_ranged_attack_bonus','global_spell_attack_bonus','global_damage_bonus','global_melee_damage_bonus','global_ranged_damage_bonus','global_spell_damage_bonus','global_spell_dc_bonus','global_spell_heal_bonus','global_saving_throw_bonus']);}if(this.versionCompare(sheetVersion,'13.0.1')<0){collectionArray=collectionArray.concat(_constants.ABILITIES.map(function(ability){return ability+'_bonus';})).concat(_constants.ABILITIES.map(function(ability){return ability+'_check_bonus';})).concat(['initiative_bonus','initiative_second_ability']).concat(_constants.SAVING_THROWS.concat(_constants.CUSTOM_SAVING_THROWS).map(function(savingThrow){return savingThrow+'_bonus';}));repeatingSections=repeatingSections.concat({name:'repeating_modifier',collectionArrayAddItems:['ability_checks_modifier','saving_throws_modifier'].concat(['active'])}).concat({name:'repeating_armor',collectionArrayAddItems:['type']});}if(this.versionCompare(sheetVersion,'14.0.0')<0){collectionArray=collectionArray.concat(_constants.FIELDS.pb).concat(['distance_system']).concat(_constants.FIELDS.abilityScores).concat(_constants.FIELDS.d20).concat(_constants.FIELDS.savingThrow).concat(_constants.FIELDS.attackModifier).concat(_constants.FIELDS.weaponAttackModifier).concat(_constants.FIELDS.meleeWeaponAttackModifier).concat(_constants.FIELDS.rangedWeaponAttackModifier).concat(_constants.FIELDS.spellAttackModifier).concat(_constants.FIELDS.damageModifier).concat(_constants.FIELDS.weaponDamageModifier).concat(_constants.FIELDS.meleeWeaponDamageModifier).concat(_constants.FIELDS.rangedWeaponDamageModifier).concat(_constants.FIELDS.spellDamageModifier).concat(_constants.FIELDS.attacksVs).concat(_constants.FIELDS.automaticDamage).concat(['show_dice_modifiers','show_crit_range','critical_damage_houserule','savage_attacks','class_feature_barbarian_brutal_critical_toggle','barbarian_level']).concat(['use_custom_saving_throws']).concat(['weight_system','weight_offense','weight_utility']);repeatingSections=repeatingSections.concat({name:'repeating_ammo',collectionArrayAddItems:['weight','qty']}).concat({name:'repeating_equipment',collectionArrayAddItems:['weight','qty']}).concat({name:'repeating_attack',collectionArrayAddItems:_constants.REPEATING_FIELDS.default.concat(_constants.REPEATING_FIELDS.modifiersAndProperties).concat(_constants.REPEATING_FIELDS.parse).concat(_constants.REPEATING_FIELDS.uses).concat(_constants.REPEATING_FIELDS.cost).concat(_constants.REPEATING_FIELDS.recharge).concat(_constants.REPEATING_FIELDS.content).concat(_constants.REPEATING_FIELDS.attack).concat(_constants.REPEATING_FIELDS.attackDamage).concat(_constants.REPEATING_FIELDS.attackSecondDamage).concat(_constants.REPEATING_FIELDS.savingThrow).concat(_constants.REPEATING_FIELDS.savingThrowDamage).concat(_constants.REPEATING_FIELDS.savingThrowSecondDamage).concat(_constants.REPEATING_FIELDS.otherDamage).concat(_constants.REPEATING_FIELDS.otherSecondDamage).concat(_constants.REPEATING_FIELDS.heal).concat(_constants.REPEATING_FIELDS.extras)});}if(this.versionCompare(sheetVersion,'14.1.0')<0){var typesToConvert=_constants.ACTION_TYPES.concat(['equipment','armor']).map(function(actionType){return'repeating_'+actionType;});repeatingSections=repeatingSections.concat(typesToConvert.map(function(repeatingSection){return{name:repeatingSection,collectionArrayAddItems:['uses_max','recharge','weight','weight_per_use']};}));}collectionArray=(0,_utilities.uniqueArray)(collectionArray);server.getSetItems('upgrade.runUpgrade',{repeatingSections:repeatingSections,collectionArray:collectionArray,process:function process(data){if(_this6.versionCompare(sheetVersion,'8.0.0')<0){_this6.removeRollInfo(data);}if(_this6.versionCompare(sheetVersion,'9.0.0')<0){_this6.ammoPerUse(data);_this6.sizeTranslations(data);_this6.updateFieldsFor9(data);_this6.newAttackSetup(data);}if(_this6.versionCompare(sheetVersion,'9.1.0')<0){_this6.handle9Point1Upgrade(data);_this6.restoreReachAndRange(data);_this6.traitsToClassFeatures(data);_this6.translateRecharges(data);}if(_this6.versionCompare(sheetVersion,'9.2.0')<0){_this6.deathSaveProf(data);}if(_this6.versionCompare(sheetVersion,'10.0.0')<0){_this6.racialFeaturesToRacialTraits(data);}if(_this6.versionCompare(sheetVersion,'10.1.3')<0){_this6.newCantripFormula(data);}if(_this6.versionCompare(sheetVersion,'11.3.2')<0){_this6.savingThrowsSaveToSavingThrow(data);}if(_this6.versionCompare(sheetVersion,'12.0.0')<0){_this6.unarmoredToArmor(data);}if(_this6.versionCompare(sheetVersion,'12.0.3')<0){_this6.modifierForAbilitiesAndSavingThrows(data);}if(_this6.versionCompare(sheetVersion,'12.0.4')<0){_this6.globalBonusesToModifiers(data);}if(_this6.versionCompare(sheetVersion,'13.0.1')<0){_this6.abilityBonusesToModifiers(data);_this6.savingThrowBonusesToModifiers(data);_this6.armorTypeUpgrade(data);}if(_this6.versionCompare(sheetVersion,'14.0.0')<0){_this6.qtyToUses(data);_this6.attacksToOffense(data);}if(_this6.versionCompare(sheetVersion,'14.1.0')<0){_this6.clearUsesMax(data);_this6.weightPerUse(data);}},callback:function callback(){if(_this6.versionCompare(sheetVersion,'9.0.0')<0){senses.update();speeds.update();proficiencyBonus.update();}if(_this6.versionCompare(sheetVersion,'9.1.0')<0){spells.generateHigherLevelQueries();spells.count();}if(_this6.versionCompare(sheetVersion,'9.2.1')<0){classes.updateLevels();}if(_this6.versionCompare(sheetVersion,'10.0.0')<0){actions.updateChatMacroForAll();}if(_this6.versionCompare(sheetVersion,'10.1.0')<0){spells.findSpellcasting();}if(_this6.versionCompare(sheetVersion,'11.0.0')<0){hitDice.update();spells.updateSlots();classFeatures.determineClassFeatures();}if(_this6.versionCompare(sheetVersion,'13.0.1')<0){abilities.update();abilityChecks.update();abilityChecks.updateSkill();savingThrows.updateSavingThrows();spells.updateDCAndAttack();}if(_this6.versionCompare(sheetVersion,'14.1.1')<0){actions.updateAll();equipment.update();equipment.updateArmor();}if(_this6.versionCompare(sheetVersion,'14.2.5')<0){actions.updateAll();spells.update();}if(_this6.versionCompare(sheetVersion,'15.0.0')<0){modifiers.update();}processing.clearProcessing();},alwaysExecuteCallback:true});}},{key:'upgrade',value:function upgrade(sheetVersion){var _this7=this;var upgrades=['8.0.0','9.0.0','9.1.0','9.2.0','9.2.1','10.0.0','10.1.0','10.1.1','10.1.3','11.0.0','11.3.2','12.0.0','12.0.3','12.0.4','12.0.5','13.0.1','14.0.0','14.1.0','14.1.1','14.2.5','15.0.0'];var upgradesToRun=[];upgrades.forEach(function(version){if(_this7.versionCompare(sheetVersion,version)<0){upgradesToRun.push(version);}});if(upgradesToRun&&upgradesToRun.length>0){processing.addToProcessing(upgradesToRun,function(){_this7.runUpgrade(sheetVersion);});}}}]);return Upgrade;}();
+'use strict';Object.defineProperty(exports,"__esModule",{value:true});exports.Upgrade=undefined;var _createClass=function(){function defineProperties(target,props){for(var i=0;i10){data[repString+'_content']+='\n'+data[repString+'_display_text'];}data[repString+'_display_text']='';}if((0,_utilities.exists)(data[repString+'_freeform'])){data.show_freeform=1;}});}},{key:'addFeetAndMetersBack',value:function addFeetAndMetersBack(data,field){if((0,_utilities.exists)(data[field])){if((0,_utilities.isUndefinedOrEmpty)(data.distance_system)||data.distance_system==='FEET'){var unit='ft.';if(!isNaN(data[field])||!data[field].includes(unit)||!data[field].includes(' ft')){data[field]=data[field]+' '+unit;}}else if(data.distance_system==='METERS'){var _unit='m.';if(!isNaN(data[field])||!data[field].includes(_unit)){data[field]=data[field]+' '+_unit;}}}}},{key:'convertOldStorageName',value:function convertOldStorageName(data,name){var storageNames={'Magic Item Analysis':'CLASS_FEATURE_ARTIFICER_MAGIC_ITEM_ANALYSIS','Tool Expertise':'CLASS_FEATURE_ARTIFICER_TOOL_EXPERTISE','Wondrous Invention':'CLASS_FEATURE_ARTIFICER_WONDROUS_INVENTION','Infuse Magic':'CLASS_FEATURE_ARTIFICER_INFUSE_MAGIC','Superior Attunement':'CLASS_FEATURE_ARTIFICER_SUPERIOR_ATTUNEMENT','Mechanical Servant':'CLASS_FEATURE_ARTIFICER_MECHANICAL_SERVANT','Soul of Artifice':'CLASS_FEATURE_ARTIFICER_SOUL_OF_ARTIFICE',Rage:'CLASS_FEATURE_BARBARIAN_RAGE','Unarmored Defense Barbarian':'CLASS_FEATURE_BARBARIAN_UNARMORED_DEFENSE','Reckless Attack':'CLASS_FEATURE_BARBARIAN_RECKLESS_ATTACK','Danger Sense':'CLASS_FEATURE_BARBARIAN_DANGER_SENSE','Fast Movement':'CLASS_FEATURE_BARBARIAN_FAST_MOVEMENT','Feral Instinct':'CLASS_FEATURE_BARBARIAN_FERAL_INSTINCT','Brutal Critical':'CLASS_FEATURE_BARBARIAN_BRUTAL_CRITICAL','Relentless Rage':'CLASS_FEATURE_BARBARIAN_RELENTLESS_RAGE','Persistent Rage':'CLASS_FEATURE_BARBARIAN_PERSISTENT_RAGE','Indomitable Might':'CLASS_FEATURE_BARBARIAN_INDOMITABLE_MIGHT','Primal Champion':'CLASS_FEATURE_BARBARIAN_PRIMAL_CHAMPION','Bardic Inspiration':'CLASS_FEATURE_BARD_BARDIC_INSPIRATION','Song of Rest':'CLASS_FEATURE_BARD_SONG_OF_REST','Expertise Bard':'CLASS_FEATURE_BARD_EXPERTISE',Countercharm:'CLASS_FEATURE_BARD_COUNTERCHARM','Magical Secrets':'CLASS_FEATURE_BARD_MAGICAL_SECRETS','Superior Inspiration':'CLASS_FEATURE_BARD_SUPERIOR_INSPIRATION','Channel Divinity Cleric':'CLASS_FEATURE_CLERIC_CHANNEL_DIVINITY','Turn Undead':'CLASS_FEATURE_CLERIC_CHANNEL_DIVINITY_TURN_UNDEAD','Divine Intervention':'CLASS_FEATURE_CLERIC_DIVINE_INTERVENTION','Wild Shape':'CLASS_FEATURE_DRUID_WILD_SHAPE','Beast Spells':'CLASS_FEATURE_DRUID_BEAST_SPELLS',Archdruid:'CLASS_FEATURE_DRUID_ARCHDRUID','Fighting Style (Fighter)':'CLASS_FEATURE_FIGHTER_FIGHTING_STYLE','Second Wind':'CLASS_FEATURE_FIGHTER_SECOND_WIND','Action Surge':'CLASS_FEATURE_FIGHTER_ACTION_SURGE',Indomitable:'CLASS_FEATURE_FIGHTER_INDOMITABLE','Unarmored Defense Monk':'CLASS_FEATURE_MONK_UNARMORED_DEFENSE','Martial Arts':'CLASS_FEATURE_MONK_MARTIAL_ARTS',Ki:'CLASS_FEATURE_MONK_KI','Flurry of Blows':'CLASS_FEATURE_MONK_FLURRY_OF_BLOWS','Patient Defense':'CLASS_FEATURE_MONK_PATIENT_DEFENSE','Step of the Wind':'CLASS_FEATURE_MONK_STEP_OF_THE_WIND','Unarmored Movement':'CLASS_FEATURE_MONK_UNARMORED_MOVEMENT','Deflect Missiles':'CLASS_FEATURE_MONK_DEFLECT_MISSILES','Slow Fall':'CLASS_FEATURE_MONK_SLOW_FALL','Stunning Strike':'CLASS_FEATURE_MONK_STUNNING_STRIKE','Ki-Empowered Strikes':'CLASS_FEATURE_MONK_KI_EMPOWERED_STRIKES','Stillness of Mind':'CLASS_FEATURE_MONK_STILLNESS_OF_MIND','Purity of Body':'CLASS_FEATURE_MONK_PURITY_OF_BODY','Tongue of the Sun and Moon':'CLASS_FEATURE_MONK_TONGUE_OF_THE_SUN_AND_MOON','Diamond Soul':'CLASS_FEATURE_MONK_DIAMOND_SOUL','Empty Body':'CLASS_FEATURE_MONK_EMPTY_BODY','Perfect Self':'CLASS_FEATURE_MONK_PERFECT_SELF','Divine Sense':'CLASS_FEATURE_PALADIN_DIVINE_SENSE','Lay on Hands':'CLASS_FEATURE_PALADIN_LAY_ON_HANDS','Fighting Style (Paladin)':'CLASS_FEATURE_PALADIN_FIGHTING_STYLE','Divine Smite':'CLASS_FEATURE_PALADIN_DIVINE_SMITE','Divine Health':'CLASS_FEATURE_PALADIN_DIVINE_HEALTH','Channel Divinity Paladin':'CLASS_FEATURE_PALADIN_CHANNEL_DIVINITY','Aura of Protection':'CLASS_FEATURE_PALADIN_AURA_OF_PROTECTION','Aura of Courage':'CLASS_FEATURE_PALADIN_AURA_OF_COURAGE','Improved Divine Smite':'CLASS_FEATURE_PALADIN_IMPROVED_DIVINE_SMITE','Cleaning Touch':'CLASS_FEATURE_PALADIN_CLEANSING_TOUCH','Favored Enemy':'CLASS_FEATURE_RANGER_FAVORED_ENEMY','Natural Explorer':'CLASS_FEATURE_RANGER_NATURAL_EXPLORER','Primeval Awareness':'CLASS_FEATURE_RANGER_PRIMEVAL_AWARENESS','Land\'s Stride':'CLASS_FEATURE_RANGER_LANDS_STRIDE','Hide in Plain Sight':'CLASS_FEATURE_RANGER_HIDE_IN_PLAIN_SIGHT','Foe Slayer':'CLASS_FEATURE_RANGER_FOE_SLAYER','Favored Enemy UA':'CLASS_FEATURE_RANGERUA_FAVORED_ENEMY','Natural Explorer UA':'CLASS_FEATURE_RANGERUA_NATURAL_EXPLORER','Primeval Awareness UA':'CLASS_FEATURE_RANGERUA_PRIMEVAL_AWARENESS','Greater Favored Enemy':'CLASS_FEATURE_RANGERUA_GREATER_FAVORED_ENEMY','Fleet of Foot':'CLASS_FEATURE_RANGERUA_FLEET_OF_FOOT','Hide in Plain Sight UA':'CLASS_FEATURE_RANGERUA_HIDE_IN_PLAIN_SIGHT','Foe Slayer UA':'CLASS_FEATURE_RANGERUA_FOE_SLAYER','Expertise Rogue':'CLASS_FEATURE_ROGUE_EXPERTISE','Sneak Attack':'CLASS_FEATURE_ROGUE_SNEAK_ATTACK','Thieves\' Cant':'CLASS_FEATURE_ROGUE_THIEVES_CANT','Cunning Action':'CLASS_FEATURE_ROGUE_CUNNING_ACTION','Uncanny Dodge':'CLASS_FEATURE_ROGUE_UNCANNY_DODGE','Reliable Talent':'CLASS_FEATURE_ROGUE_RELIABLE_TALENT',Blindsense:'CLASS_FEATURE_ROGUE_BLINDSENSE','Slippery Mind':'CLASS_FEATURE_ROGUE_SLIPPERY_MIND',Elusive:'CLASS_FEATURE_ROGUE_ELUSIVE','Stroke of Luck':'CLASS_FEATURE_ROGUE_STROKE_OF_LUCK','Sorcery Points':'CLASS_FEATURE_SORCERER_SORCERY_POINTS','Flexible Casting':'CLASS_FEATURE_SORCERER_FLEXIBLE_CASTING',Metamagic:'CLASS_FEATURE_SORCERER_METAMAGIC','Careful Spell':'CLASS_FEATURE_SORCERER_METAMAGIC_CAREFUL_SPELL','Distant Spell':'CLASS_FEATURE_SORCERER_METAMAGIC_DISTANT_SPELL','Empowered Spell':'CLASS_FEATURE_SORCERER_METAMAGIC_EMPOWERED_SPELL','Extended Spell':'CLASS_FEATURE_SORCERER_METAMAGIC_EXTENDED_SPELL','Heightened Spell':'CLASS_FEATURE_SORCERER_METAMAGIC_HEIGHTENED_SPELL','Quickened Spell':'CLASS_FEATURE_SORCERER_METAMAGIC_QUICKENED_SPELL','Subtle Spell':'CLASS_FEATURE_SORCERER_METAMAGIC_SUBTLE_SPELL','Twinned Spell':'CLASS_FEATURE_SORCERER_METAMAGIC_TWINNED_SPELL','Sorcerous Restoration':'CLASS_FEATURE_SORCERER_SORCEROUS_RESTORATION','Eldritch Invocations':'CLASS_FEATURE_WARLOCK_ELDRITCH_INVOCATIONS','Pact Boon':'CLASS_FEATURE_WARLOCK_PACT_BOON','Mystic Arcanum':'CLASS_FEATURE_WARLOCK_MYSTIC_ARCANUM','Eldritch Master':'CLASS_FEATURE_WARLOCK_ELDRITCH_MASTER','Arcane Recovery':'CLASS_FEATURE_WIZARD_ARCANE_RECOVERY','Spell Mastery':'CLASS_FEATURE_WIZARD_SPELL_MASTERY','Signature Spells':'CLASS_FEATURE_WIZARD_SIGNATURE_SPELLS'};var newClassFeature=void 0;if(name==='Evasion'){if(data.monk_level>=0){newClassFeature='CLASS_FEATURE_MONK_EVASION';}else{newClassFeature='CLASS_FEATURE_ROGUE_EVASION';}}else if(name==='Vanish'){if(data.rangerua_level>=0){newClassFeature='CLASS_FEATURE_RANGERUA_VANISH';}else{newClassFeature='CLASS_FEATURE_RANGER_VANISH';}}else if(name==='Feral Senses'){if(data.rangerua_level>=0){newClassFeature='CLASS_FEATURE_RANGERUA_FERAL_SENSES';}else{newClassFeature='CLASS_FEATURE_RANGER_FERAL_SENSES';}}else if(name==='Fighting Style (Ranger)'){if(data.rangerua_level>=0){newClassFeature='CLASS_FEATURE_RANGERUA_FIGHTING_STYLE';}else{newClassFeature='CLASS_FEATURE_RANGER_FIGHTING_STYLE';}}else if(name==='Timeless Body'){if(data.druid_level>=0){newClassFeature='CLASS_FEATURE_DRUID_TIMELESS_BODY';}else{newClassFeature='CLASS_FEATURE_MONK_TIMELESS_BODY';}}else{newClassFeature=storageNames[name]||'';}return newClassFeature;}},{key:'handle9Point1Upgrade',value:function handle9Point1Upgrade(data){if((0,_utilities.exists)(data.halfling_luck)){data.halfling_luck=1;data.d20_mod='ro<1';}else{data.d20_mod='';}if((0,_utilities.exists)(data.initiative_to_tracker)){if(data.initiative_to_tracker==='@{initiative_formula}'){data.initiative_to_tracker=0;}else{data.initiative_to_tracker=1;}}if((0,_utilities.exists)(data.initiative_tie_breaker)&&data.initiative_tie_breaker==='[[@{initiative} / 100]][tie breaker]'){data.initiative_tie_breaker=1;}if((0,_utilities.exists)(data.critical_damage_maximized)){data.critical_damage_houserule='CRITICAL_DAMAGE_IS_MAXIMIZED';}if((0,_utilities.exists)(data.brutal_critical)){data.class_feature_barbarian_brutal_critical_toggle=1;}if((0,_utilities.exists)(data.distance_system)){data.distance_system=data.distance_system.toUpperCase();}if((0,_utilities.exists)(data.reliable_talent)){data.class_feature_rogue_reliable_talent_toggle=1;}}},{key:'restoreReachAndRange',value:function restoreReachAndRange(data){var _this3=this;_constants.SENSES.forEach(function(sense){_this3.addFeetAndMetersBack(data,sense);});_constants.SPEEDS.forEach(function(speed){_this3.addFeetAndMetersBack(data,speed);});actionsRepStrings(data).forEach(function(repString){_this3.addFeetAndMetersBack(data,repString+'_reach');_this3.addFeetAndMetersBack(data,repString+'_range');});}},{key:'traitsToClassFeatures',value:function traitsToClassFeatures(data){var _this4=this;traitsRepStrings(data).forEach(function(repString){if(data[repString+'_storage_name']){var newRepString='repeating_classfeature_'+generateRowID();var fieldsToConvert=['toggle_details','storage_name'].concat(_constants.REPEATING_FIELDS.default).concat(_constants.REPEATING_FIELDS.modifiersAndProperties).concat(_constants.REPEATING_FIELDS.parse).concat(_constants.REPEATING_FIELDS.recharge).concat(_constants.REPEATING_FIELDS.uses).concat(_constants.REPEATING_FIELDS.cost).concat(_constants.REPEATING_FIELDS.content).concat(_constants.REPEATING_FIELDS.savingThrow).concat(_constants.REPEATING_FIELDS.savingThrowDamage).concat(_constants.REPEATING_FIELDS.savingThrowSecondDamage).concat(_constants.REPEATING_FIELDS.otherDamage).concat(_constants.REPEATING_FIELDS.otherSecondDamage).concat(_constants.REPEATING_FIELDS.heal).concat(_constants.REPEATING_FIELDS.extras).concat(['roll_toggle','display_text','heal','higher_level_dice','type']).concat(['damage','damage_ability','damage_bonus','damage_type']).concat(['second_damage_toggle','second_damage','second_damage_ability','second_damage_bonus','second_damage_type']);fieldsToConvert.forEach(function(field){if(field==='storage_name'){data[newRepString+'_storage_name']=_this4.convertOldStorageName(data,data[repString+'_storage_name']);}else if(field==='recharge'){data[newRepString+'_recharge']=_this4.translateRecharge(data,repString);}else if((0,_utilities.exists)(data[repString+'_'+field])){data[newRepString+'_'+field]=data[repString+'_'+field];}});removeRepeatingRowAndFromData(data,repString);}});}},{key:'racialFeaturesToRacialTraits',value:function racialFeaturesToRacialTraits(data){racialFeaturesRepStrings(data).forEach(function(repString){var newRepString='repeating_racialtrait_'+generateRowID();var fieldsToConvert=['toggle_details','storage_name'].concat(_constants.REPEATING_FIELDS.default).concat(_constants.REPEATING_FIELDS.modifiersAndProperties).concat(_constants.REPEATING_FIELDS.parse).concat(_constants.REPEATING_FIELDS.recharge).concat(_constants.REPEATING_FIELDS.uses).concat(_constants.REPEATING_FIELDS.cost).concat(_constants.REPEATING_FIELDS.content).concat(_constants.REPEATING_FIELDS.savingThrow).concat(_constants.REPEATING_FIELDS.savingThrowDamage).concat(_constants.REPEATING_FIELDS.savingThrowSecondDamage).concat(_constants.REPEATING_FIELDS.otherDamage).concat(_constants.REPEATING_FIELDS.otherSecondDamage).concat(_constants.REPEATING_FIELDS.heal).concat(_constants.REPEATING_FIELDS.extras);fieldsToConvert.forEach(function(field){data[newRepString+'_'+field]=data[repString+'_'+field];});removeRepeatingRowAndFromData(data,repString);});}},{key:'newCantripFormula',value:function newCantripFormula(data){spellsRepStrings(data).forEach(function(repString){var prefixes=['attack','saving_throw','other'];prefixes.forEach(function(prefix){if(data[repString+'_'+prefix+'_damage_dice']==='((@{level} + 1) / 6 + 0.5)'){data[repString+'_'+prefix+'_damage_dice']='[[ceil((@{level} + 2) / 6)]]';}if(data[repString+'_'+prefix+'_damage_dice']==='((@{caster_level} + 1) / 6 + 0.5)'){data[repString+'_'+prefix+'_damage_dice']='[[ceil((@{caster_level} + 2) / 6)]]';}});});}},{key:'deathSaveProf',value:function deathSaveProf(data){if((0,_utilities.exists)(data.death_saving_throw_prof)){data.death_saving_throw_proficient=1;}}},{key:'savingThrowsSaveToSavingThrow',value:function savingThrowsSaveToSavingThrow(data){if((0,_utilities.exists)(data.death_save_output_option)){data.death_saving_throw_output_option=data.death_save_output_option;}_constants.SAVING_THROWS.concat(_constants.CUSTOM_SAVING_THROWS).forEach(function(savingThrow){if((0,_utilities.exists)(data[savingThrow+'_save_prof'])){data[savingThrow+'_saving_throw_proficient']=1;}if((0,_utilities.exists)(data[savingThrow+'_save_bonus'])){data[savingThrow+'_saving_throw_bonus']=data[savingThrow+'_save_bonus'];}});}},{key:'unarmoredToArmor',value:function unarmoredToArmor(data){var repString='repeating_armor_'+generateRowID();if((0,_utilities.exists)(data.ac_unarmored_ability)){data[repString+'_ac_base']=10;if((0,_utilities.exists)(data.ac_ability)){data[repString+'_ac_ability']=data.ac_ability;}else{data[repString+'_ac_ability']='DEX';}if(data.ac_unarmored_ability!=='CON'&&(0,_utilities.exists)(data.barbarian_level)){data[repString+'_name']=getTranslationByKey('CLASS_FEATURE_BARBARIAN_UNARMORED_DEFENSE');data[repString+'_ac_second_ability']='CON';}else if(data.ac_unarmored_ability!=='CON'&&(0,_utilities.exists)(data.monk_level)){data[repString+'_name']=getTranslationByKey('CLASS_FEATURE_MONK_UNARMORED_DEFENSE');data[repString+'_ac_second_ability']='WIS';}else{data[repString+'_name']='Old unarmored';data[repString+'_ac_second_ability']=data.ac_unarmored_ability;}data.ac_ability='';data.ac_unarmored_ability='';}else if((0,_utilities.exists)(data.ac_ability)&&data.ac_ability!=='DEX'){data[repString+'_name']='Old armor modifiers';data[repString+'_ac_base']=10;data[repString+'_ac_ability']=data.ac_ability;data.ac_ability='';}if((0,_utilities.exists)(data.ac_armored_bonus)){repString='repeating_armor_'+generateRowID();data[repString+'_name']='Old armor modifier';data[repString+'_ac_bonus']=data.ac_armored_bonus;data.ac_armored_bonus='';}if((0,_utilities.exists)(data.ac_unarmored_bonus)){repString='repeating_armor_'+generateRowID();data[repString+'_name']='Old armor modifier';data[repString+'_ac_bonus']=data.ac_unarmored_bonus;data.ac_unarmored_bonus='';}}},{key:'modifierForAbilitiesAndSavingThrows',value:function modifierForAbilitiesAndSavingThrows(data){modifiersRepStrings(data).forEach(function(repString){if((0,_utilities.exists)(data[repString+'_ability_checks_modifier'])){data[repString+'_ability_check_modifier']=data[repString+'_ability_checks_modifier'];data[repString+'_ability_checks_modifier']='';}if((0,_utilities.exists)(data[repString+'_saving_throws_modifier'])){data[repString+'_saving_throw_modifier']=data[repString+'_saving_throws_modifier'];data[repString+'_saving_throws_modifier']='';}});}},{key:'globalBonusesToModifiers',value:function globalBonusesToModifiers(data){var repString='repeating_modifier_'+generateRowID();if((0,_utilities.exists)(data.global_ability_bonus)||(0,_utilities.exists)(data.global_check_bonus)||(0,_utilities.exists)(data.global_saving_throw_bonus)||(0,_utilities.exists)(data.global_attack_bonus)||(0,_utilities.exists)(data.global_melee_attack_bonus)||(0,_utilities.exists)(data.global_ranged_attack_bonus)||(0,_utilities.exists)(data.global_spell_attack_bonus)||(0,_utilities.exists)(data.global_damage_bonus)||(0,_utilities.exists)(data.global_melee_damage_bonus)||(0,_utilities.exists)(data.global_ranged_damage_bonus)||(0,_utilities.exists)(data.global_spell_damage_bonus)||(0,_utilities.exists)(data.global_spell_dc_bonus)||(0,_utilities.exists)(data.global_spell_heal_bonus)){data[repString+'_name']='Old modifiers';}if((0,_utilities.exists)(data.global_ability_bonus)){data[repString+'_ability_score_modifier']=data.global_ability_bonus;data[repString+'_ability_score_toggle']=1;data.global_ability_bonus='';}if((0,_utilities.exists)(data.global_check_bonus)){data[repString+'_ability_check_modifier']=data.global_check_bonus;data[repString+'_ability_check_toggle']=1;data.global_check_bonus='';}if((0,_utilities.exists)(data.global_saving_throw_bonus)){data[repString+'_saving_throw_modifier']=data.global_saving_throw_bonus;data[repString+'_saving_throw_toggle']=1;data.global_saving_throw_bonus='';}if((0,_utilities.exists)(data.global_attack_bonus)){data[repString+'_attack_modifier']=data.global_attack_bonus;data[repString+'_attack_toggle']=1;data.global_attack_bonus='';}if((0,_utilities.exists)(data.global_melee_attack_bonus)){data[repString+'_melee_weapon_attack_modifier']=data.global_melee_attack_bonus;data[repString+'_attack_toggle']=1;data.global_melee_attack_bonus='';}if((0,_utilities.exists)(data.global_ranged_attack_bonus)){data[repString+'_ranged_weapon_attack_modifier']=data.global_ranged_attack_bonus;data[repString+'_attack_toggle']=1;data.global_ranged_attack_bonus='';}if((0,_utilities.exists)(data.global_spell_attack_bonus)){data[repString+'_spell_attack_modifier']=data.global_spell_attack_bonus;data[repString+'_attack_toggle']=1;data.global_spell_attack_bonus='';}if((0,_utilities.exists)(data.global_damage_bonus)){data[repString+'_damage_modifier']=data.global_damage_bonus;data[repString+'_damage_toggle']=1;data.global_damage_bonus='';}if((0,_utilities.exists)(data.global_melee_damage_bonus)){data[repString+'_melee_weapon_damage_modifier']=data.global_melee_damage_bonus;data[repString+'_damage_toggle']=1;data.global_melee_damage_bonus='';}if((0,_utilities.exists)(data.global_ranged_damage_bonus)){data[repString+'_ranged_weapon_damage_modifier']=data.global_ranged_damage_bonus;data[repString+'_damage_toggle']=1;data.global_ranged_damage_bonus='';}if((0,_utilities.exists)(data.global_spell_damage_bonus)){data[repString+'_spell_damage_modifier']=data.global_spell_damage_bonus;data[repString+'_damage_toggle']=1;data.global_spell_damage_bonus='';}if((0,_utilities.exists)(data.global_spell_dc_bonus)){data[repString+'_spell_dc_modifier']=data.global_spell_dc_bonus;data[repString+'_spell_toggle']=1;data.global_spell_dc_bonus='';}if((0,_utilities.exists)(data.global_spell_heal_bonus)){data[repString+'_spell_heal_modifier']=data.global_spell_heal_bonus;data[repString+'_spell_toggle']=1;data.global_spell_heal_bonus='';}}},{key:'abilityBonusesToModifiers',value:function abilityBonusesToModifiers(data){modifiersRepStrings(data).forEach(function(repString){if((0,_utilities.exists)(data[repString+'_active'])||(0,_utilities.isUndefined)(data[repString+'_active'])){data[repString+'_active']=1;}});modifiersRepStrings(data).forEach(function(repString){if((0,_utilities.exists)(data[repString+'_ability_toggle'])){data[repString+'_ability_score_toggle']=1;data[repString+'_ability_check_toggle']=1;data[repString+'_ability_toggle']='';}});var newRepString='repeating_modifier_'+generateRowID();_constants.ABILITIES.forEach(function(ability){if((0,_utilities.exists)(data[ability+'_bonus'])||(0,_utilities.exists)(data[ability+'_check_bonus'])){data[newRepString+'_name']='Old ability modifiers';}if((0,_utilities.exists)(data[ability+'_bonus'])){data[newRepString+'_ability_score_toggle']=1;data[newRepString+'_'+ability+'_score_modifier']=data[ability+'_bonus'];data[ability+'_bonus']='';}if((0,_utilities.exists)(data[ability+'_check_bonus'])){data[newRepString+'_ability_check_toggle']=1;data[newRepString+'_'+ability+'_check_modifier']=data[ability+'_check_bonus'];data[ability+'_check_bonus']='';}});if((0,_utilities.exists)(data.initiative_bonus)){data[newRepString+'_name']='Old ability modifiers';data[newRepString+'_ability_check_toggle']=1;data[newRepString+'_initiative_modifier']=data.initiative_bonus;data.initiative_bonus='';}if((0,_utilities.exists)(data.initiative_second_ability)){data[newRepString+'_name']='Old ability modifiers';data[newRepString+'_ability_check_toggle']=1;data[newRepString+'_initiative_modifier_ability']=data.initiative_second_ability;data.initiative_second_ability='';}var i=0;skillsRepStrings(data).forEach(function(repString){if((0,_utilities.exists)(data[repString+'_bonus'])){data[newRepString+'_ability_check_toggle']=1;data[newRepString+'_skill_'+i+'_modifier']=1;data[repString+'_bonus']='';}if((0,_utilities.exists)(data[repString+'_passive_bonus'])){data[newRepString+'_ability_check_toggle']=1;data[newRepString+'_skill_'+i+'_passive_modifier']=1;data[repString+'_passive_bonus']='';}i+=1;});}},{key:'savingThrowBonusesToModifiers',value:function savingThrowBonusesToModifiers(data){var repString='repeating_modifier_'+generateRowID();_constants.SAVING_THROWS.concat(_constants.CUSTOM_SAVING_THROWS).forEach(function(savingThrow){if((0,_utilities.exists)(data[savingThrow+'_bonus'])){data[repString+'_name']='Old saving throw modifiers';data[repString+'_'+savingThrow+'_modifier']=data[savingThrow+'_bonus'];data[savingThrow+'_bonus']='';}});}},{key:'armorTypeUpgrade',value:function armorTypeUpgrade(data){armorRepStrings(data).forEach(function(repString){if(!data[repString+'_type']){data[repString+'_type']='LIGHT_ARMOR';}});}},{key:'qtyToUses',value:function qtyToUses(data){ammoRepStrings(data).forEach(function(repString){if((0,_utilities.exists)(data[repString+'_qty'])){data[repString+'_uses']=data[repString+'_qty'];data[repString+'_qty']='';}});equipmentRepStrings(data).forEach(function(repString){if((0,_utilities.exists)(data[repString+'_qty'])){if((0,_utilities.exists)(data[repString+'_weight'])){data[repString+'_weight_per_use']=1;}data[repString+'_uses']=data[repString+'_qty'];data[repString+'_qty']='';}});}},{key:'clearUsesMax',value:function clearUsesMax(data){actionsRepStrings(data).concat(equipmentRepStrings(data)).concat(armorRepStrings(data)).forEach(function(repString){if((0,_utilities.exists)(data[repString+'_uses_max'])&&!(0,_utilities.exists)(data[repString+'_recharge'])){data[repString+'_uses_max']='';}});}},{key:'attacksToOffense',value:function attacksToOffense(data){var _this5=this;var fieldsToConvert=_constants.REPEATING_FIELDS.default.concat(_constants.REPEATING_FIELDS.modifiersAndProperties).concat(_constants.REPEATING_FIELDS.parse).concat(_constants.REPEATING_FIELDS.uses).concat(_constants.REPEATING_FIELDS.cost).concat(_constants.REPEATING_FIELDS.recharge).concat(_constants.REPEATING_FIELDS.content).concat(_constants.REPEATING_FIELDS.attack).concat(_constants.REPEATING_FIELDS.attackDamage).concat(_constants.REPEATING_FIELDS.attackSecondDamage).concat(_constants.REPEATING_FIELDS.savingThrow).concat(_constants.REPEATING_FIELDS.savingThrowDamage).concat(_constants.REPEATING_FIELDS.savingThrowSecondDamage).concat(_constants.REPEATING_FIELDS.otherDamage).concat(_constants.REPEATING_FIELDS.otherSecondDamage).concat(_constants.REPEATING_FIELDS.heal).concat(_constants.REPEATING_FIELDS.extras);attacksRepStrings(data).forEach(function(repString){if((0,_utilities.exists)(data[repString+'_name'])){var newRepeatingString='repeating_offense_'+generateRowID();fieldsToConvert.forEach(function(field){_this5.oldRepeatingValueToNew(data,repString,newRepeatingString,field);});}removeRepeatingRowAndFromData(data,repString);});}},{key:'weightPerUse',value:function weightPerUse(data){ammoRepStrings(data).forEach(function(repString){if((0,_utilities.exists)(data[repString+'_weight_per_use'])){data[repString+'_weight']=data[repString+'_weight_per_use'];data[repString+'_weight_per_use']=1;}});equipmentRepStrings(data).forEach(function(repString){if((0,_utilities.exists)(data[repString+'_weight_per_use'])){data[repString+'_weight']=data[repString+'_weight_per_use'];data[repString+'_weight_per_use']=1;}});}},{key:'versionCompare',value:function versionCompare(left,right){if(typeof left!=='string'||typeof right!=='string'){return false;}var a=left.split('.');var b=right.split('.');var len=Math.max(a.length,b.length);for(var i=0;i0||(0,_utilities.getIntValue)(a[i])>(0,_utilities.getIntValue)(b[i])){return 1;}else if(b[i]&&!a[i]&&(0,_utilities.getIntValue)(b[i])>0||(0,_utilities.getIntValue)(a[i])<(0,_utilities.getIntValue)(b[i])){return-1;}}return 0;}},{key:'runUpgrade',value:function runUpgrade(sheetVersion){var _this6=this;var repeatingSections=[];var collectionArray=[];if(this.versionCompare(sheetVersion,'8.0.0')<0){collectionArray=collectionArray.concat(_constants.FIELDS.d20).concat(['roll_setting']);repeatingSections=repeatingSections.concat({name:'repeating_skill',collectionArrayAddItems:['skill_d20']});}if(this.versionCompare(sheetVersion,'9.0.0')<0){collectionArray=collectionArray.concat(_constants.FIELDS.d20).concat(['roll_setting']).concat(['spell_ability','ac_ability','ac_unarmored_ability','initiative_ability','hide_spell_content','hide_content','spell_slots_toggle','spell_points_toggle','spell_condensed','spell_contents','attacks_vs_target_ac','attacks_vs_target_name','legendary_action_amount','auto_revert_advantage','saving_throws_half_proficiency','weight_system']).concat(['size','initiative_roll','ammo_used']);}if(this.versionCompare(sheetVersion,'9.1.0')<0){resistances.updateDamageResistances();collectionArray=collectionArray.concat(['halfling_luck','initiative_to_tracker','initiative_tie_breaker','critical_damage_maximized','brutal_critical','reliable_talent']).concat(['distance_system']).concat(_constants.SENSES).concat(_constants.SPEEDS);var actionTypes=['action','reaction','legendaryaction','lairaction','regionaleffect','trait'];var repeatingActionsAndSpells=actionTypes.map(function(actionType){return'repeating_'+actionType;}).concat(_constants.SPELL_LEVELS.map(function(spellLevel){return'repeating_spell'+spellLevel;}));repeatingSections=repeatingSections.concat(repeatingActionsAndSpells.map(function(repeatingSection){return{name:repeatingSection,collectionArrayAddItems:['storage_name'].concat(_constants.REPEATING_FIELDS.default).concat(_constants.REPEATING_FIELDS.modifiersAndProperties).concat(_constants.REPEATING_FIELDS.parse).concat(_constants.REPEATING_FIELDS.recharge).concat(_constants.REPEATING_FIELDS.uses).concat(_constants.REPEATING_FIELDS.cost).concat(_constants.REPEATING_FIELDS.content).concat(_constants.REPEATING_FIELDS.attack).concat(_constants.REPEATING_FIELDS.attackDamage).concat(_constants.REPEATING_FIELDS.attackSecondDamage).concat(_constants.REPEATING_FIELDS.savingThrow).concat(_constants.REPEATING_FIELDS.savingThrowDamage).concat(_constants.REPEATING_FIELDS.savingThrowSecondDamage).concat(_constants.REPEATING_FIELDS.otherDamage).concat(_constants.REPEATING_FIELDS.otherSecondDamage).concat(_constants.REPEATING_FIELDS.heal).concat(_constants.REPEATING_FIELDS.extras).concat(['roll_toggle','display_text','heal','higher_level_dice','type']).concat(['damage','damage_ability','damage_bonus','damage_type']).concat(['second_damage_toggle','second_damage','second_damage_ability','second_damage_bonus','second_damage_type'])};}));}if(this.versionCompare(sheetVersion,'9.2.0')<0){collectionArray=collectionArray.concat(['death_saving_throw_prof']);}if(this.versionCompare(sheetVersion,'10.0.0')<0){repeatingSections=repeatingSections.concat({name:'repeating_racialfeature',collectionArrayAddItems:['toggle_details','storage_name'].concat(_constants.REPEATING_FIELDS.default).concat(_constants.REPEATING_FIELDS.modifiersAndProperties).concat(_constants.REPEATING_FIELDS.parse).concat(_constants.REPEATING_FIELDS.recharge).concat(_constants.REPEATING_FIELDS.uses).concat(_constants.REPEATING_FIELDS.cost).concat(_constants.REPEATING_FIELDS.content).concat(_constants.REPEATING_FIELDS.attack).concat(_constants.REPEATING_FIELDS.attackDamage).concat(_constants.REPEATING_FIELDS.attackSecondDamage).concat(_constants.REPEATING_FIELDS.savingThrow).concat(_constants.REPEATING_FIELDS.savingThrowDamage).concat(_constants.REPEATING_FIELDS.savingThrowSecondDamage).concat(_constants.REPEATING_FIELDS.otherDamage).concat(_constants.REPEATING_FIELDS.otherSecondDamage).concat(_constants.REPEATING_FIELDS.heal).concat(_constants.REPEATING_FIELDS.extras)});}if(this.versionCompare(sheetVersion,'10.1.3')<0){var repeatingSpells=_constants.SPELL_LEVELS.map(function(spellLevel){return'repeating_spell'+spellLevel;});repeatingSections=repeatingSections.concat(repeatingSpells.map(function(repeatingSection){return{name:repeatingSection,collectionArrayAddItems:['attack_damage_dice','saving_throw_damage_dice','other_damage_dice']};}));}if(this.versionCompare(sheetVersion,'11.3.2')<0){collectionArray=collectionArray.concat(['death_save_prof','death_save_output_option']).concat(_constants.SAVING_THROWS.concat(_constants.CUSTOM_SAVING_THROWS).map(function(savingThrow){return savingThrow+'_save_prof';})).concat(_constants.SAVING_THROWS.concat(_constants.CUSTOM_SAVING_THROWS).map(function(savingThrow){return savingThrow+'_save_bonus';})).concat(_constants.SAVING_THROWS.concat(_constants.CUSTOM_SAVING_THROWS).map(function(savingThrow){return savingThrow+'_saving_throw_proficient';})).concat(_constants.SAVING_THROWS.concat(_constants.CUSTOM_SAVING_THROWS).map(function(savingThrow){return savingThrow+'_saving_throw_bonus';}));}if(this.versionCompare(sheetVersion,'12.0.0')<0){collectionArray=collectionArray.concat(['ac_ability','ac_unarmored_ability','ac_armored_bonus','ac_unarmored_bonus','barbarian_level','monk_level']);}if(this.versionCompare(sheetVersion,'12.0.4')<0){collectionArray=collectionArray.concat(['global_ability_bonus','global_check_bonus','global_attack_bonus','global_melee_attack_bonus','global_ranged_attack_bonus','global_spell_attack_bonus','global_damage_bonus','global_melee_damage_bonus','global_ranged_damage_bonus','global_spell_damage_bonus','global_spell_dc_bonus','global_spell_heal_bonus','global_saving_throw_bonus']);}if(this.versionCompare(sheetVersion,'13.0.1')<0){collectionArray=collectionArray.concat(_constants.ABILITIES.map(function(ability){return ability+'_bonus';})).concat(_constants.ABILITIES.map(function(ability){return ability+'_check_bonus';})).concat(['initiative_bonus','initiative_second_ability']).concat(_constants.SAVING_THROWS.concat(_constants.CUSTOM_SAVING_THROWS).map(function(savingThrow){return savingThrow+'_bonus';}));repeatingSections=repeatingSections.concat({name:'repeating_modifier',collectionArrayAddItems:['ability_checks_modifier','saving_throws_modifier'].concat(['active'])}).concat({name:'repeating_armor',collectionArrayAddItems:['type']});}if(this.versionCompare(sheetVersion,'14.0.0')<0){collectionArray=collectionArray.concat(_constants.FIELDS.pb).concat(['distance_system']).concat(_constants.FIELDS.abilityScores).concat(_constants.FIELDS.d20).concat(_constants.FIELDS.savingThrow).concat(_constants.FIELDS.attackModifier).concat(_constants.FIELDS.weaponAttackModifier).concat(_constants.FIELDS.meleeWeaponAttackModifier).concat(_constants.FIELDS.rangedWeaponAttackModifier).concat(_constants.FIELDS.spellAttackModifier).concat(_constants.FIELDS.damageModifier).concat(_constants.FIELDS.weaponDamageModifier).concat(_constants.FIELDS.meleeWeaponDamageModifier).concat(_constants.FIELDS.rangedWeaponDamageModifier).concat(_constants.FIELDS.spellDamageModifier).concat(_constants.FIELDS.attacksVs).concat(_constants.FIELDS.automaticDamage).concat(['show_dice_modifiers','show_crit_range','critical_damage_houserule','savage_attacks','class_feature_barbarian_brutal_critical_toggle','barbarian_level']).concat(['use_custom_saving_throws']).concat(['weight_system','weight_offense','weight_utility']);repeatingSections=repeatingSections.concat({name:'repeating_ammo',collectionArrayAddItems:['weight','qty']}).concat({name:'repeating_equipment',collectionArrayAddItems:['weight','qty']}).concat({name:'repeating_attack',collectionArrayAddItems:_constants.REPEATING_FIELDS.default.concat(_constants.REPEATING_FIELDS.modifiersAndProperties).concat(_constants.REPEATING_FIELDS.parse).concat(_constants.REPEATING_FIELDS.uses).concat(_constants.REPEATING_FIELDS.cost).concat(_constants.REPEATING_FIELDS.recharge).concat(_constants.REPEATING_FIELDS.content).concat(_constants.REPEATING_FIELDS.attack).concat(_constants.REPEATING_FIELDS.attackDamage).concat(_constants.REPEATING_FIELDS.attackSecondDamage).concat(_constants.REPEATING_FIELDS.savingThrow).concat(_constants.REPEATING_FIELDS.savingThrowDamage).concat(_constants.REPEATING_FIELDS.savingThrowSecondDamage).concat(_constants.REPEATING_FIELDS.otherDamage).concat(_constants.REPEATING_FIELDS.otherSecondDamage).concat(_constants.REPEATING_FIELDS.heal).concat(_constants.REPEATING_FIELDS.extras)});}if(this.versionCompare(sheetVersion,'14.1.0')<0){var typesToConvert=_constants.ACTION_TYPES.concat(['equipment','armor']).map(function(actionType){return'repeating_'+actionType;});repeatingSections=repeatingSections.concat(typesToConvert.map(function(repeatingSection){return{name:repeatingSection,collectionArrayAddItems:['uses_max','recharge','weight','weight_per_use']};}));}collectionArray=(0,_utilities.uniqueArray)(collectionArray);server.getSetItems('upgrade.runUpgrade',{repeatingSections:repeatingSections,collectionArray:collectionArray,process:function process(data){if(_this6.versionCompare(sheetVersion,'8.0.0')<0){_this6.removeRollInfo(data);}if(_this6.versionCompare(sheetVersion,'9.0.0')<0){_this6.ammoPerUse(data);_this6.sizeTranslations(data);_this6.updateFieldsFor9(data);_this6.newAttackSetup(data);}if(_this6.versionCompare(sheetVersion,'9.1.0')<0){_this6.handle9Point1Upgrade(data);_this6.restoreReachAndRange(data);_this6.traitsToClassFeatures(data);_this6.translateRecharges(data);}if(_this6.versionCompare(sheetVersion,'9.2.0')<0){_this6.deathSaveProf(data);}if(_this6.versionCompare(sheetVersion,'10.0.0')<0){_this6.racialFeaturesToRacialTraits(data);}if(_this6.versionCompare(sheetVersion,'10.1.3')<0){_this6.newCantripFormula(data);}if(_this6.versionCompare(sheetVersion,'11.3.2')<0){_this6.savingThrowsSaveToSavingThrow(data);}if(_this6.versionCompare(sheetVersion,'12.0.0')<0){_this6.unarmoredToArmor(data);}if(_this6.versionCompare(sheetVersion,'12.0.3')<0){_this6.modifierForAbilitiesAndSavingThrows(data);}if(_this6.versionCompare(sheetVersion,'12.0.4')<0){_this6.globalBonusesToModifiers(data);}if(_this6.versionCompare(sheetVersion,'13.0.1')<0){_this6.abilityBonusesToModifiers(data);_this6.savingThrowBonusesToModifiers(data);_this6.armorTypeUpgrade(data);}if(_this6.versionCompare(sheetVersion,'14.0.0')<0){_this6.qtyToUses(data);_this6.attacksToOffense(data);}if(_this6.versionCompare(sheetVersion,'14.1.0')<0){_this6.clearUsesMax(data);_this6.weightPerUse(data);}},callback:function callback(){if(_this6.versionCompare(sheetVersion,'9.0.0')<0){senses.update();speeds.update();proficiencyBonus.update();}if(_this6.versionCompare(sheetVersion,'9.1.0')<0){spells.generateHigherLevelQueries();spells.count();}if(_this6.versionCompare(sheetVersion,'9.2.1')<0){classes.updateLevels();}if(_this6.versionCompare(sheetVersion,'10.0.0')<0){actions.updateChatMacroForAll();}if(_this6.versionCompare(sheetVersion,'10.1.0')<0){spells.findSpellcasting();}if(_this6.versionCompare(sheetVersion,'11.0.0')<0){hitDice.update();spells.updateSlots();classFeatures.determineClassFeatures();}if(_this6.versionCompare(sheetVersion,'13.0.1')<0){abilities.update();abilityChecks.update();savingThrows.updateSavingThrows();spells.updateDCAndAttack();}if(_this6.versionCompare(sheetVersion,'14.1.1')<0){actions.updateAll();equipment.update();equipment.updateArmor();}if(_this6.versionCompare(sheetVersion,'14.2.5')<0){actions.updateAll();spells.update();}if(_this6.versionCompare(sheetVersion,'15.0.0')<0){modifiers.update();}if(_this6.versionCompare(sheetVersion,'15.5.0')<0){abilityChecks.updateSkill();}processing.clearProcessing();},alwaysExecuteCallback:true});}},{key:'upgrade',value:function upgrade(sheetVersion){var _this7=this;var upgrades=['8.0.0','9.0.0','9.1.0','9.2.0','9.2.1','10.0.0','10.1.0','10.1.1','10.1.3','11.0.0','11.3.2','12.0.0','12.0.3','12.0.4','12.0.5','13.0.1','14.0.0','14.1.0','14.1.1','14.2.5','15.0.0','15.5.0'];var upgradesToRun=[];upgrades.forEach(function(version){if(_this7.versionCompare(sheetVersion,version)<0){upgradesToRun.push(version);}});if(upgradesToRun&&upgradesToRun.length>0){processing.addToProcessing(upgradesToRun,function(){_this7.runUpgrade(sheetVersion);});}}}]);return Upgrade;}();
},{"../abilities/Abilities":1,"../abilities/AbilitiesUtil":2,"../abilities/AbilityChecks":3,"../actions/Actions":9,"../classes/Classes":12,"../equipment/Equipment":13,"../features/classFeatures/ClassFeatures":15,"../hitDice/HitDice":18,"../modifiers/Modifiers":20,"../proficiencyBonus/ProficiencyBonus":23,"../resistances/Resistances":24,"../savingThrows/SavingThrows":26,"../scripts/constants":35,"../senses/Senses":38,"../speeds/Speeds":40,"../spells/Spells":41,"./Processing":32,"./Server":33,"./utilities":37}],35:[function(require,module,exports){
'use strict';Object.defineProperty(exports,"__esModule",{value:true});var ABILITIES=['strength','dexterity','constitution','intelligence','wisdom','charisma','honor','sanity'];var ACTION_TYPES=['offense','utility','action','reaction','legendaryaction','lairaction','regionaleffect','racialtrait','classfeature','feat','trait'];var CLASS_DETAILS={artificer:{hd:'d8',proficiencies:{armor:'Light armor, medium armor',weapons:'Simple weapons',tools:'Thieves\' tools, two other tools of your choice',savingThrows:['constitution','intelligence']},spellcasting:{ability:'intelligence',slots:true,type:'third'}},barbarian:{hd:'d12',proficiencies:{armor:'Light armor, medium armor, shields',weapons:'Simple weapons, martial weapons',tools:'None',savingThrows:['strength','constitution']}},bard:{hd:'d8',proficiencies:{armor:'Light armor',weapons:'Simple weapons, hand crossbows, longswords, rapiers, shortswords',tools:'Three musical instruments of your choice',savingThrows:['dexterity','charisma']},spellcasting:{ability:'charisma',cantrips:true,slots:true,type:'full'}},cleric:{hd:'d8',proficiencies:{armor:'Light armor, medium armor, shields',weapons:'Simple weapons',tools:'None',savingThrows:['wisdom','charisma']},spellcasting:{ability:'wisdom',cantrips:true,prepared:true,slots:true,type:'full'}},druid:{hd:'d8',proficiencies:{armor:'Light armor, medium armor, shields (druids will not wear armor or use shields made of metal)',weapons:'Clubs, daggers, darts, javelins, maces, quarterstaffs, scimitars, sickles, slings, spears',tools:'Herbalism kit',savingThrows:['intelligence','wisdom']},spellcasting:{ability:'wisdom',cantrips:true,prepared:true,slots:true,type:'full'}},fighter:{hd:'d10',proficiencies:{armor:'All armor, shields',weapons:'Simple weapons, martial weapons',tools:'None',savingThrows:['strength','constitution']}},monk:{hd:'d8',proficiencies:{armor:'None',weapons:'Simple weapons, shortswords',tools:'Choose one type of artisan\'s tools or one musical instrument',savingThrows:['strength','dexterity']}},paladin:{hd:'d10',proficiencies:{armor:'All armor, shields',weapons:'Simple weapons, martial weapons',tools:'None',savingThrows:['wisdom','charisma']},spellcasting:{ability:'charisma',prepared:true,slots:true,type:'half'}},psion:{hd:'d6',proficiencies:{armor:'None',weapons:'Daggers, darts, slings, quarterstaffs, light crossbows',tools:'None',savingThrows:['intelligence','wisdom']},spellcasting:{ability:'intelligence',cantrips:true,points:true,type:'full-psionics'}},ranger:{hd:'d10',proficiencies:{armor:'Light armor, medium armor, shields',weapons:'Simple weapons, martial weapons',tools:'None',savingThrows:['strength','dexterity']},spellcasting:{ability:'wisdom',slots:true,type:'half'}},rangerua:{hd:'d10',proficiencies:{armor:'Light armor, medium armor, shields',weapons:'Simple weapons, martial weapons',tools:'None',savingThrows:['strength','dexterity']},spellcasting:{ability:'wisdom',slots:true,type:'half'}},rogue:{hd:'d8',proficiencies:{armor:'Light armor',weapons:'Simple weapons, hand crossbows, longswords, rapiers, shortswords',tools:'Thieves\' tools',savingThrows:['dexterity','intelligence']}},sorcerer:{hd:'d6',proficiencies:{armor:'None',weapons:'Daggers, darts, slings, quarterstaffs, light crossbows',tools:'None',savingThrows:['constitution','charisma']},spellcasting:{ability:'charisma',cantrips:true,slots:true,type:'full'}},soulknife:{hd:'d10',proficiencies:{armor:'Light armor, medium armor, shields',weapons:'None',tools:'None',savingThrows:['intelligence','wisdom']},spellcasting:{ability:'intelligence',cantrips:true,points:true,type:'half-psionics'}},summoner:{hd:'d6',proficiencies:{armor:'Light armor',weapons:'Simple weapons',tools:'None',savingThrows:['intelligence','wisdom']},spellcasting:{ability:'charisma',cantrips:true,slots:true,type:'warlock'}},warlock:{hd:'d8',proficiencies:{armor:'Light armor',weapons:'Simple weapons',tools:'None',savingThrows:['wisdom','charisma']},spellcasting:{ability:'charisma',cantrips:true,type:'warlock'}},wizard:{hd:'d6',proficiencies:{armor:'None',weapons:'Daggers, darts, slings, quarterstaffs, light crossbows',tools:'None',savingThrows:['intelligence','wisdom']},spellcasting:{ability:'intelligence',cantrips:true,prepared:true,slots:true,type:'full'}}};var CLASSES=Object.keys(CLASS_DETAILS);var CUSTOM_SAVING_THROWS=['fortitude','reflex','will'];var FIELDS={abilityCheckModifier:['ability_check_modifier','ability_check_modifier_dice'],abilityScores:ABILITIES.concat(ABILITIES.map(function(ability){return ability+'_score_modifier';})).concat(['ability_score_modifier']),d20:['shaped_d20'],attackModifier:['attack_modifier','attack_modifier_dice'],attacksVs:['attacks_vs_target_ac','attacks_vs_target_name'],automaticDamage:['automatically_roll_damage_for_attacks','automatically_roll_damage_for_saving_throws'],damageModifier:['damage_modifier','damage_modifier_dice'],pb:['level','challenge','proficiency_dice'],savingThrow:['base_dc'],spellDCModifier:['spell_dc_modifier']};FIELDS.weaponAttackModifier=FIELDS.attackModifier.concat(FIELDS.attackModifier.map(function(field){return'weapon_'+field;}));FIELDS.weaponDamageModifier=FIELDS.damageModifier.concat(FIELDS.damageModifier.map(function(field){return'weapon_'+field;}));FIELDS.meleeWeaponAttackModifier=FIELDS.attackModifier.concat(FIELDS.attackModifier.map(function(field){return'melee_weapon_'+field;}));FIELDS.meleeWeaponDamageModifier=FIELDS.damageModifier.concat(FIELDS.damageModifier.map(function(field){return'melee_weapon_'+field;}));FIELDS.rangedWeaponAttackModifier=FIELDS.attackModifier.concat(FIELDS.attackModifier.map(function(field){return'ranged_weapon_'+field;}));FIELDS.rangedWeaponDamageModifier=FIELDS.damageModifier.concat(FIELDS.damageModifier.map(function(field){return'ranged_weapon_'+field;}));FIELDS.spellAttackModifier=FIELDS.attackModifier.concat(FIELDS.attackModifier.map(function(field){return'spell_'+field;}));FIELDS.spellDamageModifier=FIELDS.damageModifier.concat(FIELDS.damageModifier.map(function(field){return'spell_'+field;}));var HEAL_QUERY='?{Heal Bonus Amount|}';var HIT_DIE=[20,12,10,8,6,4,2,0];var REGEX={singleNumber:/(\d+)?/,openParenthesis:/\s?\(?/,diceAndDie:/(?:(\d+)(d\d+))?/,plusMinusBonus:/\s?((?:\+|-)\s?\d+?)?\s?/};var REPEATING_FIELDS={ammo:['ammo_field_name','ammo_per_use'],attack:['attack_toggle','attack_string','attack_type','proficiency','attack_ability','attack_bonus','to_hit','reach','range','attack_target','crit_range'],content:['content_toggle','content'],cost:['cost'],damage:['damage_toggle','damage_formula','damage_string','damage_average','damage_dice','damage_die','damage_dice_modifier','damage_ability','damage_bonus','damage_crit','damage_type','higher_level_dice'],default:['name','type','roll_formula','toggle_details','parsed'],extras:['emote','freetext','freeform'],heal:['heal_toggle','heal_dice','heal_die','heal_dice_modifier','heal_ability','heal_bonus','heal_query_toggle','heal_higher_level_dice','higher_level_heal'],modifiersAndProperties:['modifiers','properties'],parse:['damage_from_srd','second_damage_from_srd','damage_type_from_srd','heal_from_srd'],recharge:['recharge'],repeat:['repeat_toggle'],savingThrow:['saving_throw_toggle','saving_throw_ability','saving_throw_bonus','saving_throw_dc','saving_throw_vs_ability','saving_throw_success'],uses:['uses','uses_max','per_use'],weight:['weight','weight_per_use','uses','weight_total','weight_system']};REPEATING_FIELDS.secondDamage=REPEATING_FIELDS.damage.map(function(field){return'second_'+field;}).concat(['second_damage_condition']);REPEATING_FIELDS.attackDamage=REPEATING_FIELDS.damage.map(function(field){return'attack_'+field;});REPEATING_FIELDS.attackSecondDamage=REPEATING_FIELDS.secondDamage.map(function(field){return'attack_'+field;});REPEATING_FIELDS.savingThrowDamage=REPEATING_FIELDS.damage.map(function(field){return'saving_throw_'+field;});REPEATING_FIELDS.savingThrowSecondDamage=REPEATING_FIELDS.secondDamage.map(function(field){return'saving_throw_'+field;});REPEATING_FIELDS.otherDamage=REPEATING_FIELDS.damage.map(function(field){return'other_'+field;});REPEATING_FIELDS.otherSecondDamage=REPEATING_FIELDS.secondDamage.map(function(field){return'other_'+field;});var SAVING_THROWS=ABILITIES.concat(['death']);var SENSES=['blindsight','darkvision','tremorsense','truesight'];var SKILLS={ACROBATICS:'dexterity',ANIMALHANDLING:'wisdom',ARCANA:'intelligence',ATHLETICS:'strength',DECEPTION:'charisma',HISTORY:'intelligence',INSIGHT:'wisdom',INTIMIDATION:'charisma',INVESTIGATION:'intelligence',MEDICINE:'wisdom',NATURE:'intelligence',PERCEPTION:'wisdom',PERFORMANCE:'charisma',PERSUASION:'charisma',RELIGION:'intelligence',SLEIGHTOFHAND:'dexterity',STEALTH:'dexterity',SURVIVAL:'wisdom'};var SKILLS_CUSTOM={ACROBATICS:'dexterity',ARCANA:'intelligence',ATHLETICS:'strength',BRAWN:'strength',FINESSE:'dexterity',INSIGHT:'wisdom',MANIPULATION:'charisma',MEDICINE:'wisdom',NATURE:'wisdom',PERCEPTION:'wisdom',PERSUASION:'charisma',RELIGION:'intelligence',SOCIETY:'intelligence',STEALTH:'dexterity'};var SPEEDS=['speed','speed_burrow','speed_climb','speed_fly','speed_swim'];var SPELL_LEVELS=[0,1,2,3,4,5,6,7,8,9];exports.ABILITIES=ABILITIES;exports.ACTION_TYPES=ACTION_TYPES;exports.CLASS_DETAILS=CLASS_DETAILS;exports.CLASSES=CLASSES;exports.CUSTOM_SAVING_THROWS=CUSTOM_SAVING_THROWS;exports.FIELDS=FIELDS;exports.HEAL_QUERY=HEAL_QUERY;exports.HIT_DIE=HIT_DIE;exports.REGEX=REGEX;exports.REPEATING_FIELDS=REPEATING_FIELDS;exports.SAVING_THROWS=SAVING_THROWS;exports.SENSES=SENSES;exports.SKILLS=SKILLS;exports.SKILLS_CUSTOM=SKILLS_CUSTOM;exports.SPEEDS=SPEEDS;exports.SPELL_LEVELS=SPELL_LEVELS;
@@ -123,7 +123,7 @@
'use strict';Object.defineProperty(exports,"__esModule",{value:true});exports.Spells=undefined;var _createClass=function(){function defineProperties(target,props){for(var i=0;i=3){levels[1]=4;}else if(casterLevel===2){levels[1]=3;}else if(casterLevel===1){levels[1]=2;}if(casterLevel>=4){levels[2]=3;}else if(casterLevel===3){levels[2]=2;}if(casterLevel>=6){levels[3]=3;}else if(casterLevel===5){levels[3]=2;}if(casterLevel>=9){levels[4]=3;}else if(casterLevel===8){levels[4]=2;}else if(casterLevel===7){levels[4]=1;}if(casterLevel>=18){levels[5]=3;}else if(casterLevel>=10){levels[5]=2;}else if(casterLevel===9){levels[5]=1;}if(casterLevel>=19){levels[6]=2;}else if(casterLevel>=11){levels[6]=1;}if(casterLevel>=20){levels[7]=2;}else if(casterLevel>=13){levels[7]=1;}if(casterLevel>=15){levels[8]=1;}if(casterLevel>=17){levels[9]=1;}}if(casterType==='half'){if(casterLevel>=5){levels[1]=4;}else if(casterLevel>=3){levels[1]=3;}else if(casterLevel===2){levels[1]=2;}if(casterLevel>=7){levels[2]=3;}else if(casterLevel>=5){levels[2]=2;}if(casterLevel>=11){levels[3]=3;}else if(casterLevel>=9){levels[3]=2;}if(casterLevel>=17){levels[4]=3;}else if(casterLevel>=15){levels[4]=2;}else if(casterLevel>=13){levels[4]=1;}if(casterLevel>=19){levels[5]=2;}else if(casterLevel>=17){levels[5]=1;}}if(casterType==='third'){if(casterLevel>=7){levels[1]=4;}else if(casterLevel>=4){levels[1]=3;}else if(casterLevel===3){levels[1]=2;}if(casterLevel>=10){levels[2]=3;}else if(casterLevel>=7){levels[2]=2;}if(casterLevel>=16){levels[3]=3;}else if(casterLevel>=13){levels[3]=2;}if(casterLevel>=19){levels[4]=1;}}Object.keys(levels).forEach(function(level){if(levels[level]>0||(0,_utilities.exists)(data['spell_slots_l'+level+'_calc'])){data['spell_slots_l'+level+'_calc']=levels[level];}else if((0,_utilities.exists)(data['spell_slots_l'+level+'_calc'])){data['spell_slots_l'+level+'_calc']='';}var spellSlotMax=levels[level]+(0,_utilities.getIntValue)(data['spell_slots_l'+level+'_bonus']);if(spellSlotMax>0){data['spell_slots_l'+level+'_max']=spellSlotMax;if((0,_utilities.isUndefinedOrEmpty)(data['spell_slots_l'+level])){data['spell_slots_l'+level]=spellSlotMax;}data['spell_level_filter_'+level]=1;}else{if((0,_utilities.exists)(data['spell_slots_l'+level])){data['spell_slots_l'+level]='';}if((0,_utilities.exists)(data['spell_slots_l'+level+'_max'])){data['spell_slots_l'+level+'_max']=0;}if((0,_utilities.exists)(data['spell_level_filter_'+level])){data['spell_level_filter_'+level]=0;}}});},callback:function callback(){_this3.generateHigherLevelQueries();}});}},{key:'updateWarlockSlots',value:function updateWarlockSlots(){server.getSetItems('spells.updateWarlockSlots',{collectionArray:['warlock_spell_slots','warlock_spell_slots_calc','warlock_spell_slots_bonus','warlock_spell_slots_max'],process:function process(data){var warlockSlots=(0,_utilities.getIntValue)(data.warlock_spell_slots_calc)+(0,_utilities.getIntValue)(data.warlock_spell_slots_bonus);data.warlock_spell_slots=warlockSlots;data.warlock_spell_slots_max=warlockSlots;}});}},{key:'updateChatMacro',value:function updateChatMacro(levelsToUpdate){if(!levelsToUpdate){levelsToUpdate=_constants.SPELL_LEVELS;}var chatMacro={};levelsToUpdate.forEach(function(spellLevel){chatMacro[spellLevel]=[];});server.getSetItems('spells.updateChatMacro',{collectionArray:levelsToUpdate.map(function(level){return'spells_level_'+level+'_macro_var';}),repeatingSections:levelsToUpdate.map(function(spellLevel){return{name:'repeating_spell'+spellLevel,collectionArrayAddItems:['name','is_prepared'].concat(_constants.REPEATING_FIELDS.uses)};}),process:function process(data,repStrings){repStrings.forEach(function(repString){if((0,_utilities.isUndefinedOrEmpty)(data[repString+'_name'])){removeRepeatingRow(repString);}else{var level=(0,_utilities.getLevelOfRepeatingString)(repString);var classes=['spell-wrapper'];if(data[repString+'_is_prepared']==='Yes'){classes.push('prepared');}classes=classes.map(function(className){return'sheet-'+className;}).join(' ');var action={name:data[repString+'_name']};actionComponents.updateUsesForChatMacro(data,repString,action);chatMacro[level].push('['+action.name+'](~'+repString+'_spell)');}});levelsToUpdate.forEach(function(level){data['spells_level_'+level+'_macro_var']=chatMacro[level].join(', ');});}});}},{key:'count',value:function count(){server.getSetItems('spells.count',{collectionArray:['spells_known','spells_prepared'],repeatingSections:_constants.SPELL_LEVELS.map(function(spellLevel){return{name:'repeating_spell'+spellLevel,collectionArrayAddItems:['name','is_prepared']};}),process:function process(data,repStrings){data.spells_known=0;data.spells_prepared=0;repStrings.forEach(function(repString){if((0,_utilities.isUndefinedOrEmpty)(data[repString+'_name'])){removeRepeatingRow(repString);}else{var level=(0,_utilities.getLevelOfRepeatingString)(repString);if(level>0){data.spells_known+=1;if((0,_utilities.exists)(data[repString+'_is_prepared'])){data.spells_prepared+=1;}}}});}});}},{key:'generateHigherLevelQueries',value:function generateHigherLevelQueries(){var collectionArray=['automatic_higher_level_queries','warlock_slots_toggle','warlock_spells_max_level'];for(var level=1;level<=8;level+=1){collectionArray.push('cast_as_level_'+level);collectionArray.push('higher_level_query_'+level);}for(var _level=1;_level<=9;_level+=1){collectionArray.push('spell_slots_l'+_level);}server.getSetItems('spells.generateHigherLevelQueries',{collectionArray:collectionArray,process:function process(data){for(var _level2=1;_level2<=8;_level2+=1){var levels=[];var warlockSpellsMaxLevel=(0,_utilities.getIntValue)(data.warlock_spells_max_level);for(var j=_level2;j<=9;j+=1){if(!(0,_utilities.exists)(data.automatic_higher_level_queries)||(0,_utilities.getIntValue)(data['spell_slots_l'+j])||j===warlockSpellsMaxLevel){levels.push(j);}}if(levels&&levels.length>1||levels.length===1&&levels[0]!==_level2&&!(0,_utilities.exists)(data.warlock_slots_toggle)){data['higher_level_query_'+_level2]='?{Spell Level|'+levels.join('|')+'}';}else if(levels&&levels.length===1){data['higher_level_query_'+_level2]=levels[0];}else{data['higher_level_query_'+_level2]='?{Spell Level|'+_level2+'}';}if(levels&&levels.includes(_level2)){data['cast_as_level_'+_level2]=_level2;}else{data['cast_as_level_'+_level2]=data['higher_level_query_'+_level2];}}}});}},{key:'updateHasSpellSlots',value:function updateHasSpellSlots(){server.getSetItems('spells.updateHasSpellSlots',{collectionArray:['spell_slots_toggle','has_spell_slots'],process:function process(data){if((0,_utilities.exists)(data.spell_slots_toggle)){data.has_spell_slots=true;}else{data.has_spell_slots='';}}});}},{key:'updateHasWarlockSlots',value:function updateHasWarlockSlots(){server.getSetItems('spells.updateHasWarlockSlots',{collectionArray:['warlock_slots_toggle','has_warlock_slots'],process:function process(data){if((0,_utilities.exists)(data.warlock_slots_toggle)){data.has_warlock_slots=true;}else{data.has_warlock_slots='';}}});}},{key:'updateHasSpellPoints',value:function updateHasSpellPoints(){server.getSetItems('spells.updateHasSpellPoints',{collectionArray:['spell_points_toggle','has_spell_points'],process:function process(data){if((0,_utilities.exists)(data.spell_points_toggle)){data.has_spell_points=true;}else{data.has_spell_points='';}}});}},{key:'parseSpellcastingAbilityFromTraits',value:function parseSpellcastingAbilityFromTraits(data,repString){var spellcastingAbilityRegex=/spellcasting ability is (\w+)/i;var spellcastingAbilityRegexSecond=/uses (\w+) as (her|his|its) spellcasting ability/i;var spellcastingSearch=spellcastingAbilityRegex.exec(data[repString+'_content']);if(spellcastingSearch&&spellcastingSearch[1]){data.spell_ability=spellcastingSearch[1].toUpperCase();}else{var spellcastingSearchSecond=spellcastingAbilityRegexSecond.exec(data[repString+'_content']);if(spellcastingSearchSecond&&spellcastingSearchSecond[1]){data.spell_ability=spellcastingSearchSecond[1].toUpperCase();}}}},{key:'parseSpellsPerLevel',value:function parseSpellsPerLevel(data,repStrings,spellsToParseObj){var listOfSpells=repStrings.map(function(repString){return data[repString+'_name'].toLowerCase();});Object.keys(spellsToParseObj).forEach(function(level){if(spellsToParseObj[level].bonusSlots){data['spell_slots_l'+level+'_bonus']=spellsToParseObj[level].bonusSlots;}spellsToParseObj[level].spells.split(',').forEach(function(spell){spell=spell.trim();if(listOfSpells&&!listOfSpells.includes(spell)){var repStringNew='repeating_spell'+level+'_'+generateRowID();data[repStringNew+'_name']=spell;data[repStringNew+'_spell_level']=format.ordinalSpellLevel(level);}});});}},{key:'parseSpellcastingFromTraits',value:function parseSpellcastingFromTraits(data,repStrings,traitContent){data.spell_slots_toggle=1;data.spellcasting=1;var cantripsRegex=/Cantrips.*:\s(.*)/gi;var spellcastingRegex=/(\d+)\w+\slevel\s\((\d+)\s?slot(?:s)?\):?\s?(.*)/gi;var spellcastingLevelRegex=/(\d+)(?:st|dn|rd|th)-level spellcaster/i;var spellcastingClassRegex=/following (\w+) spells prepared/i;var spellcastingClassRegexSecond=/following spells prepared from the (\w+) spell list/i;var spellsToParseObj={};var cantripsSearch=cantripsRegex.exec(traitContent);if(cantripsSearch&&cantripsSearch[1]){spellsToParseObj[0]={spells:cantripsSearch[1]};}var match=void 0;while((match=spellcastingRegex.exec(traitContent))!==null){if(match&&match[1]&&match[2]&&match[3]){spellsToParseObj[match[1]]={bonusSlots:match[2],spells:match[3]};}}if((0,_utilities.objIsNotEmpty)(spellsToParseObj)){this.parseSpellsPerLevel(data,repStrings,spellsToParseObj);}var spellcastingLevelSearch=spellcastingLevelRegex.exec(traitContent);if(spellcastingLevelSearch&&spellcastingLevelSearch[1]){data.caster_level=spellcastingLevelSearch[1];data.spellcaster_level=format.ordinalSpellLevel(spellcastingLevelSearch[1]);}var spellcastingClassSearch=spellcastingClassRegex.exec(traitContent);if(spellcastingClassSearch&&spellcastingClassSearch[1]){data.spellcasting_class=spellcastingClassSearch[1].toUpperCase();}else{var spellcastingClassSearchSecond=spellcastingClassRegexSecond.exec(traitContent);if(spellcastingClassSearchSecond&&spellcastingClassSearchSecond[1]){data.spellcasting_class=spellcastingClassSearchSecond[1].toUpperCase();}}}},{key:'parseInnateSpellcastingFromTraits',value:function parseInnateSpellcastingFromTraits(data,repStrings,traitContent){data.innate_spellcasting=1;var innateSpellsRegex=/(?:At will|each):\s(.*)/gi;var innateSpellcastingComponentRegex=/(.*requiring no material components:)/i;var innateSpellcastingComponentRegexSecond=/(.*requiring only verbal components:)/i;var spellsToParseObj={0:{spells:''},1:{spells:''},2:{spells:''},3:{spells:''},4:{spells:''},5:{spells:''},6:{spells:''},7:{spells:''},8:{spells:''},9:{spells:''}};var match=void 0;while((match=innateSpellsRegex.exec(traitContent))!==null){if(match&&match[1]){spellsToParseObj[0].spells+=', '+match[1];}}if((0,_utilities.objIsNotEmpty)(spellsToParseObj)){this.parseSpellsPerLevel(data,repStrings,spellsToParseObj);}var innateSpellcastingComponentSearch=innateSpellcastingComponentRegex.exec(traitContent);if(innateSpellcastingComponentSearch){data.innate_spellcasting_components='INNATE_SPELLCASTING_NO_MATERIAL';if(innateSpellcastingComponentSearch[1]){data.innate_spellcasting_blurb=traitContent.replace(innateSpellcastingComponentSearch[1],'').trim();}}else{var innateSpellcastingComponentSearchSecond=innateSpellcastingComponentRegexSecond.exec(traitContent);if(innateSpellcastingComponentSearchSecond){data.innate_spellcasting_components='INNATE_SPELLCASTING_ONLY_VERBAL';if(innateSpellcastingComponentSearchSecond[1]){data.innate_spellcasting_blurb=traitContent.replace(innateSpellcastingComponentSearchSecond[1],'').trim();}}}}},{key:'parseSpellcasting',value:function parseSpellcasting(type,traitContent){var _this4=this;server.getSetItems('spells.parseSpellcasting',{collectionArray:['level','challenge','spellcasting_class','innate_spellcasting','spellcasting'].concat(_constants.SPELL_LEVELS.map(function(spellLevel){return'spell_slots_l'+spellLevel+'_bonus';})),repeatingSections:_constants.SPELL_LEVELS.map(function(spellLevel){return{name:'repeating_spell'+spellLevel,collectionArrayAddItems:['name','spell_level']};}),process:function process(data,repStrings){if(type==='innate'){_this4.parseInnateSpellcastingFromTraits(data,repStrings,traitContent);}else{_this4.parseSpellcastingFromTraits(data,repStrings,traitContent);}},callback:function callback(){_this4.updateSpellAbility();_this4.updateDCAndAttack();_this4.updateSlots();_this4.updateChatMacro();_this4.updateHasSpellSlots();_this4.updateHasWarlockSlots();_this4.updateHasSpellPoints();}});}},{key:'findSpellcasting',value:function findSpellcasting(repeatingInfo){var _this5=this;var deleteItem=false;server.getSetItems('spells.findSpellcasting',{collectionArray:['is_npc','spell_ability','show_spells'],repeatingSections:[{name:'repeating_trait',collectionArrayAddItems:['name','content'].concat(_constants.REPEATING_FIELDS.attack),repeatingInfo:repeatingInfo}],process:function process(data,repStrings){if((0,_utilities.exists)(data.is_npc)){repStrings.forEach(function(repString){if((0,_utilities.isUndefinedOrEmpty)(data[repString+'_name'])){deleteItem=true;removeRepeatingRow(repString);}else if(data[repString+'_name']&&data[repString+'_name'].includes('Spellcasting')){data.show_spells=1;_this5.parseSpellcastingAbilityFromTraits(data,repString);if(data[repString+'_name'].includes('Innate')){_this5.parseSpellcasting('innate',data[repString+'_content']);deleteItem=true;removeRepeatingRow(repString);}else{_this5.parseSpellcasting('normal',data[repString+'_content']);if(!data[repString+'_name'].includes('Shared')){deleteItem=true;removeRepeatingRow(repString);}}}});}},callback:function callback(){if(!deleteItem){actions.update(['trait'],repeatingInfo);}}});}},{key:'filtersToggleAll',value:function filtersToggleAll(){var _this6=this;server.getSetItems('spells.filtersToggleAll',{collectionArray:['spell_level_filter_all'].concat(_constants.SPELL_LEVELS.map(function(spellLevel){return'spell_level_filter_'+spellLevel;})),process:function process(data){var onOrOff=0;if((0,_utilities.exists)(data.spell_level_filter_all)){onOrOff=1;}_constants.SPELL_LEVELS.forEach(function(spellLevel){data['spell_level_filter_'+spellLevel]=onOrOff;});},callback:function callback(){_this6.filtersMacroOutput();}});}},{key:'filtersMacroOutput',value:function filtersMacroOutput(){server.getSetItems('spells.filtersToggleAll',{collectionArray:['spells_filter_var'].concat(_constants.SPELL_LEVELS.map(function(spellLevel){return'spell_level_filter_'+spellLevel;})),process:function process(data){data.spells_filter_var='';_constants.SPELL_LEVELS.forEach(function(spellLevel){if((0,_utilities.exists)(data['spell_level_filter_'+spellLevel])){data.spells_filter_var+=' {{spells_level_'+spellLevel+'_show=1}}';}});}});}},{key:'setup',value:function setup(){var _this7=this;var _loop=function _loop(level){on('change:repeating_spell'+level,function(eventInfo){var repeatingInfo=(0,_utilities.getRepeatingInfo)('repeating_spell'+level,eventInfo);if(repeatingInfo&&repeatingInfo.field==='spell_level'){_this7.changeLevel(level,repeatingInfo);}else if(repeatingInfo&&repeatingInfo.field!=='toggle_details'){_this7.update(level,repeatingInfo);_this7.updateChatMacro([level]);_this7.count();}});on('change:_reporder_repeating_spell'+level+' remove:repeating_spell'+level,function(){_this7.updateChatMacro([level]);_this7.count();});};for(var level=0;level<=9;level+=1){_loop(level);}on('change:distance_system',function(){_this7.update();});on('change:spell_slots_toggle change:spell_points_toggle',function(){_this7.updateChatMacro();});on('change:spell_ability',function(){_this7.updateSpellAbility();});on('change:spell_slots_l1_bonus change:spell_slots_l2_bonus change:spell_slots_l3_bonus change:spell_slots_l4_bonus change:spell_slots_l5_bonus change:spell_slots_l6_bonus change:spell_slots_l7_bonus change:spell_slots_l8_bonus change:spell_slots_l9_bonus',function(){_this7.updateSlots();});on('change:warlock_spell_slots_calc change:warlock_spell_slots_bonus',function(){_this7.updateWarlockSlots();});on('change:spell_slots_toggle',function(){_this7.updateHasSpellSlots();});on('change:warlock_slots_toggle',function(){_this7.updateHasWarlockSlots();});on('change:spell_points_toggle',function(){_this7.updateHasSpellPoints();});on('change:automatic_higher_level_queries change:warlock_spell_slots change:warlock_spells_max_level change:spell_slots_l1 change:spell_slots_l2 change:spell_slots_l3 change:spell_slots_l4 change:spell_slots_l5 change:spell_slots_l6 change:spell_slots_l7 change:spell_slots_l8 change:spell_slots_l9',function(){_this7.generateHigherLevelQueries();});on('change:spell_ability change:base_dc',function(){_this7.updateDCAndAttack();});on('change:spell_level_filter_all',function(){_this7.filtersToggleAll();});var filters=_constants.SPELL_LEVELS.map(function(spellLevel){return'spell_level_filter_'+spellLevel;});on(filters.map(function(field){return'change:'+field;}).join(' '),function(){_this7.filtersMacroOutput();});on('change:repeating_trait:content',function(eventInfo){var repeatingInfo=(0,_utilities.getRepeatingInfo)('repeating_trait',eventInfo);_this7.findSpellcasting(repeatingInfo);});}}]);return Spells;}();
},{"../abilities/AbilitiesUtil":2,"../actionComponents/ActionComponents":4,"../actionComponents/Attack":5,"../actionComponents/Heal":7,"../actionComponents/SavingThrow":8,"../actions/Actions":9,"../scripts/Distance":28,"../scripts/Format":29,"../scripts/Server":33,"../scripts/constants":35,"../scripts/utilities":37}],42:[function(require,module,exports){
-'use strict';Object.defineProperty(exports,"__esModule",{value:true});var currentVersion='15.4.0';exports.currentVersion=currentVersion;
+'use strict';Object.defineProperty(exports,"__esModule",{value:true});var currentVersion='15.5.0';exports.currentVersion=currentVersion;
},{}]},{},[36]);
\ No newline at end of file
diff --git a/5eShaped/changelog.md b/5eShaped/changelog.md
index 9362685acd..29a7a0a3ac 100644
--- a/5eShaped/changelog.md
+++ b/5eShaped/changelog.md
@@ -11,6 +11,16 @@ Bugs fall into the patch category.
The sheet will always upgrade itself unless I specify otherwise, though some things like roll template fields changing will require users who have added custom macros to fix.
+## 15.5.0
+
+### Features
+
+* [#578: Provide skill totals](https://bitbucket.org/mlenser/5eshaped/issues/578/provide-skill-totals) will now make the total of each skill available for other resources like scripts. The attribute will be named as the skill is, so `Perception`, `Athletics`, etc. It will be the total modifier (without any + or - sign).
+
+### Bug Fixes
+
+* [#579: Multiple erroring classes are added and cannot be deleted](https://bitbucket.org/mlenser/5eshaped/issues/579/multiple-erroring-classes-are-added-and). It should automatically populate spellcasting now as well. I remember reading something about a change to repeating sections from roll20. Perhaps that was the cause of this as this area hasn't been touched in a while - hard to say.
+
## 15.4.0
### Features