Stexinator / salvage-union-combat-automation

MIT License
0 stars 0 forks source link

Feature Request: Support for experimental particle beam #5

Open LottVanfield opened 2 weeks ago

LottVanfield commented 2 weeks ago

It would be useful for automation plugin to be able to handle attacks with variable specs derived from dice rolls such as those done by the Experimental Particle Beam Cannon.

This can be partially achieved with damage and explosive by tagging them with double square brackets like [[2d20]] to resolve a dice roll as part of the attack to at least get some rolls in the text block to apply manually, but having native support for variable hot and damage for the automation would be very useful for this as well as future books/homebrew. For other tags like Explosive, just having it resolve a number for the text display for anything in parenthesis would be super useful.

Stexinator commented 2 weeks ago

Can you elaborate? Are these two separate issues?

I dont know what you mean with your tags part. Variable heat/ep/ap is already in the module

LottVanfield commented 2 weeks ago

I apologize for the vague writeup, I was trying to write it while it was still fresh in my mind but it was after a session that had run quite late. Variable is the wrong term, it should have been worded as support for random values, and I had meant "Traits" instead of "Tags". This is likely better defined as a couple separate issues that are related to supporting random values.

Issue 1: If the damage is derived from a die roll every attack, entered in the Systems Damage field as something like "2d20", which is what the Experimental Particle Beam Cannon System has, then the combat automation fails with this error: TypeError: Cannot read properties of undefined (reading 'value') at SalvageUnionCombatAutomationDamage.applyDamageToHp (applyDamage.js:98:37) at SalvageUnionCombatAutomationDamage.applyDamage (applyDamage.js:32:39) at SalvageUnionCombatAutomationDamage.clickDamageButton (applyDamage.js:8:14)

It would be useful if the system could roll/display the random damage in the attack message and then be able to apply it with the Deal Damage buttons.

Issue 2: If a system/module has the Hot Trait that derives from a die roll, such as "Hot (1d20)" from the Experimental Particle Beam Cannon System, then when the attack is rolled the message still display as "Hot (1d20)", however the automation just applies 1 heat to the firing mech. It would be useful if the system could roll, display, and apply this random amount of heat.

Issue 3: Less important as it doesn't really interact with automation as much but if a Trait such as Explosive is entered as "Explosive (1d20)" like the Experimental Particle Beam Cannon System, on the attack message it is still displayed as such, it would be useful if the contents of the parenthesis could be parsed, rolled, and displayed as part of the attack message if a die roll is in that field. This one has a workaround in that I can enter the trait as "Explosive([[1d20]])" and Foundry will embed the dice as part of the attack message.

image