Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jun 8, 2024

Conversation

Forien
Copy link
Contributor

@Forien Forien commented Jun 8, 2024

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Translation (updates existing localization strings or adds complete new language file)
  • Release (administrative update for tagged release, eg, changelog, readme, manifest)
  • Maintenance (updates to the repository, dependencies and other non-functional code management)

Checklist:

  • I have run linting on my code to follow the follow the style of this project.
  • I have commented my code, particularly in hard-to-understand areas.
  • My changes generate no new unhandled or unexpected warnings.
  • My change requires an update to the documentation.
  • I can be reached on Discord by my handle: forien

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
  1. Perform any Opposed Test outside of actions mentioned above
  • should notice that automated advantage is handled as usual by GM Toolkit

Development / Testing Environment

  • Foundry VTT: 11.315
  • WFRP4e System: 7.2.0
  • GM Toolkit: current forked branch, including 121bc22

@Jagusti Jagusti merged commit 937fc94 into Jagusti:dev Jun 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants