mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
3691a06f8b
添加深海角色及其攻击逻辑,包括两种攻击方式: 1. 随机发射水泥子弹 2. 向目标发射三发追踪木制子弹 新增木制子弹资源及脚本,实现追踪效果 调整武器树和波次配置,将深海加入测试波次 优化水泥子弹和筷子子弹的动画效果
20 lines
677 B
GDScript
20 lines
677 B
GDScript
extends EntityBase
|
|
class_name DeepseaEntity
|
|
|
|
func register():
|
|
fields[FieldStore.Entity.MAX_HEALTH] = 2000
|
|
fields[FieldStore.Entity.MOVEMENT_SPEED] = 0.9
|
|
fields[FieldStore.Entity.OFFSET_SHOOT] = 2
|
|
attackCooldownMap[0] = 1000
|
|
attackCooldownMap[1] = 2000
|
|
func ai():
|
|
PresetEntityAI.follow(self , currentFocusedBoss)
|
|
for i in 2:
|
|
tryAttack(i)
|
|
func attack(type: int):
|
|
if type == 0:
|
|
BulletBase.generate(ComponentManager.getBullet("Cement"), self , position, deg_to_rad(randf_range(0, 360)))
|
|
elif type == 1:
|
|
for i in 3:
|
|
BulletBase.generate(ComponentManager.getBullet("Wood"), self , position, position.angle_to_point(currentFocusedBoss.position) + i * deg_to_rad(20))
|