mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 15:01:53 +08:00
b83273c812
fix(战斗): 调整Cat攻击伤害值从0.2降至0.01 refactor(动画): 简化EntityBase的受伤动画实现 perf(子弹): 优化ChickSprint伤害计算使用浮点数除法
21 lines
649 B
GDScript
21 lines
649 B
GDScript
extends EntityBase
|
|
class_name Maodie
|
|
|
|
func register():
|
|
fields[FieldStore.Entity.MAX_HEALTH] = 75
|
|
fields[FieldStore.Entity.MOVEMENT_SPEED] = randf_range(0.5, 0.8)
|
|
attackCooldownMap[0] = randi_range(2500, 6000)
|
|
sprintMultiplier = randf_range(10, 35)
|
|
func ai():
|
|
PresetEntityAI.follow(self, currentFocusedBoss)
|
|
tryAttack(0, true)
|
|
func attack(type: int):
|
|
if type == 0:
|
|
for bullet in BulletBase.generate(ComponentManager.getBullet("ChickSprint"), self, position, 0):
|
|
if bullet is ChickSprint:
|
|
bullet.atk = 0.01
|
|
trySprint()
|
|
return true
|
|
func sprint():
|
|
move((currentFocusedBoss.position - position).normalized() * sprintMultiplier, true)
|