daft-develop / mob-attack-tool

A module for Foundry VTT that offers a tool for handling mob attacks in the dnd5e system.
GNU General Public License v3.0
6 stars 6 forks source link

[FEATURE] Use of effects, statuses, saving throws, and other attack features #30

Open stalker168 opened 5 days ago

stalker168 commented 5 days ago

Is your feature request related to a problem? Please describe. At this point, performing attacks with and without the module is very different. Attacks performed with the module do not take into account possible saving throws, imposed statuses, resource consumption, resistances, immunities and many other things that happen automatically when performing an attack with MIDI QOL.

Describe the solution you'd like Now, the closest to the desired result I get using the following macro:

const attackName = "Attack Name"

const actors = canvas.tokens.controlled.map(token => token.actor)
new Dialog({
    title: 'Attack mode',
    content: ``,
    buttons: {
      dis: {
        label: 'Disadvantage',
        callback: async () => {await attack("disadvantage")}
      },
      nor: {
        label: 'Normal',
        callback: async () => {await attack();}
      },
      adv: {
        label: 'Advantage',
        callback: async () => {await attack("advantage")}
      }
    },
    default: 'nor',
    close: () => {},
  }).render(true);
async function attack(attackMode = null) {
    for (let i = 0; i < actors.length; i++) {
        const options = {
            targetUuids: Array.from(game.user.targets.map((t) => t.document.uuid)),
            workflowOptions: {
                'fastForwardAttack': true,
                'advantage': attackMode === "advantage",
                'disadvantage': attackMode === "disadvantage",
            }
        }
        await MidiQOL.completeItemUse(actors[i].items.find(n => n.name === attackName), {}, options)
    }
}

But with the macro, it's hard to do multi-attack, attack multiple targets, summarize the attack into a single chat message.

Is this something completely new to the module, or previously available and now removed? I haven't used the module since version 10 and don't remember if it was previously available. I think it was the same before.

Additional context It would be great if this module fully interacted with MIDI QOL, Cauldron of Plentiful Resources, and other popular D&D5e automation modules.

daft-develop commented 1 day ago

Thanks for the suggestion and the macro, it might be a good way to implement some of this going forward or give me some ideas of how I can change the current setup.

I described a little bit of the Midi QOL interaction and current limitations in https://github.com/daft-develop/mob-attack-tool/issues/21#issuecomment-2106382449, #17, and #14. I do mention some of those limitations in the README.md, but they're maybe too far down the page, and could probably be added to the Foundry module description as well. In short the module currently only looks at damage and makes it's own determination on advantage/disadvantage, but I'd love to figure out a clever way to pass all of this off to MidiQOL or fake it close enough to a normal roll message to trigger other module hooks "for free". Worst case I currently already have code branches depending if MiqiQOL is installed or not, so it may be that we can use MiqiQOL even more heavily to fake more of this stuff.

The biggest challenge right now I think is deciding how to squish multiple saves into a single "completeItemUse" call. It may be that I have to generate calls anytime an attack description includes a save so MiqiQOL can roll each check separately.