diff --git a/DungeonShooting_Godot/excel/excelFile/ActivityBase.xlsx b/DungeonShooting_Godot/excel/excelFile/ActivityBase.xlsx
index ea04d05..d85150b 100644
--- a/DungeonShooting_Godot/excel/excelFile/ActivityBase.xlsx
+++ b/DungeonShooting_Godot/excel/excelFile/ActivityBase.xlsx
Binary files differ
diff --git a/DungeonShooting_Godot/excel/excelFile/ActivityMaterial.xlsx b/DungeonShooting_Godot/excel/excelFile/ActivityMaterial.xlsx
index 40ffb48..c9a3328 100644
--- a/DungeonShooting_Godot/excel/excelFile/ActivityMaterial.xlsx
+++ b/DungeonShooting_Godot/excel/excelFile/ActivityMaterial.xlsx
Binary files differ
diff --git a/DungeonShooting_Godot/excel/excelFile/AiAttackAttr.xlsx b/DungeonShooting_Godot/excel/excelFile/AiAttackAttr.xlsx
index d4d9de7..0b9e16b 100644
--- a/DungeonShooting_Godot/excel/excelFile/AiAttackAttr.xlsx
+++ b/DungeonShooting_Godot/excel/excelFile/AiAttackAttr.xlsx
Binary files differ
diff --git a/DungeonShooting_Godot/excel/excelFile/BulletBase.xlsx b/DungeonShooting_Godot/excel/excelFile/BulletBase.xlsx
index 32d592d..9b8ba73 100644
--- a/DungeonShooting_Godot/excel/excelFile/BulletBase.xlsx
+++ b/DungeonShooting_Godot/excel/excelFile/BulletBase.xlsx
Binary files differ
diff --git a/DungeonShooting_Godot/excel/excelFile/Sound.xlsx b/DungeonShooting_Godot/excel/excelFile/Sound.xlsx
index adee5e9..34c0908 100644
--- a/DungeonShooting_Godot/excel/excelFile/Sound.xlsx
+++ b/DungeonShooting_Godot/excel/excelFile/Sound.xlsx
Binary files differ
diff --git a/DungeonShooting_Godot/excel/excelFile/WeaponBase.xlsx b/DungeonShooting_Godot/excel/excelFile/WeaponBase.xlsx
index 511c660..efb9c49 100644
--- a/DungeonShooting_Godot/excel/excelFile/WeaponBase.xlsx
+++ b/DungeonShooting_Godot/excel/excelFile/WeaponBase.xlsx
Binary files differ
diff --git a/DungeonShooting_Godot/prefab/shell/Shell0004.tscn b/DungeonShooting_Godot/prefab/shell/Shell0004.tscn
new file mode 100644
index 0000000..42d8fd0
--- /dev/null
+++ b/DungeonShooting_Godot/prefab/shell/Shell0004.tscn
@@ -0,0 +1,48 @@
+[gd_scene load_steps=7 format=3 uid="uid://ycr5mjr25302"]
+
+[ext_resource type="Script" path="res://src/game/activity/shell/Shell.cs" id="1_ridlp"]
+[ext_resource type="Shader" path="res://resource/material/Blend.gdshader" id="2_guwkk"]
+[ext_resource type="SpriteFrames" uid="uid://b8b0ye3iv1vwp" path="res://resource/spriteFrames/shell/Shell0004.tres" id="3_1s5f3"]
+
+[sub_resource type="ShaderMaterial" id="ShaderMaterial_px12l"]
+resource_local_to_scene = true
+shader = ExtResource("2_guwkk")
+shader_parameter/blend = Color(0, 0, 0, 0.470588)
+shader_parameter/schedule = 1.0
+shader_parameter/modulate = Color(1, 1, 1, 1)
+shader_parameter/show_outline = false
+shader_parameter/outline_color = Color(0, 0, 0, 1)
+shader_parameter/outline_rainbow = false
+shader_parameter/outline_use_blend = true
+
+[sub_resource type="ShaderMaterial" id="ShaderMaterial_7e6fo"]
+resource_local_to_scene = true
+shader = ExtResource("2_guwkk")
+shader_parameter/blend = Color(1, 1, 1, 1)
+shader_parameter/schedule = 0.0
+shader_parameter/modulate = Color(1, 1, 1, 1)
+shader_parameter/show_outline = false
+shader_parameter/outline_color = Color(0, 0, 0, 1)
+shader_parameter/outline_rainbow = false
+shader_parameter/outline_use_blend = true
+
+[sub_resource type="RectangleShape2D" id="RectangleShape2D_ighya"]
+size = Vector2(4, 3)
+
+[node name="Shell0004" type="CharacterBody2D" node_paths=PackedStringArray("ShadowSprite", "AnimatedSprite", "Collision")]
+collision_layer = 128
+script = ExtResource("1_ridlp")
+ShadowSprite = NodePath("ShadowSprite")
+AnimatedSprite = NodePath("AnimatedSprite")
+Collision = NodePath("Collision")
+
+[node name="ShadowSprite" type="Sprite2D" parent="."]
+z_index = -1
+material = SubResource("ShaderMaterial_px12l")
+
+[node name="AnimatedSprite" type="AnimatedSprite2D" parent="."]
+material = SubResource("ShaderMaterial_7e6fo")
+sprite_frames = ExtResource("3_1s5f3")
+
+[node name="Collision" type="CollisionShape2D" parent="."]
+shape = SubResource("RectangleShape2D_ighya")
diff --git a/DungeonShooting_Godot/prefab/weapon/Weapon0009.tscn b/DungeonShooting_Godot/prefab/weapon/Weapon0009.tscn
index e20c5ef..3caedea 100644
--- a/DungeonShooting_Godot/prefab/weapon/Weapon0009.tscn
+++ b/DungeonShooting_Godot/prefab/weapon/Weapon0009.tscn
@@ -1,4 +1,4 @@
-[gd_scene load_steps=10 format=3 uid="uid://2lb2h8qunqyu"]
+[gd_scene load_steps=11 format=3 uid="uid://2lb2h8qunqyu"]
[ext_resource type="Shader" path="res://resource/material/Blend.gdshader" id="1_6fbtx"]
[ext_resource type="Script" path="res://src/game/activity/weapon/gun/Gun.cs" id="1_eprgt"]
@@ -43,6 +43,42 @@
"update": 0,
"values": [0]
}
+tracks/1/type = "value"
+tracks/1/imported = false
+tracks/1/enabled = true
+tracks/1/path = NodePath(".:rotation")
+tracks/1/interp = 1
+tracks/1/loop_wrap = true
+tracks/1/keys = {
+"times": PackedFloat32Array(0),
+"transitions": PackedFloat32Array(1),
+"update": 0,
+"values": [0.0]
+}
+tracks/2/type = "value"
+tracks/2/imported = false
+tracks/2/enabled = true
+tracks/2/path = NodePath("AnimatedSprite:animation")
+tracks/2/interp = 1
+tracks/2/loop_wrap = true
+tracks/2/keys = {
+"times": PackedFloat32Array(0),
+"transitions": PackedFloat32Array(1),
+"update": 1,
+"values": [&"reloading_frame"]
+}
+tracks/3/type = "value"
+tracks/3/imported = false
+tracks/3/enabled = true
+tracks/3/path = NodePath("AnimatedSprite:frame")
+tracks/3/interp = 1
+tracks/3/loop_wrap = true
+tracks/3/keys = {
+"times": PackedFloat32Array(0),
+"transitions": PackedFloat32Array(1),
+"update": 1,
+"values": [0]
+}
[sub_resource type="Animation" id="Animation_3piau"]
resource_name = "floodlight"
@@ -61,10 +97,52 @@
"values": [0, 0, 0.5, 0.5, 0]
}
+[sub_resource type="Animation" id="Animation_juv2q"]
+resource_name = "reloading"
+length = 1.5
+step = 0.02
+tracks/0/type = "value"
+tracks/0/imported = false
+tracks/0/enabled = true
+tracks/0/path = NodePath(".:rotation")
+tracks/0/interp = 1
+tracks/0/loop_wrap = true
+tracks/0/keys = {
+"times": PackedFloat32Array(0, 0.34, 0.4, 1.04, 1.1, 1.26, 1.5),
+"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1),
+"update": 0,
+"values": [0.0, -0.523599, 0.0, 0.0, -0.349066, -0.349066, 0.0]
+}
+tracks/1/type = "value"
+tracks/1/imported = false
+tracks/1/enabled = true
+tracks/1/path = NodePath("AnimatedSprite:animation")
+tracks/1/interp = 1
+tracks/1/loop_wrap = true
+tracks/1/keys = {
+"times": PackedFloat32Array(0),
+"transitions": PackedFloat32Array(1),
+"update": 1,
+"values": [&"reloading_frame"]
+}
+tracks/2/type = "value"
+tracks/2/imported = false
+tracks/2/enabled = true
+tracks/2/path = NodePath("AnimatedSprite:frame")
+tracks/2/interp = 1
+tracks/2/loop_wrap = true
+tracks/2/keys = {
+"times": PackedFloat32Array(0, 0.42, 0.44, 1.12, 1.14),
+"transitions": PackedFloat32Array(1, 1, 1, 1, 1),
+"update": 1,
+"values": [0, 1, 2, 3, 4]
+}
+
[sub_resource type="AnimationLibrary" id="AnimationLibrary_trkjd"]
_data = {
"RESET": SubResource("Animation_x136i"),
-"floodlight": SubResource("Animation_3piau")
+"floodlight": SubResource("Animation_3piau"),
+"reloading": SubResource("Animation_juv2q")
}
[node name="Weapon0009" type="CharacterBody2D" node_paths=PackedStringArray("FirePoint", "ShellPoint", "GripPoint", "AnimationPlayer", "ShadowSprite", "AnimatedSprite", "Collision")]
@@ -85,10 +163,10 @@
[node name="AnimatedSprite" type="AnimatedSprite2D" parent="."]
material = SubResource("ShaderMaterial_o36tv")
sprite_frames = ExtResource("2_4kxpd")
-frame_progress = 1.0
+animation = &"reloading_frame"
[node name="ShellPoint" type="Marker2D" parent="AnimatedSprite"]
-position = Vector2(-1, -1)
+position = Vector2(-2, -2)
[node name="FirePoint" type="Marker2D" parent="AnimatedSprite"]
position = Vector2(13, -0.5)
diff --git a/DungeonShooting_Godot/resource/config/ActivityBase.json b/DungeonShooting_Godot/resource/config/ActivityBase.json
index 2758f5e..99ef530 100644
--- a/DungeonShooting_Godot/resource/config/ActivityBase.json
+++ b/DungeonShooting_Godot/resource/config/ActivityBase.json
@@ -216,6 +216,18 @@
"ShowInMapEditor": false
},
{
+ "Id": "shell0004",
+ "Type": 7,
+ "Name": "",
+ "Intro": "",
+ "Details": "",
+ "IsStatic": false,
+ "__Material": "",
+ "Prefab": "res://prefab/shell/Shell0004.tscn",
+ "Icon": "",
+ "ShowInMapEditor": false
+ },
+ {
"Id": "effect0001",
"Type": 8,
"Name": "",
@@ -377,7 +389,7 @@
"Name": "",
"Intro": "\u5730\u7262\u623F\u95F4\u7684\u95E8(\u4E1C\u4FA7)",
"Details": "",
- "IsStatic": false,
+ "IsStatic": true,
"__Material": "",
"Prefab": "res://prefab/map/RoomDoor_E.tscn",
"Icon": "",
diff --git a/DungeonShooting_Godot/resource/config/AiAttackAttr.json b/DungeonShooting_Godot/resource/config/AiAttackAttr.json
index 89ba5e9..3d27a46 100644
--- a/DungeonShooting_Godot/resource/config/AiAttackAttr.json
+++ b/DungeonShooting_Godot/resource/config/AiAttackAttr.json
@@ -80,11 +80,11 @@
"Id": "0008",
"Remark": "\u69B4\u5F39\u70AE",
"FiringStand": true,
- "ShowSubline": true,
+ "ShowSubline": false,
"LockingTime": 1.5,
"LockAngleTime": 0.5,
"AttackLockAngle": true,
- "BulletSpeedScale": 0.85,
+ "BulletSpeedScale": 0.8,
"AmmoConsumptionProbability": 0
}
]
\ No newline at end of file
diff --git a/DungeonShooting_Godot/resource/config/Sound.json b/DungeonShooting_Godot/resource/config/Sound.json
index bf1487d..835bd5a 100644
--- a/DungeonShooting_Godot/resource/config/Sound.json
+++ b/DungeonShooting_Godot/resource/config/Sound.json
@@ -14,7 +14,7 @@
{
"Id": "shooting0003",
"Path": "res://resource/sound/sfx/shooting/Shooting0003.ogg",
- "Volume": 0.8,
+ "Volume": 0.7,
"Remark": "\u9730\u5F39\u67AA"
},
{
@@ -60,6 +60,12 @@
"Remark": "\u6FC0\u5149\u6B66\u5668"
},
{
+ "Id": "shooting0011",
+ "Path": "res://resource/sound/sfx/shooting/Shooting0011.ogg",
+ "Volume": 1.8,
+ "Remark": "\u69B4\u5F39\u53D1\u5C04\u5668"
+ },
+ {
"Id": "reloading0001",
"Path": "res://resource/sound/sfx/reloading/Reloading0001.ogg",
"Volume": 1,
@@ -232,5 +238,29 @@
"Path": "res://resource/sound/sfx/beLoaded/BeLoaded0017.ogg",
"Volume": 1,
"Remark": ""
+ },
+ {
+ "Id": "explosion0001",
+ "Path": "res://resource/sound/sfx/explosion/Explosion0001.ogg",
+ "Volume": 1.2,
+ "Remark": "\u7206\u70B8"
+ },
+ {
+ "Id": "explosion0002",
+ "Path": "res://resource/sound/sfx/explosion/Explosion0002.ogg",
+ "Volume": 1.2,
+ "Remark": "\u7206\u70B8"
+ },
+ {
+ "Id": "explosion0003",
+ "Path": "res://resource/sound/sfx/explosion/Explosion0003.ogg",
+ "Volume": 1.2,
+ "Remark": "\u7206\u70B8"
+ },
+ {
+ "Id": "collision0001",
+ "Path": "res://resource/sound/sfx/collision/Collision0001.ogg",
+ "Volume": 0.7,
+ "Remark": "\u78B0\u649E"
}
]
\ No newline at end of file
diff --git a/DungeonShooting_Godot/resource/config/WeaponBase.json b/DungeonShooting_Godot/resource/config/WeaponBase.json
index 7d1cb71..7e03d49 100644
--- a/DungeonShooting_Godot/resource/config/WeaponBase.json
+++ b/DungeonShooting_Godot/resource/config/WeaponBase.json
@@ -1223,7 +1223,7 @@
"AmmoCapacity": 1,
"MaxAmmoCapacity": 50,
"StandbyAmmoCapacity": 25,
- "ReloadTime": 2.5,
+ "ReloadTime": 1.5,
"AloneReload": false,
"AloneReloadCount": 1,
"AloneReloadBeginIntervalTime": 0,
@@ -1262,9 +1262,9 @@
"UpliftAngleRestore": 3,
"FireEffect": "res://prefab/effect/weapon/ShotFire.tscn",
"__Bullet": "0005",
- "__Shell": "shell0001",
+ "__Shell": "shell0004",
"ReloadThrowShell": true,
- "ThrowShellDelayTime": 0,
+ "ThrowShellDelayTime": 0.46,
"ThrowCollisionSize": {
"X": 20,
"Y": 15
@@ -1276,7 +1276,7 @@
"MeleeAttackRepelRnage": [
100
],
- "__ShootSound": "",
+ "__ShootSound": "shooting0011",
"__BeginReloadSound": "",
"BeginReloadSoundDelayTime": 0,
"__ReloadSound": "",
@@ -1299,7 +1299,7 @@
"AmmoCapacity": 1,
"MaxAmmoCapacity": 50,
"StandbyAmmoCapacity": 25,
- "ReloadTime": 2.5,
+ "ReloadTime": 1.5,
"AloneReload": false,
"AloneReloadCount": 1,
"AloneReloadBeginIntervalTime": 0,
@@ -1338,9 +1338,9 @@
"UpliftAngleRestore": 3,
"FireEffect": "res://prefab/effect/weapon/ShotFire.tscn",
"__Bullet": "0005",
- "__Shell": "shell0001",
+ "__Shell": "shell0004",
"ReloadThrowShell": true,
- "ThrowShellDelayTime": 0,
+ "ThrowShellDelayTime": 0.46,
"ThrowCollisionSize": {
"X": 20,
"Y": 15
@@ -1352,7 +1352,7 @@
"MeleeAttackRepelRnage": [
100
],
- "__ShootSound": "",
+ "__ShootSound": "shooting0011",
"__BeginReloadSound": "",
"BeginReloadSoundDelayTime": 0,
"__ReloadSound": "",
diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start2/Preinstall.json b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start2/Preinstall.json
index 2af15f7..12a1fd4 100644
--- a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start2/Preinstall.json
+++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start2/Preinstall.json
@@ -1 +1 @@
-[{"Name":"test1","Weight":100,"Remark":"","WaveList":[[{"Position":{"X":0,"Y":0},"Size":{"X":0,"Y":0},"SpecialMarkType":1,"DelayTime":0,"MarkList":[]},{"Position":{"X":0,"Y":26},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0005","Weight":100,"Attr":{"CurrAmmon":"10","ResidueAmmo":"40"},"Altitude":8,"VerticalSpeed":0}]}]]}]
\ No newline at end of file
+[{"Name":"test1","Weight":100,"Remark":"","WaveList":[[{"Position":{"X":0,"Y":0},"Size":{"X":0,"Y":0},"SpecialMarkType":1,"DelayTime":0,"MarkList":[]},{"Position":{"X":0,"Y":26},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0005","Weight":100,"Attr":{"CurrAmmon":"10","ResidueAmmo":"40"},"Altitude":8,"VerticalSpeed":0}]}],[{"Position":{"X":-0,"Y":-35},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"enemy0001","Weight":100,"Attr":{"Face":"0","Weapon":"weapon0009","CurrAmmon":"1","ResidueAmmo":"1"},"Altitude":0,"VerticalSpeed":0}]}]]}]
\ No newline at end of file
diff --git a/DungeonShooting_Godot/resource/sound/sfx/collision/Collision0001.ogg b/DungeonShooting_Godot/resource/sound/sfx/collision/Collision0001.ogg
new file mode 100644
index 0000000..6c4611a
--- /dev/null
+++ b/DungeonShooting_Godot/resource/sound/sfx/collision/Collision0001.ogg
Binary files differ
diff --git a/DungeonShooting_Godot/resource/sound/sfx/collision/Collision0001.ogg.import b/DungeonShooting_Godot/resource/sound/sfx/collision/Collision0001.ogg.import
new file mode 100644
index 0000000..2eeee7f
--- /dev/null
+++ b/DungeonShooting_Godot/resource/sound/sfx/collision/Collision0001.ogg.import
@@ -0,0 +1,19 @@
+[remap]
+
+importer="oggvorbisstr"
+type="AudioStreamOggVorbis"
+uid="uid://rj811bni34nt"
+path="res://.godot/imported/Collision0001.ogg-1ff34918eb3dbf32e125bc036d2c72c7.oggvorbisstr"
+
+[deps]
+
+source_file="res://resource/sound/sfx/collision/Collision0001.ogg"
+dest_files=["res://.godot/imported/Collision0001.ogg-1ff34918eb3dbf32e125bc036d2c72c7.oggvorbisstr"]
+
+[params]
+
+loop=false
+loop_offset=0
+bpm=0
+beat_count=0
+bar_beats=4
diff --git a/DungeonShooting_Godot/resource/sound/sfx/shooting/Shooting0011.ogg b/DungeonShooting_Godot/resource/sound/sfx/shooting/Shooting0011.ogg
new file mode 100644
index 0000000..e2ddabe
--- /dev/null
+++ b/DungeonShooting_Godot/resource/sound/sfx/shooting/Shooting0011.ogg
Binary files differ
diff --git a/DungeonShooting_Godot/resource/sound/sfx/shooting/Shooting0011.ogg.import b/DungeonShooting_Godot/resource/sound/sfx/shooting/Shooting0011.ogg.import
new file mode 100644
index 0000000..43c67f2
--- /dev/null
+++ b/DungeonShooting_Godot/resource/sound/sfx/shooting/Shooting0011.ogg.import
@@ -0,0 +1,19 @@
+[remap]
+
+importer="oggvorbisstr"
+type="AudioStreamOggVorbis"
+uid="uid://dd8iw4672uyyr"
+path="res://.godot/imported/Shooting0011.ogg-5ca9f9d8f36d57a9dd35dcc79e364d1f.oggvorbisstr"
+
+[deps]
+
+source_file="res://resource/sound/sfx/shooting/Shooting0011.ogg"
+dest_files=["res://.godot/imported/Shooting0011.ogg-5ca9f9d8f36d57a9dd35dcc79e364d1f.oggvorbisstr"]
+
+[params]
+
+loop=false
+loop_offset=0
+bpm=0
+beat_count=0
+bar_beats=4
diff --git a/DungeonShooting_Godot/resource/sprite/shell/Shell0004.png b/DungeonShooting_Godot/resource/sprite/shell/Shell0004.png
new file mode 100644
index 0000000..c707ae5
--- /dev/null
+++ b/DungeonShooting_Godot/resource/sprite/shell/Shell0004.png
Binary files differ
diff --git a/DungeonShooting_Godot/resource/sprite/shell/Shell0004.png.import b/DungeonShooting_Godot/resource/sprite/shell/Shell0004.png.import
new file mode 100644
index 0000000..fea12d1
--- /dev/null
+++ b/DungeonShooting_Godot/resource/sprite/shell/Shell0004.png.import
@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://17htwakoupb2"
+path="res://.godot/imported/Shell0004.png-c15276d49808c180fa5762fdca11586e.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://resource/sprite/shell/Shell0004.png"
+dest_files=["res://.godot/imported/Shell0004.png-c15276d49808c180fa5762fdca11586e.ctex"]
+
+[params]
+
+compress/mode=0
+compress/high_quality=false
+compress/lossy_quality=0.7
+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/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
diff --git a/DungeonShooting_Godot/resource/sprite/shell/shellCase.aseprite b/DungeonShooting_Godot/resource/sprite/shell/shellCase.aseprite
deleted file mode 100644
index fe6c181..0000000
--- a/DungeonShooting_Godot/resource/sprite/shell/shellCase.aseprite
+++ /dev/null
Binary files differ
diff --git a/DungeonShooting_Godot/resource/sprite/weapon/weapon0009/Weapon0009_reload.png b/DungeonShooting_Godot/resource/sprite/weapon/weapon0009/Weapon0009_reload.png
new file mode 100644
index 0000000..e2d8ce4
--- /dev/null
+++ b/DungeonShooting_Godot/resource/sprite/weapon/weapon0009/Weapon0009_reload.png
Binary files differ
diff --git a/DungeonShooting_Godot/resource/sprite/weapon/weapon0009/Weapon0009_reload.png.import b/DungeonShooting_Godot/resource/sprite/weapon/weapon0009/Weapon0009_reload.png.import
new file mode 100644
index 0000000..25ceb9b
--- /dev/null
+++ b/DungeonShooting_Godot/resource/sprite/weapon/weapon0009/Weapon0009_reload.png.import
@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://bvw6batqb8dv8"
+path="res://.godot/imported/Weapon0009_reload.png-db2c0eea5342ef19729a52cc3bde8e8d.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://resource/sprite/weapon/weapon0009/Weapon0009_reload.png"
+dest_files=["res://.godot/imported/Weapon0009_reload.png-db2c0eea5342ef19729a52cc3bde8e8d.ctex"]
+
+[params]
+
+compress/mode=0
+compress/high_quality=false
+compress/lossy_quality=0.7
+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/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
diff --git a/DungeonShooting_Godot/resource/sprite/weapon/weapon0009/weapon0009.png b/DungeonShooting_Godot/resource/sprite/weapon/weapon0009/weapon0009.png
index e9b8780..35ed6f4 100644
--- a/DungeonShooting_Godot/resource/sprite/weapon/weapon0009/weapon0009.png
+++ b/DungeonShooting_Godot/resource/sprite/weapon/weapon0009/weapon0009.png
Binary files differ
diff --git a/DungeonShooting_Godot/resource/spriteFrames/shell/Shell0004.tres b/DungeonShooting_Godot/resource/spriteFrames/shell/Shell0004.tres
new file mode 100644
index 0000000..f1bd70c
--- /dev/null
+++ b/DungeonShooting_Godot/resource/spriteFrames/shell/Shell0004.tres
@@ -0,0 +1,14 @@
+[gd_resource type="SpriteFrames" load_steps=2 format=3 uid="uid://b8b0ye3iv1vwp"]
+
+[ext_resource type="Texture2D" uid="uid://17htwakoupb2" path="res://resource/sprite/shell/Shell0004.png" id="1_mpyi3"]
+
+[resource]
+animations = [{
+"frames": [{
+"duration": 1.0,
+"texture": ExtResource("1_mpyi3")
+}],
+"loop": true,
+"name": &"default",
+"speed": 5.0
+}]
diff --git a/DungeonShooting_Godot/resource/spriteFrames/weapon/Weapon0009.tres b/DungeonShooting_Godot/resource/spriteFrames/weapon/Weapon0009.tres
index fc38f54..987a1d4 100644
--- a/DungeonShooting_Godot/resource/spriteFrames/weapon/Weapon0009.tres
+++ b/DungeonShooting_Godot/resource/spriteFrames/weapon/Weapon0009.tres
@@ -1,6 +1,27 @@
-[gd_resource type="SpriteFrames" load_steps=2 format=3 uid="uid://c0xwj3kpk02ua"]
+[gd_resource type="SpriteFrames" load_steps=8 format=3 uid="uid://c0xwj3kpk02ua"]
[ext_resource type="Texture2D" uid="uid://qd7hufitblaf" path="res://resource/sprite/weapon/weapon0009/weapon0009.png" id="1_kidjv"]
+[ext_resource type="Texture2D" uid="uid://bvw6batqb8dv8" path="res://resource/sprite/weapon/weapon0009/Weapon0009_reload.png" id="2_3282c"]
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_isstj"]
+atlas = ExtResource("2_3282c")
+region = Rect2(0, 0, 32, 24)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_6v16h"]
+atlas = ExtResource("2_3282c")
+region = Rect2(32, 0, 32, 24)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_jjjl6"]
+atlas = ExtResource("2_3282c")
+region = Rect2(64, 0, 32, 24)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_nykj1"]
+atlas = ExtResource("2_3282c")
+region = Rect2(96, 0, 32, 24)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_6s7uc"]
+atlas = ExtResource("2_3282c")
+region = Rect2(128, 0, 32, 24)
[resource]
animations = [{
@@ -11,4 +32,24 @@
"loop": false,
"name": &"default",
"speed": 5.0
+}, {
+"frames": [{
+"duration": 1.0,
+"texture": SubResource("AtlasTexture_isstj")
+}, {
+"duration": 1.0,
+"texture": SubResource("AtlasTexture_6v16h")
+}, {
+"duration": 1.0,
+"texture": SubResource("AtlasTexture_jjjl6")
+}, {
+"duration": 1.0,
+"texture": SubResource("AtlasTexture_nykj1")
+}, {
+"duration": 1.0,
+"texture": SubResource("AtlasTexture_6s7uc")
+}],
+"loop": true,
+"name": &"reloading_frame",
+"speed": 5.0
}]
diff --git a/DungeonShooting_Godot/src/framework/activity/ActivityObject_Init.cs b/DungeonShooting_Godot/src/framework/activity/ActivityObject_Init.cs
index 79cdb91..8372962 100644
--- a/DungeonShooting_Godot/src/framework/activity/ActivityObject_Init.cs
+++ b/DungeonShooting_Godot/src/framework/activity/ActivityObject_Init.cs
@@ -100,6 +100,11 @@
public const string Id_shell0003 = "shell0003";
///
/// 名称:
+ /// 简介:
+ ///
+ public const string Id_shell0004 = "shell0004";
+ ///
+ /// 名称:
/// 简介: 敌人死亡碎片
///
public const string Id_effect0001 = "effect0001";
diff --git a/DungeonShooting_Godot/src/game/activity/bullet/explode/Explode.cs b/DungeonShooting_Godot/src/game/activity/bullet/explode/Explode.cs
index 4b64dd8..302be1c 100644
--- a/DungeonShooting_Godot/src/game/activity/bullet/explode/Explode.cs
+++ b/DungeonShooting_Godot/src/game/activity/bullet/explode/Explode.cs
@@ -1,4 +1,5 @@
+using Config;
using Godot;
///
@@ -86,10 +87,15 @@
}
}
- public void RunPlay()
+ ///
+ /// 播放爆炸, triggerRole 为触发该爆炸的角色
+ ///
+ public void RunPlay(Role triggerRole = null)
{
GameCamera.Main.CreateShake(new Vector2(6, 6), 0.7f, true);
AnimationPlayer.Play(AnimatorNames.Play);
+ //播放爆炸音效
+ SoundManager.PlaySoundByConfig("explosion0002", Position, triggerRole);
}
//爆炸冲击波
diff --git a/DungeonShooting_Godot/src/game/activity/bullet/normal/BoomBullet.cs b/DungeonShooting_Godot/src/game/activity/bullet/normal/BoomBullet.cs
index e108396..b997951 100644
--- a/DungeonShooting_Godot/src/game/activity/bullet/normal/BoomBullet.cs
+++ b/DungeonShooting_Godot/src/game/activity/bullet/normal/BoomBullet.cs
@@ -32,6 +32,17 @@
{
PlayBoom();
}
+ else
+ {
+ //播放撞击音效
+ SoundManager.PlaySoundByConfig("collision0001", Position, BulletData.TriggerRole);
+ }
+ }
+
+ protected override void OnFallToGround()
+ {
+ //播放撞击音效
+ SoundManager.PlaySoundByConfig("collision0001", Position, BulletData.TriggerRole);
}
///
@@ -45,7 +56,7 @@
explode.RotationDegrees = Utils.Random.RandomRangeInt(0, 360);
explode.AddToActivityRootDeferred(RoomLayerEnum.YSortLayer);
explode.Init(BulletData.TriggerRole?.AffiliationArea, AttackLayer, 25, BulletData.MinHarm, BulletData.MaxHarm, 50, 150);
- explode.RunPlay();
+ explode.RunPlay(BulletData.TriggerRole);
if (AffiliationArea != null)
{
var texture = ResourceManager.LoadTexture2D(ResourcePath.resource_sprite_effects_explode_Explode_pit0001_png);
diff --git a/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs b/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs
index 0cff208..e3a7ee2 100644
--- a/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs
+++ b/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs
@@ -232,6 +232,9 @@
//上膛计时器
private float _beLoadedStateTimer = -1;
+ //换弹投抛弹壳记录
+ private bool _reloadShellFlag = false;
+
// ----------------------------------------------
private uint _tempLayer;
@@ -962,13 +965,16 @@
{
_attackFlag = true;
_noAttackTime = 0;
+ _reloadShellFlag = false;
//减子弹数量
if (_playerWeaponAttribute != _weaponAttribute) //Ai使用该武器, 有一定概率不消耗弹药
{
- if (Utils.Random.RandomRangeFloat(0, 1) < _weaponAttribute.AiAttackAttr.AmmoConsumptionProbability) //触发消耗弹药
+ var count = UseAmmoCount();
+ CurrAmmo -= count;
+ if (Utils.Random.RandomRangeFloat(0, 1) >= _weaponAttribute.AiAttackAttr.AmmoConsumptionProbability) //不消耗弹药
{
- CurrAmmo -= UseAmmoCount();
+ ResidueAmmo += count;
}
}
else
@@ -1261,15 +1267,13 @@
{
if (Attribute.BeginReloadSound != null)
{
- var position = GameApplication.Instance.ViewToGlobalPosition(GlobalPosition);
- var volume = SoundManager.CalcRoleVolume(Attribute.BeginReloadSound.Volume, Master);
if (Attribute.BeginReloadSoundDelayTime <= 0)
{
- SoundManager.PlaySoundEffectPosition(Attribute.BeginReloadSound.Path, position, volume);
+ SoundManager.PlaySoundByConfig(Attribute.BeginReloadSound, GlobalPosition, TriggerRole);
}
else
{
- SoundManager.PlaySoundEffectPositionDelay(Attribute.BeginReloadSound.Path, position, Attribute.BeginReloadSoundDelayTime, volume);
+ SoundManager.PlaySoundByConfigDelay(Attribute.BeginReloadSound, GlobalPosition, Attribute.BeginReloadSoundDelayTime, TriggerRole);
}
}
}
@@ -1279,15 +1283,13 @@
{
if (Attribute.ReloadSound != null)
{
- var position = GameApplication.Instance.ViewToGlobalPosition(GlobalPosition);
- var volume = SoundManager.CalcRoleVolume(Attribute.ReloadSound.Volume, Master);
if (Attribute.ReloadSoundDelayTime <= 0)
{
- SoundManager.PlaySoundEffectPosition(Attribute.ReloadSound.Path, position, volume);
+ SoundManager.PlaySoundByConfig(Attribute.ReloadSound, GlobalPosition, TriggerRole);
}
else
{
- SoundManager.PlaySoundEffectPositionDelay(Attribute.ReloadSound.Path, position, Attribute.ReloadSoundDelayTime, volume);
+ SoundManager.PlaySoundByConfigDelay(Attribute.ReloadSound, GlobalPosition, Attribute.ReloadSoundDelayTime, TriggerRole);
}
}
}
@@ -1297,9 +1299,7 @@
{
if (Attribute.ReloadFinishSound != null)
{
- var volume = SoundManager.CalcRoleVolume(Attribute.ReloadFinishSound.Volume, Master);
- var position = GameApplication.Instance.ViewToGlobalPosition(GlobalPosition);
- SoundManager.PlaySoundEffectPosition(Attribute.ReloadFinishSound.Path, position, volume);
+ SoundManager.PlaySoundByConfig(Attribute.ReloadFinishSound, GlobalPosition, TriggerRole);
}
}
@@ -1308,9 +1308,7 @@
{
if (Attribute.ShootSound != null)
{
- var volume = SoundManager.CalcRoleVolume(Attribute.ShootSound.Volume, Master);
- var position = GameApplication.Instance.ViewToGlobalPosition(GlobalPosition);
- SoundManager.PlaySoundEffectPosition(Attribute.ShootSound.Path, position, volume);
+ SoundManager.PlaySoundByConfig(Attribute.ShootSound, GlobalPosition, TriggerRole);
}
}
@@ -1319,15 +1317,13 @@
{
if (Attribute.BeLoadedSound != null)
{
- var position = GameApplication.Instance.ViewToGlobalPosition(GlobalPosition);
- var volume = SoundManager.CalcRoleVolume(Attribute.BeLoadedSound.Volume, Master);
if (Attribute.BeLoadedSoundDelayTime <= 0)
{
- SoundManager.PlaySoundEffectPosition(Attribute.BeLoadedSound.Path, position, volume);
+ SoundManager.PlaySoundByConfig(Attribute.BeLoadedSound, GlobalPosition, TriggerRole);
}
else
{
- SoundManager.PlaySoundEffectPositionDelay(Attribute.BeLoadedSound.Path, position, Attribute.BeLoadedSoundDelayTime, volume);
+ SoundManager.PlaySoundByConfigDelay(Attribute.BeLoadedSound, GlobalPosition, Attribute.BeLoadedSoundDelayTime, TriggerRole);
}
}
}
@@ -1392,7 +1388,7 @@
PlayReloadSound();
//抛出弹壳
- if (Attribute.ReloadThrowShell)
+ if (Attribute.ReloadThrowShell && !_reloadShellFlag)
{
ThrowShellHandler(0.6f);
}
@@ -1472,10 +1468,15 @@
//创建一个弹壳
if (Attribute.ThrowShellDelayTime > 0)
{
- this.CallDelay(Attribute.ThrowShellDelayTime, () => ThrowShell(Attribute.Shell, speedScale));
+ this.CallDelay(Attribute.ThrowShellDelayTime, () =>
+ {
+ _reloadShellFlag = true;
+ ThrowShell(Attribute.Shell, speedScale);
+ });
}
else if (Attribute.ThrowShellDelayTime == 0)
{
+ _reloadShellFlag = true;
ThrowShell(Attribute.Shell, speedScale);
}
}
diff --git a/DungeonShooting_Godot/src/game/manager/SoundManager.cs b/DungeonShooting_Godot/src/game/manager/SoundManager.cs
index 679cb32..2195543 100644
--- a/DungeonShooting_Godot/src/game/manager/SoundManager.cs
+++ b/DungeonShooting_Godot/src/game/manager/SoundManager.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
+using Config;
using Godot;
///
@@ -190,6 +191,63 @@
soundNode.PlaySoundByResource(soundName, delayTime);
return soundNode;
}
+
+ ///
+ /// 根据音效配置表Id播放音效
+ ///
+ /// 音效Id
+ /// 播放音效的位置, 该位置为 SubViewport 下的坐标, 也就是 使用的坐标
+ /// 触发播放音效的角色, 因为 Npc 产生的音效声音更小, 可以传 null
+ public static GameAudioPlayer2D PlaySoundByConfig(string id, Vector2 viewPosition, Role triggerRole = null)
+ {
+ var sound = ExcelConfig.Sound_Map[id];
+ return PlaySoundByConfig(sound, viewPosition, triggerRole);
+ }
+
+ ///
+ /// 根据音效配置播放音效
+ ///
+ /// 音效数据
+ /// 播放音效的位置, 该位置为 SubViewport 下的坐标, 也就是 使用的坐标
+ /// 触发播放音效的角色, 因为 Npc 产生的音效声音更小, 可以传 null
+ public static GameAudioPlayer2D PlaySoundByConfig(ExcelConfig.Sound sound, Vector2 viewPosition, Role triggerRole = null)
+ {
+ return PlaySoundEffectPosition(
+ sound.Path,
+ GameApplication.Instance.ViewToGlobalPosition(viewPosition),
+ CalcRoleVolume(sound.Volume, triggerRole)
+ );
+ }
+
+ ///
+ /// 根据音效配置表Id延时播放音效
+ ///
+ /// 音效Id
+ /// 播放音效的位置, 该位置为 SubViewport 下的坐标, 也就是 使用的坐标
+ /// 延时时间
+ /// 触发播放音效的角色, 因为 Npc 产生的音效声音更小, 可以传 null
+ public static GameAudioPlayer2D PlaySoundByConfigDelay(string id, Vector2 viewPosition, float delayTime, Role triggerRole = null)
+ {
+ var sound = ExcelConfig.Sound_Map[id];
+ return PlaySoundByConfigDelay(sound, viewPosition, delayTime, triggerRole);
+ }
+
+ ///
+ /// 根据音效配置延时播放音效
+ ///
+ /// 音效数据
+ /// 播放音效的位置, 该位置为 SubViewport 下的坐标, 也就是 使用的坐标
+ /// 延时时间
+ /// 触发播放音效的角色, 因为 Npc 产生的音效声音更小, 可以传 null
+ public static GameAudioPlayer2D PlaySoundByConfigDelay(ExcelConfig.Sound sound, Vector2 viewPosition, float delayTime, Role triggerRole = null)
+ {
+ return PlaySoundEffectPositionDelay(
+ sound.Path,
+ GameApplication.Instance.ViewToGlobalPosition(viewPosition),
+ delayTime,
+ CalcRoleVolume(sound.Volume, triggerRole)
+ );
+ }
///
/// 获取2D音频播放节点