CarlosFdez / pf2e-persistent-damage

Keeps track of persistent damage on actors for PF2E for Foundry VTT
5 stars 4 forks source link

Support for custom flat check and flat check DC modifiers #3

Open apoapostolov opened 3 years ago

apoapostolov commented 3 years ago

Mainly to support Infernal wounds.

In Make Persistent Condition macro, two additional fields to define custom flat check DC and a field to define modifier (positive or negative value, i.e. -1) that modifies the DC for the purpose of the next Process Persistent Damage.

To support this, you'll probably have to add the DC value to the condition, and rewrite its label with the DC modifier for the next roll.

For Infernal wounds, the values would be DC 20, modifier -1.

CarlosFdez commented 3 years ago

Can you link the condition in nethys? I can't quite find it. Would like to see it before I think of an approach. Are there more examples of persistent damage things with a different DC that I can check out as well?

apoapostolov commented 3 years ago

Here you go. https://2e.aonprd.com/Monsters.aspx?ID=110 see Infernal Wound.

CarlosFdez commented 3 years ago

Thanks, I had searched with the plural and I needed to search in the singular.

I don't know how to handle that, the problem is that the most common case is not "editing" an existing persistent damage, its "overriding" it. The form to add them will also likely need a list of all existing persistent damage if editing them via the form is the intent.

I could extend the API to allow custom macros to handle things like Infernal Wounds (given its a rare case) but it definitely needs more consideration.

CarlosFdez commented 3 years ago

Did some asking in the pf2e and research in the codebase. I was thinking of moving all the info into the rules system, but it won't work unfortunately:

1) Rules that don't exist are cleared and replaced with unknown rule element. 2) The rule system is not exported on the window or game object, so it cannot be extended 3) Rule system only supports XdY damage or flat modifiers. The text field allows for any formula. Unless I restrict the roll formula to XdY + Z type formulas, it wouldn't really work.

That said I did some more digging, and I can probably make a new item type and item sheet type so its easy to edit them.

CarlosFdez commented 3 years ago

@apoapostolov I haven't published the change yet on foundry's package manager, but you can update the package and see if it works? Its not the full solution I'm thinking about, but it should tide you over in the meantime.

You can now set the DC when you add the damage, and there's a new tab when you go to edit the effect for updating the damage value and the DC (the name/description are automatically updated).

EDIT: Make sure its v0.3.1, caught a bug last minute and I edited it.

image

image

(Active Effects shows because I'm running on the master branch)

apoapostolov commented 3 years ago

Yes there is manual work involved but at least it is possible now without remaking the effect. As a DM I can keep the effect tab open or minimized and update the value as turns progress.