mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-27 22:41:56 +08:00
0a9e5f328a
feat(EnergyBlock): 添加新的攻击类型1并设置冷却时间 fix(Parrier): 修复子弹碰撞时的hitbox禁用问题 feat(Bullets): 添加新的SwingSword子弹资源 style(Wave): 调整调试配置使用测试小怪而非Boss
23 lines
789 B
GDScript
23 lines
789 B
GDScript
extends EntityBase
|
|
class_name EnergyBlockEntity
|
|
|
|
func register():
|
|
fields[FieldStore.Entity.MAX_HEALTH] = 5000
|
|
hit.connect(
|
|
func(damage: float, bullet: BulletBase, _crit: bool):
|
|
bullet.launcher.storeEnergy(damage)
|
|
)
|
|
attackCooldownMap[0] = 0
|
|
attackCooldownMap[1] = 3000
|
|
func ai():
|
|
tryAttack(0)
|
|
tryAttack(1)
|
|
func attack(type: int):
|
|
if type == 0:
|
|
var track = getTrackingAnchor()
|
|
var bullet = BulletTool.findClosetBulletCanDamage(track, get_tree(), self , 200)
|
|
if is_instance_valid(bullet):
|
|
BulletBase.generate(ComponentManager.getBullet("Parrier"), self , track, track.angle_to_point(bullet.position))
|
|
elif type == 1:
|
|
BulletBase.generate(ComponentManager.getBullet("SwingSword"), self , getTrackingAnchor(), getTrackingAnchor().angle_to_point(currentFocusedPosition))
|