Targeting is not mandatory to roll for attacks#47
Merged
mcglincy merged 1 commit intofvtt-fria-ligan:mainfrom Apr 30, 2025
Merged
Conversation
coderunner
commented
Mar 28, 2025
|
|
||
| DIS.flagScope = "deathinspace"; // must match system namw | ||
| DIS.flags = { | ||
| DEFENDER_DR: "defenderDR", |
Contributor
Author
There was a problem hiding this comment.
After the clean up, the flag is not used anymore.
coderunner
commented
Mar 28, 2025
|
|
||
| //Checks if target is selected, if not throws a message | ||
| if(target == null || target == undefined){ | ||
| ui.notifications.error("Please select a target.") |
Contributor
Author
There was a problem hiding this comment.
Removed the error is no target is selected.
coderunner
commented
Mar 28, 2025
| //If target is selected, use target defense rating | ||
| let targetActorId = target.document.actorId; | ||
| let targetActor = game.actors.get(targetActorId); | ||
| defenderDR = targetActor.system.defenseRating; |
Contributor
Author
There was a problem hiding this comment.
If a target is selected, use its DR.
Collaborator
|
Thanks! Will merge, do some testing, then work on a new release. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@mcglincy @MulliganStu
Made a small change to the attack roll dialog regarding the defender's DR.
The last code change made targeting mandatory to be able to roll for attack with the dialog (otherwise a notice would come up and prevent the roll). While I understand this could be good since the defender's DR will always be accurate, it confuses players and slows the game down slightly during combat.
So I made a slight change that if no target is selected, the default DR of 12 applies. If a target is selected, the target'S DR is used so this should cover both use cases (the tables that use targeting and those who don't).
While doing so, I noticed that the
CONFIG.DIS.flags.DEFENDER_DRflag was set in the_onAttackmethod that is called after thegetDatamethod were it is set. Since the modification by @MulliganStu get the target DR correctly, I cleaned the flag.Also changed
compatibility.verifiedto12.331.