1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-06-02 01:11:54 +08:00

feat(角色): 为KukeMC添加重型紫水晶攻击技能

- 新增HeavyCrystal.gd脚本实现重型紫水晶子弹逻辑
- 在KukeMC角色中添加type=3的攻击类型
- 调整子弹场景配置,增加粒子特效和碰撞检测
- 移除旧的生成子角色和随机水晶攻击逻辑
This commit is contained in:
2025-09-17 23:02:52 +08:00
parent 63963fd5fd
commit 55aabd5fbc
3 changed files with 60 additions and 12 deletions
@@ -0,0 +1,17 @@
extends BulletBase
@onready var trail: GPUParticles2D = $"%trail"
@onready var track: Node2D = $"%track"
var readyTime: float = 1000
func spawn():
trail.emitting = false
func ai():
if timeLived() < readyTime:
rotation = launcher.position.angle_to_point(launcher.currentFocusedBoss.position)
else:
PresetBulletAI.forward(self, rotation)
speed += 1
trail.emitting = true
track.visible = false
+6 -10
View File
@@ -7,15 +7,8 @@ func register():
attackCooldownMap[0] = 2000
attackCooldownMap[1] = 5000
attackCooldownMap[2] = 6000
attackCooldownMap[3] = 2000
inventory[ItemStore.ItemType.APPLE] = INF
func spawn():
for i in 3:
var child = EntityBase.generate(load("res://components/Characters/KukeChild.tscn"), position + MathTool.randv2_range(500))
child.currentFocusedBoss = currentFocusedBoss
child.masterMine = self
for i in randi_range(5, 25):
BulletBase.generate(preload("res://components/Bullets/PurpleCrystal.tscn"), self, findWeaponAnchor("normal"), deg_to_rad(randf_range(0, 360)))
await TickTool.millseconds(randi_range(0, 50))
func ai():
PresetEntityAI.follow(self, currentFocusedBoss, 500)
for bullet in get_tree().get_nodes_in_group("bullets"):
@@ -24,8 +17,9 @@ func ai():
bullet.position.distance_to(self.position) < 200
):
bullet.tryDestroy()
for i in len(attackCooldownMap.keys()):
tryAttack(i)
# for i in len(attackCooldownMap.keys()):
# tryAttack(i)
tryAttack(3)
func attack(type):
if type == 0:
for i in randi_range(8, 16):
@@ -45,3 +39,5 @@ func attack(type):
fields[FieldStore.Entity.OFFSET_SHOOT] = 0
BulletBase.generate(preload("res://components/Bullets/PurpleCrystal.tscn"), self, findWeaponAnchor("normal"), deg_to_rad(360.0 / count * i + 360.0 / count1 * j))
await TickTool.millseconds(100)
elif type == 3:
BulletBase.generate(preload("res://components/Bullets/BossAttack/KukeMC/HeavyCrystal.tscn"), self, findWeaponAnchor("normal"), position.angle_to_point(currentFocusedBoss.position))