(Feat) Item Dqta
This commit is contained in:
@@ -102,12 +102,14 @@ namespace Ashwild.Player
|
||||
|
||||
/// <summary>
|
||||
/// Swings on use input (gated by lock, setup and cooldown) and harvests the
|
||||
/// aimed target.
|
||||
/// aimed target. A depleted but non-destroyed tool (a worn-out repairable axe) is
|
||||
/// unusable: the swing is blocked until it is repaired.
|
||||
/// </summary>
|
||||
private void HandleAttackPressed()
|
||||
{
|
||||
if (PlayerEvents.InputLocked) return;
|
||||
if (raycastOrigin == null) return;
|
||||
if (PlayerInventory.Instance != null && PlayerInventory.Instance.GetSelectedSlot().IsDepleted) return;
|
||||
if (Time.time < nextSwingTime) return;
|
||||
|
||||
nextSwingTime = Time.time + swingCooldown;
|
||||
@@ -160,6 +162,10 @@ namespace Ashwild.Player
|
||||
HarvestableRegistry.Instance.RequestHitServerRpc(harvestable.Id, damage, toolId, hitDirection);
|
||||
|
||||
PlayerEvents.RaiseHarvestableHit(harvestable, damage);
|
||||
|
||||
// Wear the tool only on a real connecting hit, never on a swing into the air or a blocked clunk.
|
||||
if (PlayerInventory.Instance != null)
|
||||
PlayerInventory.Instance.ConsumeSelectedToolUse(1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user