1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-06-04 02:37:12 +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
@@ -1,9 +1,10 @@
[gd_scene load_steps=10 format=3 uid="uid://dxd6ikymj0fge"]
[gd_scene load_steps=14 format=3 uid="uid://dxd6ikymj0fge"]
[ext_resource type="PackedScene" uid="uid://crtdkysmnkith" path="res://components/Abstracts/BulletBase.tscn" id="1_mf7ha"]
[ext_resource type="Script" path="res://scripts/Statemachine/ShaderStage.gd" id="2_75div"]
[ext_resource type="Texture2D" uid="uid://c7hyatbuieaj" path="res://resources/bullets/purple-crystal/frames/0.svg" id="2_ghoc2"]
[ext_resource type="Shader" path="res://shaders/Ring.gdshader" id="2_utujj"]
[ext_resource type="Script" path="res://scripts/Contents/Bullets/BossAttack/KukeMC/HeavyCrystal.gd" id="2_ygemv"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_1i43q"]
shader = ExtResource("2_utujj")
@@ -101,19 +102,53 @@ _data = {
"spawn": SubResource("Animation_qobcv")
}
[sub_resource type="Curve" id="Curve_g11yl"]
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
point_count = 2
[sub_resource type="CurveTexture" id="CurveTexture_inkfe"]
curve = SubResource("Curve_g11yl")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_hgwnm"]
particle_flag_disable_z = true
direction = Vector3(-1, 0, 0)
spread = 0.0
initial_velocity_min = 300.0
initial_velocity_max = 300.0
gravity = Vector3(0, 0, 0)
alpha_curve = SubResource("CurveTexture_inkfe")
[node name="HeavyCrystal" instance=ExtResource("1_mf7ha")]
script = ExtResource("2_ygemv")
displayName = "重型紫水晶"
speed = 0.0
damage = 20.0
lifeTime = 2000.0
[node name="track" type="Node2D" parent="." index="0"]
unique_name_in_owner = true
material = SubResource("ShaderMaterial_1i43q")
script = ExtResource("2_75div")
size = Vector2(150, 150)
color = Color(0.451438, 0.278306, 1.44392e-07, 1)
[node name="texture" parent="." index="1"]
position = Vector2(73, 0)
position = Vector2(95, 0)
scale = Vector2(1.5, 1.5)
sprite_frames = SubResource("SpriteFrames_e150r")
[node name="animator" parent="texture" index="0"]
libraries = {
"": SubResource("AnimationLibrary_mdce7")
}
[node name="trail" type="GPUParticles2D" parent="texture" index="1"]
unique_name_in_owner = true
z_index = -1
amount = 10
process_material = SubResource("ParticleProcessMaterial_hgwnm")
texture = ExtResource("2_ghoc2")
local_coords = true
[node name="hitbox" parent="." index="2"]
position = Vector2(60, 0)
@@ -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))