阶段性完成

This commit is contained in:
SoulliesOfficial
2025-12-08 05:27:53 -05:00
parent ef7b479712
commit f7af60351b
8770 changed files with 15637030 additions and 208354 deletions

View File

@@ -1,6 +1,8 @@
using System.Collections.Generic;
using Cielonos.MainGame.Characters;
using Cielonos.UI;
using Sirenix.OdinInspector;
using SLSFramework.General;
using UnityEngine;
namespace Cielonos.MainGame.Inventory
@@ -48,6 +50,7 @@ namespace Cielonos.MainGame.Inventory
public void Update(float deltaTime)
{
currentCooldown -= deltaTime;
currentCooldown = Mathf.Max(currentCooldown, 0f);
}
public bool IsAvailable()
@@ -56,17 +59,23 @@ namespace Cielonos.MainGame.Inventory
bool energyAvailable = character.attributeSm["Energy"] >= data.energyCost;
return cooldownAvailable && energyAvailable;
}
public RuntimeFunctionUnit ResetCooldown()
public RuntimeFunctionUnit Execute()
{
currentCooldown = maxCooldown;
ResetCooldown();
ConsumeEnergy();
return this;
}
public RuntimeFunctionUnit ConsumeEnergy()
private void ResetCooldown()
{
character.attributeSm["CurrentEnergy"] -= data.energyCost;
return this;
currentCooldown = maxCooldown;
}
private void ConsumeEnergy()
{
character.attributeSm["Energy"] -= data.energyCost;
character.eventSm.onUseEnergy.Invoke(character, data.energyCost);
}
}
}