-
Notifications
You must be signed in to change notification settings - Fork 335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolve Inline Params #13488
Comments
This is already doable, but not in this way, and won't be doable in this way. We can use the ItemAlteration rule element to dynamically replace the description. This, for example, does a lot of the work needed for dragons. {
"itemType": "feat",
"key": "ItemAlteration",
"mode": "override",
"predicate": [
"item:slug:dragon-breath"
],
"property": "description",
"value": [
{
"text": "You breathe in deeply and release the energy stored within you in a powerful exhalation. Your dragon breath is a @Template[type:{actor|flags.pf2e.dragonAncestry.breath.shape}|distance:{actor|flags.pf2e.dragonAncestry.breath.distance}], and deals @Damage[max(2,ceil(@actor.level/2)){actor|flags.pf2e.dragonAncestry.breath.dieSize}[@actor.flags.pf2e.dragonAncestry.breath.damageType]] damage of a type depending on your heritage. Each creature in the area must attempt a @Check[type:{actor|flags.pf2e.dragonAncestry.breath.saveType}|dc:resolve(@actor.system.attributes.classOrSpellDC.value)|basic:true] saving throw against the higher of your class DC or spell DC. You can't use this ability again for 10 minutes; starting at level 3, you instead can't use the ability again for [[/r 1d4 #Recharge Dragon Breath]] rounds."
}
]
} |
This does work if I open the description from the actor's sheet; however, if I use the option to send the action to the chat it sends the original and not the altered description. If I open an issue regarding that, would that be something that can be fixed so it sends the altered description instead. |
It will in the next release #13479 |
Some inline rolls have the ability to parse parameters in such a way where elements of the roll are replaced with a flag set on an actor or something else.
For instance,
@Damage[max(2,ceil(@actor.level/2))d4[@actor.flags.pf2e.dragonAncestry.breath.damageType]]
replaces the@actor.flags.pf2e.dragonAncestry.breath.damageType
with whatever the flag is set to by an ActiveEffectLike rule element.@Check[type:reflex|dc:resolve(@actor.system.attributes.classOrSpellDC.value)|basic:true]
replaces theresolve(@actor.system.attributes.classOrSpellDC.value)
with whatever the actor's class or spell DC is.I am requesting to expand on this and allow any inline parameter have the option to be resolved.
For example
@Template[type:@actor.flags.pf2e.dragonAncestry.breath.shape|distance:@actor.flags.pf2e.dragonAncestry.breath.distance]
would replace both the@actor.flags.pf2e.dragonAncestry.breath.shape
and@actor.flags.pf2e.dragonAncestry.breath.distance
with whatever the flag is set to by an ActiveEffectLike rule element.Another example is something like
@Check[type:@actor.flags.pf2e.dragonAncestry.breath.saveType|dc:resolve(@actor.system.attributes.classOrSpellDC.value)|basic:true]
which would resolve@actor.flags.pf2e.dragonAncestry.breath.saveType
as well as the DC.I tracked down the function in the source code to #parseInlineParams in module/system/text-editor.ts, this is responsible for parsing the inline parameters. But I am not familiar enough with Foundry VTT to implement this myself and submit a pull request. My thought process is to allow both @ and resolve() where @ is just a simple replacement and resolve() is a more complex replacement using formulas and since it's implemented in the function that parses the inline parameters it would expand this to every inline action/roll/etc.
The text was updated successfully, but these errors were encountered: