1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-29 07:21:54 +08:00
Files
Dog-Lynx-And-HCN/scripts/Contents/Characters/MTY.gd
T
fallingshrimp 0571400cb2 feat(MTY): 增强MTY角色的攻击能力
- 将"猛冲"技能更名为"撕咬"并增加生命周期
- 为MTY添加新的攻击类型和冷却时间
- 调整MTY在普通波次中的生成参数
2025-12-14 15:29:44 +08:00

25 lines
753 B
GDScript

extends EntityBase
class_name MTY
func register():
fields[FieldStore.Entity.MAX_HEALTH] = 400
fields[FieldStore.Entity.MOVEMENT_SPEED] = 0.9
attackCooldownMap[0] = 1500
attackCooldownMap[1] = 500
sprintMultiplier = 5
func ai():
PresetEntityAI.follow(self, currentFocusedBoss)
tryAttack(0)
tryAttack(1)
func attack(type: int):
if type == 0:
trySprint()
elif type == 1:
BulletBase.generate(ComponentManager.getBullet("MTYSprint"), self, position, 0)
return true
func sprint():
var target = BulletTool.findClosetBulletCanDamage(position, get_tree(), self)
if is_instance_valid(target):
var dir = (target.position - position).rotated(MathTool.randomChoiceFrom([-1, 1]) * deg_to_rad(90))
move(dir.normalized() * sprintMultiplier, true)