1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 06:51:54 +08:00

fix(EntityBase): 限制能量值不超过最大值

style(Starter): 更新游戏模式选项文本描述
This commit is contained in:
2026-05-04 21:56:37 +08:00
parent 8137b398a9
commit b5c2152d4c
2 changed files with 3 additions and 2 deletions
+1
View File
@@ -322,6 +322,7 @@ func collectItem(itemType: ItemStore.ItemType, amount: int):
UIState.showTip("[b]%s[/b]已自动强化!" % weapon.displayName)
func storeEnergy(value: float, dontChangeDirection: bool = false):
energy += value * fields.get(FieldStore.Entity.ENERGY_MULTIPILER)
energy = clamp(energy, 0, fields[FieldStore.Entity.MAX_ENERGY])
energyChanged.emit(energy, dontChangeDirection)
func finalEnergy(base: float):
return base / fields.get(FieldStore.Entity.SAVE_ENERGY)