1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-06-09 05:07:12 +08:00

feat(子弹): 为魔法飞弹添加命中动画和音效

refactor(角色): 将MTY角色从猫头鹰改为狗熊宝宝并调整攻击逻辑

fix(子弹): 修复ParryBall和Parrier子弹的实例有效性检查

style(场景): 清理场景文件中的冗余属性

feat(工具): 为findClosetBulletCanDamage添加最大距离参数

chore(配置): 更新测试用的波次配置
This commit is contained in:
2026-04-24 18:09:24 +08:00
parent f27d75befd
commit 3a8c48dae7
12 changed files with 161 additions and 60 deletions
+18 -9
View File
@@ -5,23 +5,32 @@ func register():
fields[FieldStore.Entity.MAX_HEALTH] = 400
fields[FieldStore.Entity.MOVEMENT_SPEED] = 0.9
attackCooldownMap[0] = 2000
attackCooldownMap[1] = 250
attackCooldownMap[1] = 750
attackCooldownMap[2] = 450
sprintMultiplier = 5
func spawn():
texture.play("walk")
func ai():
PresetEntityAI.follow(self, currentFocusedBoss)
tryAttack(0)
tryAttack(1)
PresetEntityAI.follow(self , currentFocusedBoss)
for i in 3:
tryAttack(i)
func attack(type: int):
if type == 0:
trySprint()
elif type == 1:
BulletBase.generate(ComponentManager.getBullet("MTYSprint"), self, position, 0)
var track = getTrackingAnchor()
var bullet = BulletTool.findClosetBulletCanDamage(track, get_tree(), self , 400)
if is_instance_valid(bullet):
BulletBase.generate(ComponentManager.getBullet("Parrier"), self , track, track.angle_to_point(bullet.position))
elif type == 2:
if is_instance_valid(currentFocusedBoss):
var track = getTrackingAnchor()
if currentFocusedBoss.position.distance_to(track) <= 400:
BulletBase.generate(ComponentManager.getBullet("Parrier"), self , track, track.angle_to_point(currentFocusedBoss.position))
return true
func sprint():
var target = BulletTool.findClosetBulletCanDamage(position, get_tree(), self)
var track = getTrackingAnchor()
var target = BulletTool.findClosetBulletCanDamage(track, get_tree(), self , 300)
if is_instance_valid(target):
if position.distance_to(target.position) <= 200:
var dir = (target.position - position).rotated(MathTool.randomChoiceFrom([-1, 1]) * deg_to_rad(90))
move(dir.normalized() * sprintMultiplier, true)
var dir = (target.position - track).rotated(MathTool.randomChoiceFrom([-1, 1]) * deg_to_rad(90))
move(dir.normalized() * sprintMultiplier, true)