Skip to content

Comments

Targeting is not mandatory to roll for attacks#47

Merged
mcglincy merged 1 commit intofvtt-fria-ligan:mainfrom
coderunner:target-not-mandatory-for-attacks
Apr 30, 2025
Merged

Targeting is not mandatory to roll for attacks#47
mcglincy merged 1 commit intofvtt-fria-ligan:mainfrom
coderunner:target-not-mandatory-for-attacks

Conversation

@coderunner
Copy link
Contributor

@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_DR flag was set in the _onAttack method that is called after the getData method were it is set. Since the modification by @MulliganStu get the target DR correctly, I cleaned the flag.

Also changed compatibility.verified to 12.331.


DIS.flagScope = "deathinspace"; // must match system namw
DIS.flags = {
DEFENDER_DR: "defenderDR",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After the clean up, the flag is not used anymore.


//Checks if target is selected, if not throws a message
if(target == null || target == undefined){
ui.notifications.error("Please select a target.")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the error is no target is selected.

//If target is selected, use target defense rating
let targetActorId = target.document.actorId;
let targetActor = game.actors.get(targetActorId);
defenderDR = targetActor.system.defenseRating;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a target is selected, use its DR.

@mcglincy
Copy link
Collaborator

Thanks! Will merge, do some testing, then work on a new release.

@mcglincy mcglincy merged commit 3ddb79e into fvtt-fria-ligan:main Apr 30, 2025
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