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

Automate increase and decrease to item repair #15915

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

jesuisfrog
Copy link
Contributor

Added automation for the repair macro.

It will now check the new "repairValue" data point under actor.system.crafting to allow for customization of the amount of HP that can be repaired with the macro. The default is set to 5 as per the base repair action.

Crafter's Eyepiece has been updated with two new rules to add to repairValue and to add a flavor note about the updated repair numbers.

This should close #10958

(Apologies for the two closed PRs, I had some issues with them but it's all resolved now)

@stwlam
Copy link
Collaborator

stwlam commented Sep 2, 2024

This looks good, but would you mind making it crafting.repair an object with a lone value field? Then we won't have regret later if there is other repair-related data we want to track.

@jesuisfrog
Copy link
Contributor Author

@stwlam Made the requested change!

@@ -404,6 +404,7 @@ interface VersatileWeaponOption {
interface CharacterCraftingData {
formulas: CraftingFormulaData[];
entries: Record<string, Partial<CraftingEntryData>>;
repair: { value: 5 };
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be value: number, as this is a type

@@ -461,7 +461,7 @@ class CharacterPF2e<TParent extends TokenDocumentPF2e | null = TokenDocumentPF2e
}

// Indicate that crafting formulas stored directly on the actor are deletable
system.crafting = fu.mergeObject({ formulas: [], entries: {} }, system.crafting ?? {});
system.crafting = fu.mergeObject({ formulas: [], entries: {}, repair: { value: 5 } }, system.crafting ?? {});
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This allows persisted values to override the default of 5, when only rule elements should be able to modify the repair value. You might need to do system.crafting.repair = { value: 5 }; after this line.

@CarlosFdez
Copy link
Collaborator

CarlosFdez commented Jan 5, 2025

Can you foresee other values being inside system.crafting.repair? I'm wondering if we can't replace system.crafting.repair.value with system.crafting.repair.success and system.crafting.repair.criticalSuccess. Because AELikes set the crafting proficiency though, perhaps this can't be done very cleanly without resorting to system.crafting.repair.success.base and system.crafting.repair.success.perLevel. I'm wondering if this might be a thing better attempted once we have proper skill tracking.

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.

Increases and decreases to item repair should be automated
4 participants