mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 15:01:53 +08:00
b7638fa9b6
添加狗角色的受伤音效文件并配置导入设置 修改狗的攻击冷却时间为3000-5000毫秒随机值 调整狗角色的受伤音效播放几率为30% 为狗角色添加碰撞检测形状
20 lines
598 B
GDScript
20 lines
598 B
GDScript
extends EntityBase
|
|
|
|
func register():
|
|
fields[FieldStore.Entity.MAX_HEALTH] = 120
|
|
fields[FieldStore.Entity.MOVEMENT_SPEED] = 0.2
|
|
fields[FieldStore.Entity.OFFSET_SHOOT] = 0
|
|
attackCooldownMap[0] = randi_range(3000, 5000)
|
|
|
|
func ai():
|
|
PresetEntityAI.follow(self, currentFocusedBoss, 300)
|
|
tryAttack(0)
|
|
func attack(type):
|
|
if type == 0:
|
|
var weaponPos = findWeaponAnchor("normal")
|
|
var angle = weaponPos.angle_to_point(currentFocusedBoss.position)
|
|
for i in 3:
|
|
BulletBase.generate(ComponentManager.getBullet("DogCircle"), self, weaponPos, angle)
|
|
await TickTool.millseconds(100)
|
|
return true
|