Commit b61a13c
authored
[Feat] Ability pickup refund, depleted slot interactions, and chargeable ability system (#278)
* Feat: Ability system foundation — typed abilities, slot management, throwDirect API
- Add ABILITY_ID and ABILITY_SLOT PDC keys to KeyRegistry
- Uncomment and wire AbilityItemBuilder/AbilityItemReader (PDC tagging now live)
- Fix AbilitySlotItem: isSatisfied/setEquipped/buildPlaceholder now use ABILITY_SLOT_KEY
- AbilitySkill: replace single useType() with useTypes() Set<AbilityUseType> — STACK,
DURABILITY, and COOLDOWN are now non-exclusive and combinable per ability
- AbilitySlotManager: tracks remainingUses and remainingDurability independently per
slot; deplete fires when any finite resource hits zero
- AbilityStateRepository: stores both remaining_uses and remaining_durability columns;
returns SlotState record; save/saveAll updated to match
- VisualProjectile: add displayScale field (default 1.0f) — determineOrientation() now
respects it, enabling per-throw scale overrides without subclassing
- ThrowAction.throwDirect(): new API that spawns a ThrownItem and releases immediately
without the onReady() windup loop — suitable for instant-release abilities
- KnifeThrowAbility: fires a diamond sword projectile at 0.5 scale via throwDirect;
useTypes() = {STACK, COOLDOWN}, 3 max uses, 10-tick cooldown overlay
* Feat: Skill availability, slot state persistence, and ability casting
- Add SkillAvailability (AVAILABLE/DEPLETED/RELINQUISHED) tracked per player
- Add SkillSlotState record persisting uses, durability, and cooldown expiry
per ability slot so cooldowns survive log-off cycles
- Persist slot states via new SkillStateRepository (player_skill_slot_state table)
- Migrate player_available_skills schema to v2 (adds availability column)
- Refactor AbilitySlotManager to delegate uses/durability tracking to
PlayerSkillContainer instead of local fields
- Implement handleAbilityInput in SwordPlayer — LEFT tap / RIGHT_HOLD cast
with canPerform, persistent cooldown guard, consumeUse, and cooldown write-back
- Remove registerActiveSkillSlot from InputRegistrar (replaced by handleAbilityInput)
- Fix AbilitySlotItem EMPTY/LOCKED restore to clear stale ability items on unequip
- Add TestAlpha/Beta/Gamma no-op abilities with colored chat feedback for testing
- Add skill system README
* Feat: Slot-index ability detection, throw prevention, and unequip fix
- Replace PDC tag lookup in handleAbilityInput with slot-index check via
AbilitySlotManager.getActiveTypeForHeldSlot — more reliable than reading
ITEM_TYPE_KEY from the held item which may be gunpowder or untagged
- Add boolean[] slotEnabled to AbilitySlotManager, synced after initialize,
refresh, and deplete; drives getActiveTypeForHeldSlot
- Implement notHoldingAbilityItem() in SwordPlayer using getActiveTypeForHeldSlot;
wired into canBeginThrow() which gates the Throw Ready input node
- Fix AbilitySlotItem EMPTY/LOCKED restore to clear stale ability items on unequip
* Feat: Knife throw pickup refund, ability re-cast fix, and CharacterMenu replenish button
- KnifeThrowAbility now extends ActivatableAbility (not ThrowableAbility) — throw is click-to-cast with no aim windup
- Tag knife projectile with ABILITY_ID_KEY so pickup can identify it
- InteractiveItemArbiter refunds one use to the original thrower on projectile pickup, regardless of who picks it up
- AbilitySlotManager.addUse() transitions depleted slots back to EQUIPPED when a use is returned
- ThrowAction.throwDirect resets attemptingThrow on completion, fixing ability re-cast lock
- CharacterMenu: dev replenish button (TODO: remove) resets both ability slots to full uses
* Feat: Ability pickup refund, depleted slot interactions, chargeable ability system, and IceSpellAbility
- Dash and grab now pick up ability projectiles when holding an equipped or depleted ability item
- Thrown ability projectile pickup (dash/grab/catch) refunds a use via AbilitySlotManager
- DEPLETED slot state now recognized as an ability slot for all pickup interactions
- handleAbilityInput only consumes LEFT inputs; RIGHT paths flow through the input tree
- Fixed input tree lock-out: ability slot always returns true to prevent tree advancement
- Added AbilityType.CHARGEABLE, ChargeableAbility abstract class, ChargeSession, ChargeAction
- Chargeable abilities hook into RIGHT (charge start) and RIGHT_HOLD (charge release) in the input tree
- IceSpellAbility: BLUE_ICE block, scale 0.25→3.0 over 3s, sine-wave bob, Y-axis rotation, releaseable at 0.5 scale
- addUse() calls updateInventory() to force client sync after projectile refund
- Non-ability items in an equipped slot are relocated gracefully on equip
* Add: Potion effect infinite duration constants, plugin dependency auto-download, and remove stale TODOs
Add PotionEffect.INFINITE_DURATION constant instead of magic number 99999999. Add downloadPlugins block to build.gradle for DisplayEntityUtils, PacketEvents, and ProtocolLib. Remove obsolete TODO about ability casting from different actions.
* Fix: Spotless1 parent 2d1375d commit b61a13c
55 files changed
Lines changed: 3768 additions & 151 deletions
File tree
- src/main/java/btm/sword
- config
- system
- action
- movement
- skill
- container
- history
- type
- impl
- active
- charge
- throwing
- types
- utility
- control
- entity
- base
- impl
- input
- item
- special
- playerdata/store
- repository
- utility/math
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2605 | 2605 | | |
2606 | 2606 | | |
2607 | 2607 | | |
2608 | | - | |
| 2608 | + | |
2609 | 2609 | | |
2610 | 2610 | | |
2611 | 2611 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| |||
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
| 45 | + | |
43 | 46 | | |
44 | 47 | | |
45 | 48 | | |
| |||
64 | 67 | | |
65 | 68 | | |
66 | 69 | | |
| 70 | + | |
67 | 71 | | |
68 | 72 | | |
69 | 73 | | |
| |||
93 | 97 | | |
94 | 98 | | |
95 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
96 | 107 | | |
97 | 108 | | |
98 | 109 | | |
| |||
168 | 179 | | |
169 | 180 | | |
170 | 181 | | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
171 | 203 | | |
172 | 204 | | |
173 | 205 | | |
| |||
225 | 257 | | |
226 | 258 | | |
227 | 259 | | |
| 260 | + | |
| 261 | + | |
228 | 262 | | |
229 | 263 | | |
230 | 264 | | |
231 | | - | |
232 | | - | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
233 | 280 | | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | 281 | | |
239 | 282 | | |
240 | 283 | | |
| |||
263 | 306 | | |
264 | 307 | | |
265 | 308 | | |
| 309 | + | |
266 | 310 | | |
267 | 311 | | |
268 | 312 | | |
| |||
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
0 commit comments