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

feat(战斗系统): 调整熊Boss的攻击行为和冲刺机制

- 修改ChickSprint子弹伤害计算公式的分母参数
- 在EntityBase中新增targetableSprinting状态变量
- 优化熊Boss的攻击模式,包括增加攻击次数随机性、调整移动速度和冲刺倍率
- 改进冲刺逻辑,增加目标位置随机性和冲刺后返回机制
This commit is contained in:
2025-09-13 20:39:05 +08:00
parent 97ec81f05e
commit 76b5d40b28
3 changed files with 28 additions and 14 deletions
+9 -3
View File
@@ -86,6 +86,7 @@ var statebar: EntityStateBar
var health: float = 0
var energy: float = 0
var sprinting: bool = false
var targetableSprinting: bool = false
var trailing: bool = false
var lastDirection: int = 1
@@ -246,23 +247,28 @@ func tryAttack(type: int, needChargeUp: bool = false):
if await weapon.tryAttack(self):
weapon.playSound("attack")
else:
attack(type)
playSound("attack" + str(type))
if await attack(type):
playSound("attack" + str(type))
return state
func trySprint():
trailing = true
playSound("sprint")
sprint()
sprinting = true
sprint()
await TickTool.until(func(): return !sprinting)
trailing = false
func sprintTo(target: Vector2, speed: float):
await TickTool.until(func(): return !targetableSprinting)
targetableSprinting = true
trailing = true
await TickTool.until(
func():
position += (target - position) * speed
return position.distance_to(target) < 10
)
position = target
trailing = false
targetableSprinting = false
func tryDie(by: BulletBase):
if is_queued_for_deletion(): return
for drop in range(min(len(drops), len(dropCounts))):