Jagusti / fvtt-wfrp4e-gmtoolkit

Utility module with tweaks, enhancements and macros to help GMs with game management when running Warhammer Fantasy Roleplay (4e) sessions in Foundry Virtual Tabletop.
MIT License
15 stars 9 forks source link

Allow a flag in Test `options` that would disable automatic advantage gain #263

Closed Forien closed 4 months ago

Forien commented 4 months ago

Type of change

Checklist:

Description

Motivation and context

Some Opposed Tests (namely, Group Advantage actions) should not generate advantage when winning them. And while system itself does not handle that in any way, I've added support for that in the new Token Action HUD WFRP4e update, as can be seen here (for example):

https://github.com/Foundry-Workshop/token-action-hud-wfrp4e/blob/1356baa3439c4b6b6f450399d9c288bd86efa2af/dist/modules/GroupAdvantage.js#L76-L84

I went ahead and added a new flag in Tests' options called preventAdvantage with the idea that if the attackerTest has that flag, then no advantage should be generated by that test by other automations.

Summary of changes

Added a check that checks for two things: 1. Is the Group Advantage enabled? 2. Does the `attackerTest` have option `preventAdvantage` set **exactly** to `true`? If both are true, then advantage is not calculated for the Opposed Test. ### How has this been tested?
  1. Use Group Advantage actions like Batter, Trick or Additional Effort from the Token Action HUD WFRP4e v1.2.0
    • should notice that they no longer grant advantage due to "won opposed test", but instead grant advantage based on actions themselves
  2. Perform any Opposed Test outside of actions mentioned above
    • should notice that automated advantage is handled as usual by GM Toolkit

Development / Testing Environment