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

feat: 添加新的角色Hen,更新Chick角色的攻击逻辑,增强Boss状态条和子弹功能

This commit is contained in:
2025-08-26 14:47:12 +08:00
parent 5923660195
commit 51b3359e8d
11 changed files with 59 additions and 15 deletions
+7 -2
View File
@@ -30,6 +30,8 @@ var sprinting: bool = false
func _ready():
health = fields.get(FieldStore.Entity.MAX_HEALTH)
statebar.visible = !isBoss
if !isPlayer():
currentFocusedBoss = get_tree().get_nodes_in_group("players")[0]
func _process(_delta):
health = clamp(health, 0, fields.get(FieldStore.Entity.MAX_HEALTH))
animatree.set("parameters/blend_position", lerpf(animatree.get("parameters/blend_position"), lastDirection, 0.1))
@@ -40,7 +42,8 @@ func _physics_process(_delta: float) -> void:
sprinting = false
else:
velocity = Vector2.ZERO
ai()
if isPlayer() or is_instance_valid(currentFocusedBoss):
ai()
move_and_slide()
# 通用方法
@@ -70,8 +73,10 @@ func startCooldown():
lastAttack = Time.get_ticks_msec()
return state
func tryAttack(type: int):
if startCooldown():
var state = startCooldown()
if state:
attack(type)
return state
func trySprint():
sprint()
sprinting = true