Skip to content

Commit

Permalink
Merge pull request #40 from napolitanod/1.2.6
Browse files Browse the repository at this point in the history
1.2.6
  • Loading branch information
napolitanod authored Jul 8, 2024
2 parents 06121c3 + 06bff62 commit ad7abb7
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 78 deletions.
4 changes: 2 additions & 2 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"styles/napolitano-scripts.css"
],
"title": "_Napolitano Scripts",
"version": "1.2.4",
"version": "1.2.6",
"url": "https://github.com/napolitanod/napolitano-scripts",
"manifest": "https://raw.githubusercontent.com/napolitanod/napolitano-scripts/master/module.json",
"download": "https://github.com/napolitanod/napolitano-scripts/releases/download/1.2.4/module.zip"
"download": "https://github.com/napolitanod/napolitano-scripts/releases/download/1.2.6/module.zip"
}
3 changes: 3 additions & 0 deletions scripts/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -832,8 +832,11 @@ const LINKDATACATEGORIES = {
}

export const HOOKEDUSEITEMITEMS = {
'Accursed Specter': 'accursedSpecter',
'Divine Smite': 'divineSmite',
'Feather of Diatryma Summoning': 'featherOfDiatrymaSummoning',
'Figurine of Wondrous Power (Golden Lions)': 'figurineOfWonderousPowerLions',
'Figurine of Wondrous Power (Obsidian Steed)': 'figurineOfWonderousPowerObsidianSteed',
'Grease': 'grease',
'Halo of Spores': 'haloOfSpores',
"Maximilian's Earthen Grasp": 'maximiliansEarthenGrasp',
Expand Down
6 changes: 3 additions & 3 deletions scripts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ Hooks.once("midi-qol.midiReady", () => {
}
});

