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

feat(战斗系统): 添加新武器"树"及其配套子弹和特效

实现新的近战武器"树",包含以下内容:
- 添加武器Tree.gd脚本及场景资源
- 新增Parrier子弹类型,支持子弹碰撞检测和反弹效果
- 添加武器攻击音效和子弹命中特效
- 修改BulletBase.gd以支持子弹间碰撞逻辑
- 更新角色预设装备新武器
This commit is contained in:
2026-03-16 23:35:22 +08:00
parent ff9273ca29
commit 5cb1e27a08
33 changed files with 680 additions and 8 deletions
+120
View File
@@ -0,0 +1,120 @@
[gd_scene load_steps=9 format=3 uid="uid://brt2q316hrswe"]
[ext_resource type="PackedScene" uid="uid://crtdkysmnkith" path="res://components/Abstracts/BulletBase.tscn" id="1_57y3f"]
[ext_resource type="Script" uid="uid://bi7nde2rs0w4m" path="res://scripts/Contents/Bullets/Parrier.gd" id="2_li4th"]
[ext_resource type="Texture2D" uid="uid://cajy8iya7achn" path="res://resources/bullets/parrier/造型2.png" id="3_ksxds"]
[sub_resource type="SpriteFrames" id="SpriteFrames_hu1af"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": ExtResource("3_ksxds")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}]
[sub_resource type="Animation" id="Animation_ksxds"]
resource_name = "spawn"
step = 0.1
tracks/0/type = "bezier"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:scale:x")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"handle_modes": PackedInt32Array(0, 2, 2),
"points": PackedFloat32Array(0.4, -0.25, 0, 0, 0, 0.5, -0.1, 0, 0.8, 0, 0, 0, 0, 0, 0),
"times": PackedFloat32Array(0, 0.2, 1)
}
tracks/1/type = "bezier"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath(".:scale:y")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"handle_modes": PackedInt32Array(2, 2, 2),
"points": PackedFloat32Array(0.4, 0, 0, 0, 0, 0.5, -0.1, 0, 0.8, 0, 0, 0, 0, 0, 0),
"times": PackedFloat32Array(0, 0.2, 1)
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath(".:modulate")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0, 0.2, 0.5, 1),
"transitions": PackedFloat32Array(1, 1, 1, 1),
"update": 0,
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1), Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
}
[sub_resource type="Animation" id="Animation_hu1af"]
length = 0.001
tracks/0/type = "bezier"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:scale:x")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"handle_modes": PackedInt32Array(0),
"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0),
"times": PackedFloat32Array(0)
}
tracks/1/type = "bezier"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath(".:scale:y")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"handle_modes": PackedInt32Array(0),
"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0),
"times": PackedFloat32Array(0)
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath(".:modulate")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 1)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_k4ctn"]
_data = {
&"RESET": SubResource("Animation_hu1af"),
&"spawn": SubResource("Animation_ksxds")
}
[sub_resource type="RectangleShape2D" id="RectangleShape2D_57y3f"]
size = Vector2(26, 102)
[node name="Parrier" instance=ExtResource("1_57y3f")]
script = ExtResource("2_li4th")
speed = 5.0
baseDamage = 0.0
penerate = 1.0
autoSpawnAnimation = true
freeAfterSpawn = true
[node name="texture" parent="." index="0"]
scale = Vector2(1e-05, 1e-05)
sprite_frames = SubResource("SpriteFrames_hu1af")
[node name="animator" parent="texture" index="0"]
libraries = {
&"": SubResource("AnimationLibrary_k4ctn")
}
[node name="hitbox" parent="." index="1"]
shape = SubResource("RectangleShape2D_57y3f")
+11 -3
View File
@@ -1,8 +1,9 @@
[gd_scene load_steps=20 format=3 uid="uid://dky8574uqc18r"]
[gd_scene load_steps=21 format=3 uid="uid://dky8574uqc18r"]
[ext_resource type="PackedScene" uid="uid://cvogxi7mktumf" path="res://components/Abstracts/EntityBase.tscn" id="1_e5pl8"]
[ext_resource type="Script" uid="uid://cthtupc6dtbav" path="res://scripts/Contents/Characters/Rooster.gd" id="2_oqdqd"]
[ext_resource type="PackedScene" uid="uid://c65tbxm3tclw0" path="res://components/Weapons/Hetun.tscn" id="3_da2ca"]
[ext_resource type="PackedScene" uid="uid://cx7nogfnv7s8t" path="res://components/Weapons/Tree.tscn" id="3_0omr3"]
[ext_resource type="PackedScene" uid="uid://c0n3igy4hucrg" path="res://components/Weapons/PurpleCrystal.tscn" id="4_0omr3"]
[ext_resource type="AudioStream" uid="uid://cdrevrq7n6yqa" path="res://resources/sounds/effect/Boing.mp3" id="4_66s6c"]
[ext_resource type="AudioStream" uid="uid://benyec5bqni0b" path="res://resources/sounds/effect/Chomp.wav" id="4_k0yme"]
[ext_resource type="AudioStream" uid="uid://dmxh3bpk8vyy5" path="res://resources/sounds/effect/Coin.mp3" id="5_xnbhq"]
@@ -101,9 +102,16 @@ process_material = SubResource("ParticleProcessMaterial_joj4g")
[node name="weaponStore" parent="." index="2"]
process_mode = 4
[node name="Hetun" parent="weaponStore" index="0" instance=ExtResource("3_da2ca")]
[node name="PurpleCrystal" parent="weaponStore" index="0" instance=ExtResource("4_0omr3")]
offset_left = 30.0
offset_top = 20.0
offset_right = 359.0
offset_bottom = 370.0
debugRebuild = false
[node name="Tree" parent="weaponStore" index="1" instance=ExtResource("3_0omr3")]
offset_bottom = 350.0
[node name="sprint" parent="sounds" index="0"]
stream = ExtResource("4_66s6c")
+86
View File
@@ -0,0 +1,86 @@
[gd_scene load_steps=14 format=3 uid="uid://bwbhxnuhmkwww"]
[ext_resource type="PackedScene" uid="uid://bcvuuy2m0pke0" path="res://components/Abstracts/EffectBase.tscn" id="1_vc7s4"]
[ext_resource type="Texture2D" uid="uid://bdvyebq7sepqf" path="res://resources/effects/parry/ParrySparkAccurate0.png" id="2_kic6n"]
[ext_resource type="AudioStream" uid="uid://caxopva6lrlm3" path="res://resources/sounds/effect/swordhit.ogg" id="2_l0pl0"]
[ext_resource type="Texture2D" uid="uid://bsq0s07h5u6fp" path="res://resources/effects/parry/ParrySparkAccurate1.png" id="3_l0pl0"]
[ext_resource type="Texture2D" uid="uid://myolsnuud6jk" path="res://resources/effects/parry/ParrySparkAccurate2.png" id="4_buxs5"]
[ext_resource type="Texture2D" uid="uid://cu72mlaga1ge4" path="res://resources/effects/parry/ParrySparkAccurate3.png" id="5_471em"]
[ext_resource type="Texture2D" uid="uid://25kjjcrbbm70" path="res://resources/effects/parry/ParrySparkAccurate4.png" id="6_tu1jt"]
[ext_resource type="Texture2D" uid="uid://2jjv833hjn0o" path="res://resources/effects/parry/ParrySparkAccurate5.png" id="7_f5km5"]
[ext_resource type="Texture2D" uid="uid://cvommbyvqfp1p" path="res://resources/effects/parry/ParrySparkAccurate6.png" id="8_molrd"]
[ext_resource type="Texture2D" uid="uid://rv10oe25rb6c" path="res://resources/effects/parry/ParrySparkAccurate.png" id="9_76bi2"]
[sub_resource type="Animation" id="Animation_kic6n"]
resource_name = "spawn"
step = 0.1
tracks/0/type = "method"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("%stage/../texture")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [&"default", 1.0, false],
"method": &"play"
}]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_l0pl0"]
_data = {
&"spawn": SubResource("Animation_kic6n")
}
[sub_resource type="SpriteFrames" id="SpriteFrames_qcypm"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": ExtResource("2_kic6n")
}, {
"duration": 1.0,
"texture": ExtResource("3_l0pl0")
}, {
"duration": 1.0,
"texture": ExtResource("4_buxs5")
}, {
"duration": 1.0,
"texture": ExtResource("5_471em")
}, {
"duration": 1.0,
"texture": ExtResource("6_tu1jt")
}, {
"duration": 1.0,
"texture": ExtResource("7_f5km5")
}, {
"duration": 1.0,
"texture": ExtResource("8_molrd")
}, {
"duration": 1.0,
"texture": ExtResource("9_76bi2")
}],
"loop": false,
"name": &"default",
"speed": 10.0
}]
[node name="Parry" instance=ExtResource("1_vc7s4")]
spawnSound = "spawn"
spawnAnimation = "spawn"
[node name="spawn" parent="sounds" index="0"]
stream = ExtResource("2_l0pl0")
[node name="animator" parent="stage" index="0"]
libraries = {
&"": SubResource("AnimationLibrary_l0pl0")
}
[node name="texture" type="AnimatedSprite2D" parent="." index="3"]
modulate = Color(0.5922946, 1, 0.5, 1)
scale = Vector2(0.5, 0.5)
sprite_frames = SubResource("SpriteFrames_qcypm")
frame = 7
frame_progress = 1.0
+8
View File
@@ -0,0 +1,8 @@
[gd_scene load_steps=3 format=3 uid="uid://cx7nogfnv7s8t"]
[ext_resource type="PackedScene" uid="uid://ckq2cq6m23hq3" path="res://components/Abstracts/WeaponCardBase.tscn" id="1_0lbwr"]
[ext_resource type="Script" uid="uid://bqdyhwcd4jwmj" path="res://scripts/Contents/Weapons/Tree.gd" id="2_jsuc8"]
[node name="Tree" instance=ExtResource("1_0lbwr")]
script = ExtResource("2_jsuc8")
cooldown = 500.0
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cajy8iya7achn"
path="res://.godot/imported/造型2.png-d735ea95eb1068efcbec5b0b13b9000a.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resources/bullets/parrier/造型2.png"
dest_files=["res://.godot/imported/造型2.png-d735ea95eb1068efcbec5b0b13b9000a.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: 3.6 KiB

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://rv10oe25rb6c"
path="res://.godot/imported/ParrySparkAccurate.png-9ea7f4fe2c3c378038c78f338ca450cd.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resources/effects/parry/ParrySparkAccurate.png"
dest_files=["res://.godot/imported/ParrySparkAccurate.png-9ea7f4fe2c3c378038c78f338ca450cd.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: 9.5 KiB

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bdvyebq7sepqf"
path="res://.godot/imported/ParrySparkAccurate0.png-9579b31239d8b97d58a96ccdf28f3bb3.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resources/effects/parry/ParrySparkAccurate0.png"
dest_files=["res://.godot/imported/ParrySparkAccurate0.png-9579b31239d8b97d58a96ccdf28f3bb3.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: 12 KiB

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bsq0s07h5u6fp"
path="res://.godot/imported/ParrySparkAccurate1.png-f635780c312b4cea5465ed5f988ff6c1.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resources/effects/parry/ParrySparkAccurate1.png"
dest_files=["res://.godot/imported/ParrySparkAccurate1.png-f635780c312b4cea5465ed5f988ff6c1.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: 23 KiB

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://myolsnuud6jk"
path="res://.godot/imported/ParrySparkAccurate2.png-640d9315b2864f9d3e54c09884e24c15.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resources/effects/parry/ParrySparkAccurate2.png"
dest_files=["res://.godot/imported/ParrySparkAccurate2.png-640d9315b2864f9d3e54c09884e24c15.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: 19 KiB

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cu72mlaga1ge4"
path="res://.godot/imported/ParrySparkAccurate3.png-74ee09ea690439898732383397c583c9.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resources/effects/parry/ParrySparkAccurate3.png"
dest_files=["res://.godot/imported/ParrySparkAccurate3.png-74ee09ea690439898732383397c583c9.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: 11 KiB

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://25kjjcrbbm70"
path="res://.godot/imported/ParrySparkAccurate4.png-565cf3bd289c1f96c18588b07462bb98.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resources/effects/parry/ParrySparkAccurate4.png"
dest_files=["res://.godot/imported/ParrySparkAccurate4.png-565cf3bd289c1f96c18588b07462bb98.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: 3.2 KiB

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://2jjv833hjn0o"
path="res://.godot/imported/ParrySparkAccurate5.png-db33aa4626e521c2e26f6d4cf3759cf1.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resources/effects/parry/ParrySparkAccurate5.png"
dest_files=["res://.godot/imported/ParrySparkAccurate5.png-db33aa4626e521c2e26f6d4cf3759cf1.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: 1.6 KiB

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cvommbyvqfp1p"
path="res://.godot/imported/ParrySparkAccurate6.png-b609105dc304f47559927061a96abf3c.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resources/effects/parry/ParrySparkAccurate6.png"
dest_files=["res://.godot/imported/ParrySparkAccurate6.png-b609105dc304f47559927061a96abf3c.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.
+19
View File
@@ -0,0 +1,19 @@
[remap]
importer="oggvorbisstr"
type="AudioStreamOggVorbis"
uid="uid://b3jn85pkl143b"
path="res://.godot/imported/Flash1.ogg-e46ded84fe03488a5cc1f158a52d4bdf.oggvorbisstr"
[deps]
source_file="res://resources/sounds/effect/Flash1.ogg"
dest_files=["res://.godot/imported/Flash1.ogg-e46ded84fe03488a5cc1f158a52d4bdf.oggvorbisstr"]
[params]
loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4
Binary file not shown.
+19
View File
@@ -0,0 +1,19 @@
[remap]
importer="oggvorbisstr"
type="AudioStreamOggVorbis"
uid="uid://g2j01jf3kap8"
path="res://.godot/imported/Flash2.ogg-706568fe0fdd4d16ca7418b806a2c254.oggvorbisstr"
[deps]
source_file="res://resources/sounds/effect/Flash2.ogg"
dest_files=["res://.godot/imported/Flash2.ogg-706568fe0fdd4d16ca7418b806a2c254.oggvorbisstr"]
[params]
loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4
Binary file not shown.
@@ -0,0 +1,19 @@
[remap]
importer="oggvorbisstr"
type="AudioStreamOggVorbis"
uid="uid://caxopva6lrlm3"
path="res://.godot/imported/swordhit.ogg-452eb737e873d4959f53db98c7884f44.oggvorbisstr"
[deps]
source_file="res://resources/sounds/effect/swordhit.ogg"
dest_files=["res://.godot/imported/swordhit.ogg-452eb737e873d4959f53db98c7884f44.oggvorbisstr"]
[params]
loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4
+10
View File
@@ -0,0 +1,10 @@
extends BulletBase
class_name ParrierBullet
func hitBullet(bullet: BulletBase):
if BulletTool.canDamage(bullet, launcher):
EffectController.create(ComponentManager.getEffect("Parry"), position).shot()
bullet.tryDestroy()
tryDestroy()
func ai():
PresetBulletAI.forward(self , rotation)
+1
View File
@@ -0,0 +1 @@
uid://bi7nde2rs0w4m
+13
View File
@@ -0,0 +1,13 @@
@tool
extends Weapon
func attack(entity: EntityBase):
for bullet in BulletBase.generate(
ComponentManager.getBullet("Parrier"),
entity,
entity.findWeaponAnchor("normal"),
entity.findWeaponAnchor("normal").angle_to_point(get_global_mouse_position()),
):
if bullet is ParrierBullet:
pass
return true
+1
View File
@@ -0,0 +1 @@
uid://bqdyhwcd4jwmj
+13 -5
View File
@@ -51,11 +51,6 @@ func _ready():
spawnInWhere = position
spawn()
dotLoop()
if autoSpawnAnimation:
animator.play("spawn")
await animator.animation_finished
if freeAfterSpawn:
tryDestroy()
if autoLoopAnimation:
animator.play("loop")
if autoPlayTexture:
@@ -66,7 +61,18 @@ func _ready():
if autoDestroyOnHitMap:
tryDestroy(true)
)
area_entered.connect(
func(body):
var bullet = BulletTool.fromArea(body)
if is_instance_valid(bullet):
hitBullet(bullet)
)
ai()
if autoSpawnAnimation:
animator.play("spawn")
await animator.animation_finished
if freeAfterSpawn:
tryDestroy()
func _process(_delta: float) -> void:
if destroying: return
if lifeTime > 0:
@@ -218,6 +224,8 @@ func split(newBullet: BulletBase, _index: int, _total: int, _lastBullet: float):
return newBullet
func refract(newBullet: BulletBase, _entity: EntityBase, _index: int, _total: int, _lastBullet: float):
return newBullet
func hitBullet(_bullet: BulletBase):
pass
static func generate(
bullet: PackedScene,