Skip to content

Add damage/defense % buff and per-type penetration stats#335

Open
Travja wants to merge 2 commits into
devfrom
split/09-stat-foundation-buffs-penetration
Open

Add damage/defense % buff and per-type penetration stats#335
Travja wants to merge 2 commits into
devfrom
split/09-stat-foundation-buffs-penetration

Conversation

@Travja

@Travja Travja commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

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 via damage_buffs_percent.yml / defense_buffs_percent.yml) and PenetrationStat (per-damage-type penetration, flat or %, configured 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 the two PRs stacked on this one:

  • Combat formula refactor (stacked on this branch)
  • Item generator UX (stacked on this branch)

Generated by Claude Code

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants