Skip to content
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

Add preDelete callback and add the grantOnDelete option to control when the granted item is created to GrantItemRuleElement #18275

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

In3luki
Copy link
Collaborator

@In3luki In3luki commented Feb 14, 2025

This adds a new option for GrantItemRuleElements called grantOnDelete that controls whether the granted item should be created when the parent item is deleted instead.

Example rule element for Effect: Rage that creates the Effect: Rage Temporary Hit Points Immunity when the rage effect expires or is deleted:

{
  "key": "GrantItem",
  "uuid": "Compendium.pf2e.feat-effects.Item.MaepXeSHiMoWDm7u",
  "allowDuplicate": false,
  "grantOnDelete": true
}

@In3luki In3luki force-pushed the grant-item-delete-expire branch from 7712f97 to 05bf5b4 Compare February 15, 2025 10:29
@In3luki In3luki changed the title Add preDelete callback and implement onExpire callback for GrantItemRuleElement and add the trigger option to control granted item creation Add preDelete callback and add the grantOnDelete option to control when the granted item is created to GrantItemRuleElement Feb 15, 2025
@In3luki
Copy link
Collaborator Author

In3luki commented Feb 15, 2025

I've removed the onExpire callback as the derived nature of effect expiry makes it difficult to track if the item should be created.
With the setting to automatically remove expired effects it should still work for the use case.

@In3luki In3luki force-pushed the grant-item-delete-expire branch from 05bf5b4 to 4db9e15 Compare February 15, 2025 12:18
@In3luki In3luki force-pushed the grant-item-delete-expire branch from 4db9e15 to bb6d55c Compare February 16, 2025 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant