From 896713c52711ac1f56eb64ee4b31d91a429ca238 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: Fri, 29 Aug 2025 12:48:04 +0800 Subject: [PATCH] =?UTF-8?q?refactor(EntityBase):=20=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E5=86=B2=E5=88=BA=E8=83=BD=E9=87=8F=E6=B6=88=E8=80=97=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 简化冲刺功能实现,不再需要能量消耗机制 --- scripts/Statemachine/EntityBase.gd | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/scripts/Statemachine/EntityBase.gd b/scripts/Statemachine/EntityBase.gd index c0bcc51..0b5b333 100644 --- a/scripts/Statemachine/EntityBase.gd +++ b/scripts/Statemachine/EntityBase.gd @@ -59,8 +59,7 @@ var inventoryMax = { @export var drops: Array[ItemStore.ItemType] = [] @export var dropCounts: Array[Vector2] = [] @export var appleCount: Vector2i = Vector2(0, 2) # 死亡后掉落的苹果数量 -@export var level: int = 1 # 等级 -@export var sprintEnergy: float = 5 +@export var level: int = 1 @onready var animatree: AnimationTree = $"%animatree" @onready var texture: AnimatedSprite2D = $"%texture" @@ -194,10 +193,9 @@ func tryAttack(type: int): playSound("attack" + str(type)) return state func trySprint(): - if useEnergy(sprintEnergy): - playSound("sprint") - sprint() - sprinting = true + playSound("sprint") + sprint() + sprinting = true func tryDie(by: BulletBase): for drop in range(min(len(drops), len(dropCounts))): var item = drops[drop]