1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-27 22:41:56 +08:00

feat(子弹效果): 添加HXD子弹爆炸效果及资源

添加HXDBoom效果控制器和5种爆炸纹理
调整HXD子弹的缩放比例并添加爆炸效果触发
扩展EffectController基类以支持自定义注册逻辑
This commit is contained in:
2026-02-02 10:05:27 +08:00
parent dd479b0d7b
commit 1022dd5024
16 changed files with 248 additions and 1 deletions
+1 -1
View File
@@ -43,7 +43,7 @@ penerate = 1.0
lifeTime = 5000.0
[node name="texture" parent="." index="0"]
scale = Vector2(0.185, 0.185)
scale = Vector2(0.2, 0.2)
sprite_frames = SubResource("SpriteFrames_lskjb")
animation = &"2"
+37
View File
@@ -0,0 +1,37 @@
[gd_scene load_steps=9 format=3 uid="uid://c0oppv5v8grnu"]
[ext_resource type="PackedScene" uid="uid://bcvuuy2m0pke0" path="res://components/Abstracts/EffectBase.tscn" id="1_41cv2"]
[ext_resource type="Script" uid="uid://bxvgpyb3fyko1" path="res://scripts/Contents/Effects/HXDBoom.gd" id="2_uo6a0"]
[ext_resource type="Texture2D" uid="uid://ctvlwl62ieuu6" path="res://resources/bullets/HXD/effect/4.png" id="3_4u6cx"]
[sub_resource type="Curve" id="Curve_4u6cx"]
_data = [Vector2(0.5, 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_rt83h"]
curve = SubResource("Curve_4u6cx")
[sub_resource type="Curve" id="Curve_l6ml7"]
_data = [Vector2(0.75, 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_tkfx4"]
curve = SubResource("Curve_l6ml7")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_4u6cx"]
particle_flag_disable_z = true
spread = 180.0
initial_velocity_min = 50.0
initial_velocity_max = 100.0
gravity = Vector3(0, 0, 0)
scale_curve = SubResource("CurveTexture_tkfx4")
alpha_curve = SubResource("CurveTexture_rt83h")
[node name="HXDBoom" instance=ExtResource("1_41cv2")]
script = ExtResource("2_uo6a0")
[node name="particles" parent="." index="1"]
amount = 1
texture = ExtResource("3_4u6cx")
local_coords = true
process_material = SubResource("ParticleProcessMaterial_4u6cx")
Binary file not shown.

After

Width:  |  Height:  |  Size: 307 B

+40
View File
@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b8og0letgrspa"
path="res://.godot/imported/0.png-2905c23aa6392c053e62e5de00b70feb.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resources/bullets/HXD/effect/0.png"
dest_files=["res://.godot/imported/0.png-2905c23aa6392c053e62e5de00b70feb.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file not shown.

After

Width:  |  Height:  |  Size: 327 B

+40
View File
@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bl1pbrklnqg7u"
path="res://.godot/imported/1.png-ac079a3f4ec1f5c001ff0b50a5e0b93f.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resources/bullets/HXD/effect/1.png"
dest_files=["res://.godot/imported/1.png-ac079a3f4ec1f5c001ff0b50a5e0b93f.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file not shown.

After

Width:  |  Height:  |  Size: 380 B

+40
View File
@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cnn5sqecb7pke"
path="res://.godot/imported/2.png-c18e448b7d9210ef47c0212579d09c03.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resources/bullets/HXD/effect/2.png"
dest_files=["res://.godot/imported/2.png-c18e448b7d9210ef47c0212579d09c03.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

+40
View File
@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://d1ify58chqj7n"
path="res://.godot/imported/3.png-abf0d1ef96a3d6f28f64c3b4f6045ee7.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resources/bullets/HXD/effect/3.png"
dest_files=["res://.godot/imported/3.png-abf0d1ef96a3d6f28f64c3b4f6045ee7.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file not shown.

After

Width:  |  Height:  |  Size: 579 B

+40
View File
@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://ctvlwl62ieuu6"
path="res://.godot/imported/4.png-638cb78e7f9c0dd2573ef68a9092629a.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resources/bullets/HXD/effect/4.png"
dest_files=["res://.godot/imported/4.png-638cb78e7f9c0dd2573ef68a9092629a.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
+1
View File
@@ -14,6 +14,7 @@ func succeedToHit(_dmg: float, entity: EntityBase):
if is_instance_valid(newEntity):
look_at(newEntity.position)
bouncedTime += 1
EffectController.create(ComponentManager.getEffect("HXDBoom"), position).shot()
func split(newBullet: BulletBase, _index: int, _total: int, _lastBullet: float):
if newBullet is HXDBullet:
newBullet.bouncedTime = 0
+4
View File
@@ -0,0 +1,4 @@
extends EffectController
func register():
particles.texture = load("res://resources/bullets/HXD/effect/%d.png" % randi_range(0, 4))
+1
View File
@@ -0,0 +1 @@
uid://bxvgpyb3fyko1
+4
View File
@@ -10,6 +10,7 @@ class_name EffectController
@onready var animator: AnimationPlayer = $"%animator"
func _ready():
register()
particles.emitting = false
particles.one_shot = oneShot
var sound = sounds.get_node_or_null(spawnSound)
@@ -30,6 +31,9 @@ func shot():
await sound.finished
queue_free()
func register():
pass
static func create(scene: PackedScene, spawnPosition: Vector2, parent: Node = null) -> EffectController:
var cloned = scene.instantiate() as EffectController
cloned.global_position = spawnPosition