做不出来

This commit is contained in:
SoulliesOfficial
2026-06-30 01:48:58 -04:00
parent 9a9e48f8a5
commit ddd387ef35
132 changed files with 8945 additions and 2943 deletions

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic;
using Cielonos.MainGame;
using Cielonos.MainGame.Buffs.Character;
using Cielonos.MainGame.Effects.Feedback;
using Cielonos.MainGame.UI;
@@ -197,9 +198,34 @@ namespace Cielonos.MainGame.Characters
public override void RecoverEnergy(float energyAmount, bool spawnText = true)
{
if (energyAmount <= 0) return;
if (Mathf.Abs(energyAmount) < 1e-5f) return;
AddEnergy(energyAmount);
if (energyAmount > 0)
{
float current = attributeSm[CharacterAttribute.Energy];
float max = attributeSm[CharacterAttribute.MaximumEnergy];
float availableSpace = max - current;
if (energyAmount > availableSpace)
{
attributeSm[CharacterAttribute.Energy] = max;
float conversionRate =
attributeSm.Has(CharacterAttribute.OverloadConversionRate) ?
attributeSm[CharacterAttribute.OverloadConversionRate] : 1f;
float overflowEnergy = (energyAmount - availableSpace) * conversionRate;
DistributeOverloadEnergy(overflowEnergy);
}
else
{
attributeSm[CharacterAttribute.Energy] += energyAmount;
}
}
else
{
attributeSm[CharacterAttribute.Energy] += energyAmount;
attributeSm[CharacterAttribute.Energy] = Mathf.Max(0, attributeSm[CharacterAttribute.Energy]);
}
if (spawnText)
{