pf2e icon indicating copy to clipboard operation
pf2e copied to clipboard

Allow duration coercion to be optional

Open KSops opened this issue 2 years ago • 2 comments

Problem

Right now auras force the applied effect duration to be unlimited and have no expiry style set. This means that even if you explicitly link to an effect that has a duration of N rounds, it will not be respected. I suppose that the change was made because it was assumed auras should strictly be for aura-like effects. However, this strictness denies the possibility of using the aura system to apply effects to other tokens in a radius.

Changes

Add a noDurationCoercion boolean field to the aura effect data type such that if it primitively evaluates to true, the coercion code is disabled and the original duration data from the effect (specified by uuid) is left alone. e.g.

{
    "key": "Aura",
    "radius": 30,
    "effects": [{
        "affects": "allies",
        "events": ["enter"],
        "uuid": "Item.9Q68yHv607Y1EmSy",
        "removeOnExit": false,
        "noDurationCoercion": true
    }]
}

Benefits

  • Existing rules are not changed. Default when unspecified is still the original behaviour before this change
  • Allows a Bard to cast Inspire Courage at different round counters easily by flickering the aura on and off (in combination with "removeOnExit": false)

KSops avatar Oct 25 '22 08:10 KSops

I had contemplated accepting an optional override object that would deep-merge into the original item pointed to by the UUID, but this is by far less intrusive.

Of course, I think an even simpler approach is to simply remove the two lines of code that force the duration data in the first place and make it the responsibility of the aura rule to point to some version of an effect that truly has unlimited duration. But I feel like if it was added intentionally, it must have been for a reason, so I think the next best solution is to respect that design choice.

KSops avatar Oct 25 '22 08:10 KSops

This was done as a temporary measure because expiring effects would degenerate into cycles of repeated application. Simply removing the forced indefinite duration with no other changes would reintroduce the issue.

stwlam avatar Oct 25 '22 08:10 stwlam

Sorry. For some reason I didn't pick up that a response/proposal was expected.

Instead of what's proposed in this PR, what if there was an "applyOnce" param on the aura (default false) where, if it is set to true, the effect is only granted once. This should alleviate the concern about re-application of effects. And when this flag is enabled, the duration is not tampered with.

KSops avatar Nov 11 '22 11:11 KSops