frzyc / genshin-optimizer

An Artifact optimizer for Genshin Impact.
https://frzyc.github.io/genshin-optimizer/
MIT License
749 stars 218 forks source link

Simplify non-stacking mechanism #2229

Closed lantua closed 2 weeks ago

lantua commented 3 weeks ago

Describe your changes

This PR reduces the previous non-stacking buff mechanism, replacing it with a more (sheet) ergonomic design.

Previously:

const { <buffName> } = allStacks(src)

// Sheets
<buffName>.add(buffCondition),
teamBuff.<target>.add(<buffName>.apply(<buff value>))

Now:

// Sheets
teamBuff.<target>.addOnce(<buff value>, <optional accumulator>, <optional stack name>)

Issue or discord link

https://discord.com/channels/785153694478893126/1189329506842984570/1249871693384650763

Testing/validation

Updated non-stacking buffs in gi-formula

Checklist before requesting a review (leave this PR as draft if any part of this list is not done.)

nx-cloud[bot] commented 3 weeks ago

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 88a57f65ad3225ae9c71daf3c03ab71f41c16d89. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 4 targets - [`nx run-many --target=eslint:lint --fix=false --max-warnings=0`](https://cloud.nx.app/runs/9IVw4zmnS6?utm_source=pull-request&utm_medium=comment) - [`nx run-many -t gen-file`](https://cloud.nx.app/runs/AvfqJkAmLx?utm_source=pull-request&utm_medium=comment) - [`nx run-many --target=test`](https://cloud.nx.app/runs/9CltAmnXgF?utm_source=pull-request&utm_medium=comment) - [`nx run-many --target=typecheck`](https://cloud.nx.app/runs/jz8nzkA8As?utm_source=pull-request&utm_medium=comment)

Sent with 💌 from NxCloud.