- Fixed
CooldownState::trigger
triggering an ability cooldown when the global cooldown was not ready.
AbilityState
,CooldownState
, andChargeState
now take a reference to anAbilityLike
where possible.- Added an
OnGlobalCooldown
error variant to indicate whetherCooldownState::ready
orCooldownState::trigger
failed due to the global cooldown or the abilities cooldown.
- now support
bevy
0.15 andleafwing-input-manager
0.16
- now support
leafwing-input-manager
0.15
- all types provided by this library are now
Reflect
- removed
ToggleActions
: this functionality no longer makes sense with changes to how LWIM disables actions. Use run conditions directly on the newAbilitySystem::TickCooldowns
system set - the associated type
Pool::Quantity
no longer needs to be able to be multiplied and divided by f32s to ease working with integer-based resource pools- in exchange, the
RegeneratingPool::regenerate
method no longer has a default implementation
- in exchange, the
- to better support working with multiple resource pools for a single
Abilitylike
:ready_no_cost
andtrigger_no_cost
have been added toAbilitylike
- when working with multiple resource pools, you should pass in
NullPool
as the type argument forAbilityState
Default
is now implemented forCharges
andCooldown
- added
Display
implementations forCharges
andCooldown
Actionlike::trigger
and friends now expends resource costs correctly- if you were working around this bug, remember to remove your workaround to avoid double-spending!
- now supports Bevy 0.14
- now supports Bevy 0.13
- now supports Bevy 0.12
- fixed several typos (
@striezel
) - improved the documentation for
Pool::replenish
- removed the required
new
method from thePool
trait: this method was overly restrictive, and prevented the construction of more complex pools with custom initialization parametersLifePool::new
andManaPool::new
methods have been added to the premade pools: do similarly for your ownPool
types
- the
Pool::ZERO
associated constant has been renamed to the clearerPool::MIN
.- the
MaxPoolLessThanZero
error type has been renamed toMaxPoolLessThanMin
to match.
- the
- the
Pool
trait has been split in two, with the regeneration-specific mechanics handled inRegeneratingPool
, to make the construction of non-regenerating pools much more intuitive - added the
Pool::is_empty
andPool::is_full
helper methods to thePool
trait - added
Add
,Sub
,AddAssign
andSubAssign
implementations to the premadeLife
andMana
types and their corresponding pools - added the
Display
trait toLife
,Mana
,LifePool
andManaPool
- removed the useless
AbilityPlugin::server()
plugin creation method
- now supports Bevy 0.11
- now supports Bevy 0.10
- the premade
LifePool
andManaPool
types now implement theResource
trait. - the premade
Life
andMana
types now implementMul<T> for f32
, allowing you to have commutative multiplication
- now supports Bevy 0.9
- You can now store and check resource pools (like life, mana or energy) with the
Pool
trait!- All of the corresponding ability methods and
AbilityState
have been changed to account for this. - Pools have a zero value, a max and a regeneration rate, and are used to track the resource pools of specific actors.
- The
Pool
trait has aQuantity
associated type: this might be used to track the amount stored in aPool
, the amount of damage dealt, the life regeneration rate or the mana cost of each ability. - For example, you can add
PoolBundle<Mana>
to your entity to track both theManaPool
and theAbilityCosts<A, ManaPool>
. - We've included a
LifePool
andManaPool
type to get you started; feel free to copy-and-paste to adapt them to your needs.
- All of the corresponding ability methods and
- All methods and functions that returned a bool now return a
Result<(), CannotUseAbility>
which explains why an action failed. - the
trigger_action
andaction_ready
functions were renamed totrigger_ability
andability_ready
- You can now store
Cooldowns
andActionCharges
on a per-action basis.- These new components are now included in the
InputManagerBundle
. - Like always, you can choose to use them as a resource instead.
- Set cooldowns for actions using
CooldownState::set(action, cooldown)
orCooldownState::new
. - Use
Actionlike::ready
withActionlike::trigger
as part of your action evaluation! - Cooldowns advance whenever
CooldownState::tick
is called (this will happen automatically if you add the plugin). - The exact strategy for how charges work for each action can be controlled by the
ReplenishStrategy
andCooldownStrategy
enums.
- These new components are now included in the