DFreds / dfreds-convenient-effects

A FoundryVTT module that adds easy to use toggleable active effects for any system.
MIT License
47 stars 39 forks source link

Effects for damage #32

Closed MSAbaddon closed 3 years ago

MSAbaddon commented 3 years ago

It would be great to have one time effects that increase the damage of the subsequent roll for:

Here two examples how I currently do it using separate features within the player's item sheets.

Special expiry is always set to DamageDealt: image

Sneak Attack: image

Hunter's Mark (it just adds damage, the player has to check for himself if he targets the correct target) image

Tempest Divine Strike image

thatlonelybugbear commented 3 years ago

Just read through DFreds answer on the other issue you commented before opening this one.

If you are willing to, or already use Midi-qol and DAE there is a way to automate all these extra damage options that you mention already.

There isn't an easy straightforward add an active effect solution, but needs to add some extra damage flags to link attacker and target (for Hunter's mark).

I can walk you through it if you want.

DFreds commented 3 years ago

@thatlonelybugbear Feel free to put the answer in here for future reference

thatlonelybugbear commented 3 years ago

So for Sneak Attack and Hunter's Mark, I use the premade items that tposney has included in the Midi-QOL sample items compendium. They work as intended and also can, with a small macro change to update the actor to make sure that the timing (once per turn for Sneak Attack for instance) is 100% respected even if the Token moves or casts a spell in the same round (edge cases, but the Midi flag that these items set is not passed to the actor to be stored, so they get deleted with each such update to the token).

For Tempest Divine Strike (works similarly for all Cleric (8th level if not mistaken) features like that or Blessed Strikes optional ones) there are 2 ways.

The long and convoluted way... that will create a damage card in one line with both damage and extra damage

One more prerequisite for this to actually work is to use the Next Up's module Auto Control Next Token: ALL

This is an example for Blessed Strikes but you just need to change the damage types and attack types for the rest. image

Step 1: Create the proper feature on the actor, giving it a unique name, in my example: Blessed Strikes Thodadin

image

Note: Just for weapon attacks. To include the cantrips for Blessed Strikes you need to go the other way. I just have added an extra 1d8 [radiant] damage to the Firebolt for example and use that when going this route...

Step 2: Create a Blessed Strikes Thoradin script macro. Either drag and drop the feature you created in Step 1 on the macros bar or create a new macro with Type: Script and input game.dnd5e.rollItemMacro("Blessed Strikes Thoradin");

Step 3: Create manually a passive effect on the token (you could also automate this with a feature on the actor that uses Transfer Effect to Actor on Item Equip, but no reason for me as you end up with 2 features with the same more or less name).

image

The maybe programmatically sexier way

is to make use of the flags.dnd5e.DamageBonusMacro like the ones used by the Sneak Attack and Hunter's Mark ... to be continued (have to go to work :P)!

About the Colossus Slayer

