/// --------------------------------------------- /// Ultimate Character Controller /// Copyright (c) Opsive. All Rights Reserved. /// https://www.opsive.com /// --------------------------------------------- namespace Opsive.UltimateCharacterController.Items.Actions { using Opsive.Shared.Inventory; using Opsive.UltimateCharacterController.Character.Abilities; using Opsive.UltimateCharacterController.Character.Abilities.Items; using Opsive.UltimateCharacterController.Items.AnimatorAudioStates; using Opsive.UltimateCharacterController.Utility; /// /// Interface for an item that can be used (fired, swung, thrown, etc). /// public interface IUsableItem { /// /// Returns the item that the UsableItem is attached to. /// /// The item that the UsableItem is attached to. Item Item { get; } /// /// Returns true if the inventory can equip an item that doesn't have any consumable items left. /// /// True if the inventory can equip an item that doesn't have any consumable items left. bool CanEquipEmptyItem { get; } /// /// Returns true if the character should turn to face the target. /// /// True if the character should turn to face the target. bool FaceTarget { get; } /// /// Does the item require root motion position during use? /// /// True if the item requires root motion position during use. bool ForceRootMotionPosition { get; } /// /// Does the item require root motion rotation during use? /// /// True if the item requires root motion rotation during use. bool ForceRootMotionRotation { get; } /// /// Specifies if the item should wait for the OnAnimatorItemUse animation event or wait for the specified duration before reloading. /// /// Value of if the item should use the OnAnimatorItemUse animation event or wait the specified duration. AnimationEventTrigger UseEvent { get; } /// /// Specifies if the item should wait for the OnAnimatorItemUseComplete animation event or wait for the specified duration before reloading. /// /// Value of if the item should use the OnAnimatorItemUseComplete animation event or wait the specified duration. AnimationEventTrigger UseCompleteEvent { get; } /// /// The set for the Use AnimatorAudioStateSet. /// /// Returns the set for the Use AnimatorAudioStateSet. AnimatorAudioStateSet UseAnimatorAudioStateSet { get; } /// /// Returns the amount of extra time it takes for the ability to stop after use. /// /// The amount of extra time it takes for the ability to stop after use. float StopUseAbilityDelay { get; } /// /// Returns the ItemIdentifier which can be consumed by the item. /// /// The ItemIdentifier which can be consumed by the item. IItemIdentifier GetConsumableItemIdentifier(); /// /// Returns the amount of UsableItemIdentifier which has been consumed by the UsableItem. /// /// The amount consumed of the UsableItemIdentifier. int GetConsumableItemIdentifierAmount(); /// /// Sets the UsableItemIdentifier amount on the UsableItem. /// /// The amount to set the UsableItemIdentifier to. void SetConsumableItemIdentifierAmount(int amount); /// /// Removes the amount of UsableItemIdentifier which has been consumed by the UsableItem. /// void RemoveConsumableItemIdentifierAmount(); /// /// Can the item be used? /// /// The item ability that is trying to use the item. /// The state of the Use ability when calling CanUseItem. /// True if the item can be used. bool CanUseItem(ItemAbility itemAbility, UsableItem.UseAbilityState abilityState); /// /// Can the ability be started? /// /// The ability that is trying to start. /// True if the ability can be started. bool CanStartAbility(Ability ability); /// /// Starts the item use. /// /// The item ability that is using the item. void StartItemUse(ItemAbility itemAbility); /// /// Uses the item. /// void UseItem(); /// /// Returns the substate index that the item should be in. /// /// Returns the substate index that the item should be in. int GetItemSubstateIndex(); /// /// Is the item in use? /// /// Returns true if the item is in use. bool IsItemInUse(); /// /// Is the item waiting to be used? This will return true if the item is waiting to be charged or pulled back. /// /// Returns true if the item is waiting to be used. bool IsItemUsePending(); /// /// Allows the item to update while it is being used. /// void UseItemUpdate(); /// /// The item has been used. /// void ItemUseComplete(); /// /// Tries to stop the item use. /// void TryStopItemUse(); /// /// Can the item use be stopped? /// /// True if the item use can be stopped. bool CanStopItemUse(); /// /// Stops the item use. /// void StopItemUse(); } }