mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-29 07:21:54 +08:00
0571400cb2
- 将"猛冲"技能更名为"撕咬"并增加生命周期 - 为MTY添加新的攻击类型和冷却时间 - 调整MTY在普通波次中的生成参数
25 lines
753 B
GDScript
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)
|