(haven't been using that but still doable) its a pretty straightforward bonus damage macro where you will need to just include a check on the target as to whether it has Full HP or not and then just trigger the extra damage.

let target = canvas.tokens.get(args[0].hitTargets[0].id);

const diceMult = args[0].isCritical ? 2: 1; if (game.combat) { //this part checks that you do only 1 such attack per round. needs some extra love to make sure that is happens only on the character's turn. Will change that in the future to reflect this. let combatTime = game.combat.round;
let lastTime = getProperty(token.data.flags, "midi-qol.ColossusSlayerTime"); if (combatTime === lastTime) { MidiQOL.warn("Colossus Slayer Damage: Already used it this turn"); return {}; } if (combatTime !== lastTime) { setProperty(token.data.flags, "midi-qol.ColossusSlayerTime", combatTime) } } //checking hp max versus hp current value on the target and if they are not different just stop, otherwise go on to return the extra damage let hpmax = target.actor.data.data.attributes.hp.max;
let hpval = target.actor.data.data.attributes.hp.value; if (hpmax === hpval) return {};

return {damageRoll: ${diceMult}d8, flavor: "Colossus Slayer damage"};


This is taken from the original Midi-QOL sample item Sneak Attack (without changes to respect the time even after token updates). So if you attack and then move or cast a spell, the `midi-qol.ColossusSlayerTime` flag is nuked as all these flags are rewritten on each update of the token.

You can quickly and dirty change the `let lastTime = getProperty(token.data.flags, "midi-qol.ColossusSlayerTime");` to actor instead token but with other problems.

The 100% accurate way is to do an `actor.setFlag`, so change the 

`let lastTime = getProperty(token.data.flags, "midi-qol.ColossusSlayerTime");` to 
` await actor.setFlag('world','ColossusSlayerTime', combatTime);`
and also all the rest of the entries to `let lastTime = getProperty(actor.data.flags, "ColossusSlayerTime");`

This flag is persistent on the actor though and so in order to make sure that at some point this flag is deleted, you can add in the macro the following:
```javascript
if (!game.combat) {
await actor.unsetFlag('world','ColossusSlayerTime');
}

and just have the character roll an attack outside of combat :D

Phew that was a lot. Will revisit in the future...

MSAbaddon commented 3 years ago

Hi and thanks for the detailled reply. Actually, I'm aware of those options, I implemented it in a quite similar way as you described it (I even fully automated spells like Booming Blade)... and my players didn't like it. Such a high grade of automation often results in problems and issues within the game flow (a lot of popups, things that need to be clicked in the right order, problems when actions are interrupted through reactions, problems when all the required modules get updates,...) That's in fact the reason why I want to use this module and not have every spell contain and transfer it's active effect directly (effects like bless, bane, faerie fire, guiding bolt,... - which are included in this module - could also be implemented directly within the spells, but that is what I don't want to do): Give the players and me as a gm a unified UI that allows the manual selection of the effects.

thatlonelybugbear commented 3 years ago

Yeah I think that this will work for you when DFreds finds a solution for the CE to include editable custom effects.

Just for argument's sake (feel free to ignore what is under this line, just my thoughts on the subject as I am drinking a coffee during break and bored to death by reading the same news over and over again :P)

Midi-QOL and DAE pretty much are updated to always play nice with each other. Probably you have seen that nowadays Midi is able to intercept and handle (baby steps) interruption of the normal attack and damage workflow for reactions (spells like shield, or uncanny dodge or even bardic inspiration)

Automation is always an issue (and a developing problem of what feels like too much automation) but as the modules are evolving it is much less fuss than clicking for example, almost every round on a Sneak Attack CE and then attacking for me and my players. Even more for me as a DM that have to do that for many more creatures per round (sneak attacks, blessed strikes, marks they add up :D)

Needs some time to set up properly but now no matter what, as a DM I can't do without. Even clicking on Add Convenient Effects, find what you need and click again on it, it adds up in the end.

The latest addition of Midi being able to recognize automatically spell names that have a corresponding CE is a godsent and I have to say a HUGE thanks to both @DFreds and tposney one more time, that they took the time to work out a good co-operation between the 2 modules!

So how I have set my game up right now, has no pop-ups except the occasional image message, no need to click on anything between turns to keep using character features, a good amount of actions automatically interrupted through reactions, like shield, uncanny dodge, indomitable (midi still needs to find a way to do the same with spells) and not a noticeable higher degree of problems when the required modules get updates (thanks to the efforts again of the aforementioned developers).

Of course if you don't use midi to auto roll and auto target swith spells etc, all the things I wrote go down the drain.

Have a good day!

MSAbaddon commented 3 years ago

Jeah, you of course are right with your arguments and I also tried to use midi, dae,... in that way (in fact I provided tposney with the initial coding for the concentration automation ;-) ). Unfortunately my players don't like this kind of automation, it feels too much of a video game for them. Convenient Effects is the ideal solution for such players, especially as soon as custom effects are possible. If you don't want to implement the suggested effects I posted in this issue, then it's fine for me - I'll just wait until custom effects can be implemented :-)

thatlonelybugbear commented 3 years ago

If you don't want to implement the suggested effects I posted in this issue, then it's fine for me - I'll just wait until custom effects can be implemented :-)

Just to say that I am not the owner of the module, so I have no say on this!

DFreds commented 3 years ago

Great discussion, and thanks for the detailed examples @thatlonelybugbear. I'm not sure yet if I will be adding this kind of effect in the defaults yet, but I am actively working on the creating your own effects feature and believe I have a good solution. Stay tuned!

DFreds commented 3 years ago

Since custom effects are implemented, I think most of what you would want to do can be added per your examples. Let me know if you have any questions.

MSAbaddon commented 3 years ago

Yes, works great now, big thanks