1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 15:01:53 +08:00
Files
Dog-Lynx-And-HCN/scripts/Contents/Characters/EnergyBlock.gd
T
fallingshrimp e8413dd01b feat(武器系统): 添加神手玉武器并完善格挡机制
添加新武器"神手玉",实现不同类型的攻击格挡效果:
- 近战挥舞:化解伤害
- 近战戳刺:反弹伤害并击退
- 远程射弹:概率弹反
- 猛冲攻击:反弹速度
- 吐息攻击:产生击退
- 魔法/召唤攻击:少量储能

调整Parry.gd的相机震动参数,增加BulletBase的MotionType枚举值STAB,完善Parrier.gd对不同攻击类型的处理逻辑。同时添加Debug测试boss选项,修复AcidS.gd的缩进问题。
2026-05-08 15:43:55 +08:00

63 lines
2.6 KiB
GDScript

extends EntityBase
class_name EnergyBlockEntity
var currentBroom: BroomBullet
func register():
fields[FieldStore.Entity.MAX_HEALTH] = 1500
fields[FieldStore.Entity.MOVEMENT_SPEED] = 0.7
attackCooldownMap[0] = 6000
attackCooldownMap[1] = 3000
attackCooldownMap[2] = 8000
attackCooldownMap[3] = 8000
attackCooldownMap[4] = 2000
attackCooldownMap[5] = 2000
attackCooldownMap[6] = 5000
attackMutexes = [0, 1, 3]
sprintMultiplier = 30
func ai():
PresetEntityAI.distanceAttack(self , currentFocusedBoss, 0, 300, 0)
# PresetEntityAI.distanceAttack(self , currentFocusedBoss, 500, 1000, 1)
# for i in 5:
# tryAttack(i + 2, [3, 4])
# if 1 not in attackingStates:
# PresetEntityAI.follow(self , currentFocusedBoss, 200)
func attack(type: int):
if type == 0:
for bullet in BulletBase.generate(ComponentManager.getBullet("SwingSword"), self , getTrackingAnchor(), getTrackingAnchor().angle_to_point(currentFocusedPosition)):
if bullet is SwingSwordBullet:
await bullet.destroied
elif type == 1:
for bullet in BulletBase.generate(ComponentManager.getBullet("Broom"), self , getTrackingAnchor(), getTrackingAnchor().angle_to_point(currentFocusedPosition)):
if is_instance_valid(currentBroom): break
if bullet is BroomBullet:
currentBroom = bullet
await TickTool.frame()
bullet.animator.play("prepare")
await bullet.animator.animation_finished
await chargeUp()
trySprint()
currentBroom.animator.play("attack")
elif type == 2:
for i in 3:
for bullet in BulletBase.generate(ComponentManager.getBullet("BroomGun"), self , position, position.angle_to_point(currentFocusedPosition)):
if bullet is BulletBase:
bullet.position += Vector2.from_angle(bullet.rotation).rotated(deg_to_rad(90)) * i * 100
elif type == 3:
for bullet in BulletBase.generate(ComponentManager.getBullet("Broom"), self , getTrackingAnchor(), 0):
if bullet is BroomBullet:
fields[FieldStore.Entity.MOVEMENT_SPEED] *= 3
await TickTool.frame()
bullet.animator.play("rotate")
await bullet.destroied
fields[FieldStore.Entity.MOVEMENT_SPEED] /= 3
elif type == 4:
BulletBase.generate(ComponentManager.getBullet("BroomBoomerang"), self , position, position.angle_to_point(currentFocusedPosition))
elif type == 5:
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))
func sprint():
move((currentFocusedPosition - position).normalized() * sprintMultiplier, true)