1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 06:51:54 +08:00
Files
Dog-Lynx-And-HCN/scripts/Contents/Characters/EnergyBlock.gd
T
fallingshrimp 0a9e5f328a refactor(Statemachine): 将FollowPosition重构为SyncTransform并增加缩放功能
feat(EnergyBlock): 添加新的攻击类型1并设置冷却时间
fix(Parrier): 修复子弹碰撞时的hitbox禁用问题
feat(Bullets): 添加新的SwingSword子弹资源
style(Wave): 调整调试配置使用测试小怪而非Boss
2026-04-30 20:56:49 +08:00

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))