From 2f3912da34f5052fa753a8b210e74d13736ed425 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=A8=E8=90=BD=E5=9F=BA=E5=9B=B4=E8=99=BE?= <3161880837@qq.com> Date: Tue, 5 May 2026 07:31:35 +0800 Subject: [PATCH] =?UTF-8?q?fix(Feed):=20=E4=BF=AE=E5=A4=8DcountOf=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E4=B8=AD=E4=B9=98=E6=95=B0=E5=BA=94=E7=94=A8=E7=9A=84?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 当基础值为正数时使用乘法,为负数时使用除法,确保计算结果的正确性 --- scripts/Structs/Feed.gd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/Structs/Feed.gd b/scripts/Structs/Feed.gd index 0dcb86d..e969fe8 100644 --- a/scripts/Structs/Feed.gd +++ b/scripts/Structs/Feed.gd @@ -72,7 +72,8 @@ func apply(entity: EntityBase): selected.emit(allHave) return allHave func countOf(index: int) -> int: - return ceil(costCounts[index] * multipiler()) + var base = costCounts[index] + return ceil(base * multipiler()) if base > 0 else floor(base / multipiler()) func multipiler() -> float: if is_instance_valid(UIState.player): return 1 - UIState.player.fields.get(FieldStore.Entity.PRICE_REDUCTION)