Fix DBC Toggle Abilities and Wheel System

This commit is contained in:
Kam committed 2026-02-18 22:19:18 -05:00
1 parent ca2980909e
commit 2c2f0c0d8f
4 files changed
+124

No files matched your search

@@ -85,6 +85,58 @@ public interface IPlayerAbilityEvent extends IPlayerEvent {
int getTick();
}
/**
* Fired when a toggle ability is switched ON or OFF.
* Canceling prevents the toggle from changing state.
*
* @hookName abilityToggle
*/
@Cancelable
interface ToggleEvent extends IPlayerAbilityEvent {
/**
* @return true if the toggle is being turned ON (any state), false if being turned OFF
*/
boolean isTogglingOn();
/**
* @return the previous state (0 = was off, 1+ = previous active state)
*/
int getOldState();
/**
* @return the new state (0 = turning off, 1+ = new active state)
*/
int getNewState();
}
/**
* Fired every 10 ticks for each active toggle ability.
* Scripts can call {@link #setEnabled(boolean)} with false to force-deactivate the toggle.
*
* @hookName abilityToggleUpdate
*/
interface ToggleUpdateEvent extends IPlayerAbilityEvent {
/**
* @return the tick count since the toggle was activated
*/
int getTick();
/**
* @return the current toggle state (1+)
*/
int getState();
/**
* @return whether the toggle should remain active
*/
boolean isEnabled();
/**
* Set to false to force-deactivate the toggle after this event completes.
*/
void setEnabled(boolean enabled);
}
/**
* Fired when a player's ability hits an entity with damage.
* Canceling this event prevents the damage from being applied.