Add damage/defense % buff and per-type penetration stats#335
Open
Travja wants to merge 2 commits into
Open
Conversation
New DynamicBuffStat (per-damage-type % damage/defense buffs, config'd via damage_buffs_percent.yml / defense_buffs_percent.yml) and PenetrationStat (per-damage-type penetration, flat or %, config'd via penetration.yml) join the existing stat system: registered in ItemStats, loadable from socket/gem bonus maps via BonusMap, exposed through EntityStats#getDynamicBuff/getPenetration, and queryable via new damagebuff_/defensebuff_/penetration_ PlaceholderAPI placeholders. Also relaxes several existing TypedStat.Type entries from ARMOR/WEAPON to BOTH so they're no longer restricted to one equipment category, and reserves a batch of stat-type placeholders for planned future systems (summons, projectiles, bleed/stun stacks, CC, healing). Note for reviewers: nothing consumes these new stats yet in this change (no combat-formula application, no item-generator rolling) — that lands in follow-up PRs stacked on this one.
Covers the new stat types' pure-logic surface: hook matching (case-insensitive isApplicableTo), ID normalization, and the percent-vs-flat / damage-vs-defense distinctions each type carries. Extends BonusMapTest (which already covers loadDefenses) with the same pattern for loadDamageBuffs/loadDefenseBuffs/loadPenetrations, plus a check that an unresolvable config id is skipped rather than throwing. Note: written against the existing MockBukkit-based test patterns in this repo but not run here — this environment can't resolve the private parent POM (repo.travja.dev) needed to build/test at all. Please run `mvn test` locally/in CI before merging.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Split out of #320 (piece 10/12 — foundation for #331 wait / see below, independent of the other pieces but two later PRs stack on it).
New
DynamicBuffStat(per-damage-type % damage/defense buffs, configured viadamage_buffs_percent.yml/defense_buffs_percent.yml) andPenetrationStat(per-damage-type penetration, flat or %, configured viapenetration.yml) join the existing stat system: registered inItemStats, loadable from socket/gem bonus maps viaBonusMap, exposed throughEntityStats#getDynamicBuff/getPenetration, and queryable via newdamagebuff_/defensebuff_/penetration_PlaceholderAPI placeholders.Also relaxes several existing
TypedStat.Typeentries fromARMOR/WEAPONtoBOTHso they're no longer restricted to one equipment category, and reserves a batch of stat-type placeholders for planned future systems (summons, projectiles, bleed/stun stacks, CC, healing).Note for reviewers: nothing consumes these new stats yet in this change (no combat-formula application, no item-generator rolling) — that lands in the two PRs stacked on this one:
Generated by Claude Code