HOOKIDS['midi-qol.preambleComplete'] = Hooks.on('midi-qol.preambleComplete', async function(data){
const hook = "midi-qol.preambleComplete", results = [];
HOOKIDS['midi-qol.prePreambleComplete'] = Hooks.on('midi-qol.prePreambleComplete', async function(data){
const hook = "midi-qol.prePreambleComplete", results = [];
if(data.templateId && game.settings.get("napolitano-scripts", "template-targeting")){
workflow.play('templateTargeting', data, {hook: hook});
}
Expand Down Expand Up @@ -363,7 +363,7 @@ HOOKIDS['renderCombatTracker'] = Hooks.on("renderCombatTracker", (app, html, dat

HOOKIDS['createToken'] = Hooks.on("createToken", async (document, options, userId) => {
if(game.user.isGM){
if(game.settings.get("napolitano-scripts", "hp-roll") && !document.isLinked && !document.hasPlayerOwner && document.actor?.type === "npc"){
if(game.settings.get("napolitano-scripts", "hp-roll") && !document.isLinked && !document.hasPlayerOwner && document.actor?.type === "npc" && !document.flags?.[`${napolitano.FLAGS.NAPOLITANO}`]?.noHPRoll){
const newHPRoll = await document.actor.rollNPCHitPoints({ chatMessage:false })
const newHP = newHPRoll?.total
if (newHP){
Expand Down
60 changes: 12 additions & 48 deletions scripts/macros.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ game.napolitano.macros(args, 'createBonfire', _napOps)
const macro = new macros(ruleset, args[args.length-1], options)
await macro._initialize()
switch(ruleset){
case 'accursedSpecter': await macro._accursedSpecter(); break;
case 'armorOfAgathys': await macro._armorOfAgathys(); break;
case 'auraOfVitality': await macro._auraOfVitality(); break;
case 'bagOfTricksGray': await macro._bagOfTricksGray(); break;
Expand Down Expand Up @@ -60,8 +59,6 @@ game.napolitano.macros(args, 'createBonfire', _napOps)
case 'elementalGem': await macro._elementalGem(); break;
case 'experimentalElixer': await macro._experimentalElixer(); break;
case 'falseLife': await macro._falseLife(); break;
case 'featherOfDiatrymaSummoning': await macro._featherOfDiatrymaSummoning(); break;
case 'figurineOfWonderousPowerObsidianSteed': await macro._figurineOfWonderousPowerObsidianSteed(); break;
case 'findFamiliar': await macro._findFamiliar(); break;
case 'fireShield': await macro._fireShield(); break;
case 'fogCloud': await macro._fogCloud(); break;
Expand Down Expand Up @@ -154,27 +151,6 @@ game.napolitano.macros(args, 'createBonfire', _napOps)
napolitano.log(false, `Macros initialized ${this.ruleset}...`, this);
}

async _accursedSpecter(){ //tested v10
this.summonData.updates = {
actor: {
system:{
attributes: {
hp: {
temp: Math.floor(this.sourceData.warlockLevel/2)
}
},
bonuses: {
msak: {attack: this.sourceData.charismaMod},
mwak: {attack: this.sourceData.charismaMod},
rsak: {attack: this.sourceData.charismaMod},
rwak: {attack: this.sourceData.charismaMod}
}
}
}
}
await this.summon();
}

async _armorOfAgathys(){
if(this.feature.dae==='on') this.generateEffect(this.firstHitTarget)
if(this.feature.dae==='off' && this.sourceData.tempHp) this.effectEndTempHP()
Expand Down Expand Up @@ -423,13 +399,13 @@ game.napolitano.macros(args, 'createBonfire', _napOps)
}}
}
if(choice !== "Flamethrower") {
this.summonData.updates.embedded.Item["Flamethrower"] = warpgate.CONST.DELETE
this.summonData.deletes.item.push("Flamethrower")
}
if(choice !== "Protector") {
this.summonData.updates.embedded.Item["Protector"] = warpgate.CONST.DELETE
this.summonData.deletes.item.push("Protector")
}
if(choice !== "Force Ballista") {
this.summonData.updates.embedded.Item["Force Ballista"] = warpgate.CONST.DELETE
this.summonData.deletes.item.push("Force Ballista")
}
await this.summon();
}
Expand Down Expand Up @@ -724,16 +700,6 @@ game.napolitano.macros(args, 'createBonfire', _napOps)
if(this.feature.dae==='off' && this.sourceData.tempHp) this.effectEndTempHP()
}

async _featherOfDiatrymaSummoning(){
await this.summon();
this.logNote(`Feather of Diatryma Summoning was used`)
}

async _figurineOfWonderousPowerObsidianSteed(){
await this.summon();
this.logNote(`Figurine of Wonderous Power: Obsidian Steed was used and cannot be used for another 5 days.`)
}

async _findFamiliar(){ //tested v10
new Dialog({
title: `Cast Find Familiar`,
Expand Down Expand Up @@ -1458,15 +1424,13 @@ game.napolitano.macros(args, 'createBonfire', _napOps)
};

if(choice !== "slaad") {
this.summonData.updates.embedded.Item["Claws"] = warpgate.CONST.DELETE
this.summonData.updates.embedded.Item["Regeneration"] = warpgate.CONST.DELETE
this.summonData.deletes.item.push("Regeneration").push ("Claws")
}
if(choice !== "beholderkin") {
this.summonData.updates.embedded.Item["Eye Ray"] = warpgate.CONST.DELETE
this.summonData.deletes.item.push("Eye Ray")
}
if(choice !== "starSpawn") {
this.summonData.updates.embedded.Item["Whispering Aura"] = warpgate.CONST.DELETE
this.summonData.updates.embedded.Item["Psychic Slam"] = warpgate.CONST.DELETE
this.summonData.deletes.item.push("Whispering Aura").push ("Psychic Slam")
}
await this.summon()
if(choice === 'starSpawn') await this.addTag('NAP-SOT-5', this.summonedToken)
Expand Down Expand Up @@ -1512,15 +1476,15 @@ game.napolitano.macros(args, 'createBonfire', _napOps)
}}
};
if(choice !== "Fuming") {
this.summonData.updates.embedded.Item["Fuming"] = warpgate.CONST.DELETE
this.summonData.deletes.item.push("Fuming")
}
if(choice !== "Tricksy") {
this.summonData.updates.embedded.Item["Tricksy"] = warpgate.CONST.DELETE
this.summonData.deletes.item.push("Tricksy")
}
if(choice === "Mirthful") {
this.summonData.updates.embedded.Item["Mirthful"] = { "system.save.dc": this.sourceData.spelldc}
} else {
this.summonData.updates.embedded.Item["Mirthful"] = warpgate.CONST.DELETE
this.summonData.deletes.item.push("Mirthful")
}
await this.summon()
}
Expand Down Expand Up @@ -1567,13 +1531,13 @@ game.napolitano.macros(args, 'createBonfire', _napOps)
};

if(shadow !== "Fear") {
this.summonData.updates.embedded.Item["Shadow Stealth"] = warpgate.CONST.DELETE
this.summonData.deletes.item.push("Shadow Stealth")
}
if(shadow !== "Despair") {
this.summonData.updates.embedded.Item["Weight of Sorrow"] = warpgate.CONST.DELETE
this.summonData.deletes.item.push("Weight of Sorrow")
}
if(shadow !== "Fury") {
this.summonData.updates.embedded.Item["Terror Frenzy"] = warpgate.CONST.DELETE
this.summonData.deletes.item.push("Terror Frenzy")
}
await this.summon()
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/napolitano-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class napolitano {
* @param {...any} args - what to log
*/
static log(force, ...args) {
const shouldLog = force || game.modules.get('_dev-mode')?.api?.getPackageDebugValue(this.ID);
const shouldLog = true//force || game.modules.get('_dev-mode')?.api?.getPackageDebugValue(this.ID);

if (shouldLog) {
console.log(this.ID, '|', ...args);
Expand Down
Loading

0 comments on commit ad7abb7

Please sign in to comment.