[Feat] Ability pickup refund, depleted slot interactions, and chargeable ability system#278
Merged
Conversation
…hrowDirect 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
- 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
- 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
…nu 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
…bility 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
…o-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.
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.
Summary
handleAbilityInputonly consumes LEFT, preventing the tree from advancing past root when the player is on cooldownChargeableAbilityabstract class,ChargeSession, andChargeAction— chargeable abilities hook into RIGHT (charge start) and RIGHT_HOLD (release) through the input treeIceSpellAbility: BLUE_ICE block that scales 0.25→3.0 over 3s with Y-axis rotation and sine-wave bob; releaseable at 0.5 scale; thrown viathrowDirectat current charge scaleupdateInventory()added after refund to force client syncTest plan