diff --git a/DungeonShooting_Godot/excel/excelFile/ActivityObject.xlsx b/DungeonShooting_Godot/excel/excelFile/ActivityObject.xlsx
index 9ded34d..24e11a1 100644
--- a/DungeonShooting_Godot/excel/excelFile/ActivityObject.xlsx
+++ b/DungeonShooting_Godot/excel/excelFile/ActivityObject.xlsx
Binary files differ
diff --git a/DungeonShooting_Godot/excel/excelFile/Sound.xlsx b/DungeonShooting_Godot/excel/excelFile/Sound.xlsx
index 821da04..6679fea 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/Weapon.xlsx b/DungeonShooting_Godot/excel/excelFile/Weapon.xlsx
index d0be38d..a2bd8f8 100644
--- a/DungeonShooting_Godot/excel/excelFile/Weapon.xlsx
+++ b/DungeonShooting_Godot/excel/excelFile/Weapon.xlsx
Binary files differ
diff --git a/DungeonShooting_Godot/resource/config/Sound.json b/DungeonShooting_Godot/resource/config/Sound.json
index a0d83c3..0dd2fff 100644
--- a/DungeonShooting_Godot/resource/config/Sound.json
+++ b/DungeonShooting_Godot/resource/config/Sound.json
@@ -30,6 +30,18 @@
"Remark": "\u9730\u5F39\u67AA\u5355\u72EC\u88C5\u5F39"
},
{
+ "Id": "reloadBegin0002",
+ "Path": "res://resource/sound/sfx/Reloading_begin0002.ogg",
+ "Volume": 1,
+ "Remark": "\u9730\u5F39\u67AA"
+ },
+ {
+ "Id": "reloadFinish0002",
+ "Path": "res://resource/sound/sfx/Reloading_finish0002.ogg",
+ "Volume": 1,
+ "Remark": "\u9730\u5F39\u67AA"
+ },
+ {
"Id": "equip0001",
"Path": "res://resource/sound/sfx/Equip0001.ogg",
"Volume": 1,
diff --git a/DungeonShooting_Godot/resource/config/Weapon.json b/DungeonShooting_Godot/resource/config/Weapon.json
index 1890c66..9d5b78e 100644
--- a/DungeonShooting_Godot/resource/config/Weapon.json
+++ b/DungeonShooting_Godot/resource/config/Weapon.json
@@ -13,8 +13,8 @@
"ReloadTime": 2,
"AloneReload": false,
"AloneReloadCount": 1,
- "AutoReloadBeginIntervalTime": 0,
- "AutoReloadFinishIntervalTime": 0,
+ "AloneReloadBeginIntervalTime": 0,
+ "AloneReloadFinishIntervalTime": 0,
"AloneReloadCanShoot": false,
"LooseShoot": false,
"MinChargeTime": 0,
@@ -50,9 +50,9 @@
"__BeginReloadSound": "",
"BeginReloadSoundDelayTime": 0,
"__ReloadSound": "",
- "__ReloadFinishSound": "",
- "ReloadFinishSoundDelayTime": 0,
"ReloadSoundDelayTime": 0,
+ "__ReloadFinishSound": "",
+ "ReloadFinishSoundAdvanceTime": 0,
"__EquipSound": "",
"EquipSoundDelayTime": 0,
"__OtherSoundMap": null,
@@ -75,8 +75,8 @@
"ReloadTime": 2,
"AloneReload": false,
"AloneReloadCount": 1,
- "AutoReloadBeginIntervalTime": 0,
- "AutoReloadFinishIntervalTime": 0,
+ "AloneReloadBeginIntervalTime": 0,
+ "AloneReloadFinishIntervalTime": 0,
"AloneReloadCanShoot": false,
"LooseShoot": false,
"MinChargeTime": 0,
@@ -112,9 +112,9 @@
"__BeginReloadSound": "",
"BeginReloadSoundDelayTime": 0,
"__ReloadSound": "",
- "__ReloadFinishSound": "",
- "ReloadFinishSoundDelayTime": 0,
"ReloadSoundDelayTime": 0,
+ "__ReloadFinishSound": "",
+ "ReloadFinishSoundAdvanceTime": 0,
"__EquipSound": "",
"EquipSoundDelayTime": 0,
"__OtherSoundMap": null,
@@ -137,8 +137,8 @@
"ReloadTime": 0.4,
"AloneReload": true,
"AloneReloadCount": 1,
- "AutoReloadBeginIntervalTime": 0,
- "AutoReloadFinishIntervalTime": 0,
+ "AloneReloadBeginIntervalTime": 0.6,
+ "AloneReloadFinishIntervalTime": 0.6,
"AloneReloadCanShoot": true,
"LooseShoot": false,
"MinChargeTime": 0,
@@ -171,12 +171,12 @@
"Y": 15
},
"__ShootSound": "shooting0003",
- "__BeginReloadSound": "",
+ "__BeginReloadSound": "reloadBegin0002",
"BeginReloadSoundDelayTime": 0,
"__ReloadSound": "reloading0002",
- "__ReloadFinishSound": "",
- "ReloadFinishSoundDelayTime": 0,
"ReloadSoundDelayTime": 0,
+ "__ReloadFinishSound": "reloadFinish0002",
+ "ReloadFinishSoundAdvanceTime": 0.3,
"__EquipSound": "equip0005",
"EquipSoundDelayTime": 0.4,
"__OtherSoundMap": null,
@@ -199,8 +199,8 @@
"ReloadTime": 0.4,
"AloneReload": true,
"AloneReloadCount": 1,
- "AutoReloadBeginIntervalTime": 0,
- "AutoReloadFinishIntervalTime": 0,
+ "AloneReloadBeginIntervalTime": 0.6,
+ "AloneReloadFinishIntervalTime": 0.6,
"AloneReloadCanShoot": true,
"LooseShoot": false,
"MinChargeTime": 0,
@@ -233,12 +233,12 @@
"Y": 15
},
"__ShootSound": "shooting0003",
- "__BeginReloadSound": "",
+ "__BeginReloadSound": "reloadBegin0002",
"BeginReloadSoundDelayTime": 0,
"__ReloadSound": "reloading0002",
- "__ReloadFinishSound": "",
- "ReloadFinishSoundDelayTime": 0,
"ReloadSoundDelayTime": 0,
+ "__ReloadFinishSound": "reloadFinish0002",
+ "ReloadFinishSoundAdvanceTime": 0.3,
"__EquipSound": "equip0005",
"EquipSoundDelayTime": 0.4,
"__OtherSoundMap": null,
@@ -261,8 +261,8 @@
"ReloadTime": 1.5,
"AloneReload": false,
"AloneReloadCount": 1,
- "AutoReloadBeginIntervalTime": 0,
- "AutoReloadFinishIntervalTime": 0,
+ "AloneReloadBeginIntervalTime": 0,
+ "AloneReloadFinishIntervalTime": 0,
"AloneReloadCanShoot": false,
"LooseShoot": false,
"MinChargeTime": 0,
@@ -298,9 +298,9 @@
"__BeginReloadSound": "reloading0001",
"BeginReloadSoundDelayTime": 0.3,
"__ReloadSound": "",
- "__ReloadFinishSound": "",
- "ReloadFinishSoundDelayTime": 0,
"ReloadSoundDelayTime": 0,
+ "__ReloadFinishSound": "",
+ "ReloadFinishSoundAdvanceTime": 0,
"__EquipSound": "",
"EquipSoundDelayTime": 0,
"__OtherSoundMap": null,
@@ -323,8 +323,8 @@
"ReloadTime": 1.5,
"AloneReload": false,
"AloneReloadCount": 1,
- "AutoReloadBeginIntervalTime": 0,
- "AutoReloadFinishIntervalTime": 0,
+ "AloneReloadBeginIntervalTime": 0,
+ "AloneReloadFinishIntervalTime": 0,
"AloneReloadCanShoot": false,
"LooseShoot": false,
"MinChargeTime": 0,
@@ -360,9 +360,9 @@
"__BeginReloadSound": "reloading0001",
"BeginReloadSoundDelayTime": 0.3,
"__ReloadSound": "",
- "__ReloadFinishSound": "",
- "ReloadFinishSoundDelayTime": 0,
"ReloadSoundDelayTime": 0,
+ "__ReloadFinishSound": "",
+ "ReloadFinishSoundAdvanceTime": 0,
"__EquipSound": "",
"EquipSoundDelayTime": 0,
"__OtherSoundMap": null,
@@ -385,8 +385,8 @@
"ReloadTime": 2,
"AloneReload": false,
"AloneReloadCount": 1,
- "AutoReloadBeginIntervalTime": 0,
- "AutoReloadFinishIntervalTime": 0,
+ "AloneReloadBeginIntervalTime": 0,
+ "AloneReloadFinishIntervalTime": 0,
"AloneReloadCanShoot": false,
"LooseShoot": true,
"MinChargeTime": 0,
@@ -422,9 +422,9 @@
"__BeginReloadSound": "",
"BeginReloadSoundDelayTime": 0,
"__ReloadSound": "",
- "__ReloadFinishSound": "",
- "ReloadFinishSoundDelayTime": 0,
"ReloadSoundDelayTime": 0,
+ "__ReloadFinishSound": "",
+ "ReloadFinishSoundAdvanceTime": 0,
"__EquipSound": "",
"EquipSoundDelayTime": 0,
"__OtherSoundMap": null,
@@ -447,8 +447,8 @@
"ReloadTime": 2,
"AloneReload": false,
"AloneReloadCount": 1,
- "AutoReloadBeginIntervalTime": 0,
- "AutoReloadFinishIntervalTime": 0,
+ "AloneReloadBeginIntervalTime": 0,
+ "AloneReloadFinishIntervalTime": 0,
"AloneReloadCanShoot": false,
"LooseShoot": true,
"MinChargeTime": 0,
@@ -484,9 +484,9 @@
"__BeginReloadSound": "",
"BeginReloadSoundDelayTime": 0,
"__ReloadSound": "",
- "__ReloadFinishSound": "",
- "ReloadFinishSoundDelayTime": 0,
"ReloadSoundDelayTime": 0,
+ "__ReloadFinishSound": "",
+ "ReloadFinishSoundAdvanceTime": 0,
"__EquipSound": "",
"EquipSoundDelayTime": 0,
"__OtherSoundMap": null,
@@ -509,8 +509,8 @@
"ReloadTime": 2.5,
"AloneReload": false,
"AloneReloadCount": 1,
- "AutoReloadBeginIntervalTime": 0,
- "AutoReloadFinishIntervalTime": 0,
+ "AloneReloadBeginIntervalTime": 0,
+ "AloneReloadFinishIntervalTime": 0,
"AloneReloadCanShoot": false,
"LooseShoot": false,
"MinChargeTime": 0,
@@ -546,9 +546,9 @@
"__BeginReloadSound": "",
"BeginReloadSoundDelayTime": 0,
"__ReloadSound": "",
- "__ReloadFinishSound": "",
- "ReloadFinishSoundDelayTime": 0,
"ReloadSoundDelayTime": 1.2,
+ "__ReloadFinishSound": "",
+ "ReloadFinishSoundAdvanceTime": 0,
"__EquipSound": "",
"EquipSoundDelayTime": 0.7,
"__OtherSoundMap": null,
diff --git a/DungeonShooting_Godot/resource/sound/sfx/Reloading_begin0002.ogg b/DungeonShooting_Godot/resource/sound/sfx/Reloading_begin0002.ogg
new file mode 100644
index 0000000..4a62dd2
--- /dev/null
+++ b/DungeonShooting_Godot/resource/sound/sfx/Reloading_begin0002.ogg
Binary files differ
diff --git a/DungeonShooting_Godot/resource/sound/sfx/Reloading_begin0002.ogg.import b/DungeonShooting_Godot/resource/sound/sfx/Reloading_begin0002.ogg.import
new file mode 100644
index 0000000..87870eb
--- /dev/null
+++ b/DungeonShooting_Godot/resource/sound/sfx/Reloading_begin0002.ogg.import
@@ -0,0 +1,19 @@
+[remap]
+
+importer="oggvorbisstr"
+type="AudioStreamOggVorbis"
+uid="uid://c6ab4vp7bexl7"
+path="res://.godot/imported/Reloading_begin0002.ogg-4b4a29283a1ac5b7a0e46beefca82e64.oggvorbisstr"
+
+[deps]
+
+source_file="res://resource/sound/sfx/Reloading_begin0002.ogg"
+dest_files=["res://.godot/imported/Reloading_begin0002.ogg-4b4a29283a1ac5b7a0e46beefca82e64.oggvorbisstr"]
+
+[params]
+
+loop=false
+loop_offset=0
+bpm=0
+beat_count=0
+bar_beats=4
diff --git a/DungeonShooting_Godot/resource/sound/sfx/Reloading_finish0002.ogg b/DungeonShooting_Godot/resource/sound/sfx/Reloading_finish0002.ogg
new file mode 100644
index 0000000..21fb101
--- /dev/null
+++ b/DungeonShooting_Godot/resource/sound/sfx/Reloading_finish0002.ogg
Binary files differ
diff --git a/DungeonShooting_Godot/resource/sound/sfx/Reloading_finish0002.ogg.import b/DungeonShooting_Godot/resource/sound/sfx/Reloading_finish0002.ogg.import
new file mode 100644
index 0000000..39e715a
--- /dev/null
+++ b/DungeonShooting_Godot/resource/sound/sfx/Reloading_finish0002.ogg.import
@@ -0,0 +1,19 @@
+[remap]
+
+importer="oggvorbisstr"
+type="AudioStreamOggVorbis"
+uid="uid://kcye7mqil5g"
+path="res://.godot/imported/Reloading_finish0002.ogg-d313924afb2617cd2ca2a5073e102977.oggvorbisstr"
+
+[deps]
+
+source_file="res://resource/sound/sfx/Reloading_finish0002.ogg"
+dest_files=["res://.godot/imported/Reloading_finish0002.ogg-d313924afb2617cd2ca2a5073e102977.oggvorbisstr"]
+
+[params]
+
+loop=false
+loop_offset=0
+bpm=0
+beat_count=0
+bar_beats=4
diff --git a/DungeonShooting_Godot/resource/theme/mainTheme.tres b/DungeonShooting_Godot/resource/theme/mainTheme.tres
index 0565adb..42c5113 100644
--- a/DungeonShooting_Godot/resource/theme/mainTheme.tres
+++ b/DungeonShooting_Godot/resource/theme/mainTheme.tres
@@ -352,7 +352,7 @@
[sub_resource type="ImageTexture" id="58"]
-[sub_resource type="Image" id="Image_xf524"]
+[sub_resource type="Image" id="Image_flhyv"]
data = {
"data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 1, 255, 255, 255, 39, 255, 255, 255, 67, 255, 255, 255, 67, 255, 255, 255, 39, 255, 255, 255, 1, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 39, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 39, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 66, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 66, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 66, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 66, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 39, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 39, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 1, 255, 255, 255, 39, 255, 255, 255, 67, 255, 255, 255, 67, 255, 255, 255, 39, 255, 255, 255, 1, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
"format": "RGBA8",
@@ -362,7 +362,7 @@
}
[sub_resource type="ImageTexture" id="60"]
-image = SubResource("Image_xf524")
+image = SubResource("Image_flhyv")
[sub_resource type="StyleBoxTexture" id="61"]
content_margin_left = 2.0
@@ -372,7 +372,7 @@
texture = SubResource("60")
region_rect = Rect2(0, 0, 12, 12)
-[sub_resource type="Image" id="Image_s5lkb"]
+[sub_resource type="Image" id="Image_raohe"]
data = {
"data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 191, 191, 191, 0, 247, 247, 247, 0, 248, 248, 248, 0, 248, 248, 248, 0, 247, 247, 247, 0, 191, 191, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 191, 191, 191, 0, 191, 191, 191, 4, 247, 247, 247, 98, 248, 248, 248, 167, 248, 248, 248, 167, 247, 247, 247, 98, 191, 191, 191, 4, 191, 191, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 247, 247, 247, 0, 247, 247, 247, 97, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 247, 247, 247, 97, 247, 247, 247, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 248, 248, 248, 0, 248, 248, 248, 164, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 164, 248, 248, 248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 248, 248, 248, 0, 248, 248, 248, 164, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 164, 248, 248, 248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 247, 247, 247, 0, 247, 247, 247, 97, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 247, 247, 247, 97, 247, 247, 247, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 191, 191, 191, 0, 191, 191, 191, 4, 247, 247, 247, 98, 248, 248, 248, 167, 248, 248, 248, 167, 247, 247, 247, 98, 191, 191, 191, 4, 191, 191, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 191, 191, 191, 0, 247, 247, 247, 0, 248, 248, 248, 0, 248, 248, 248, 0, 247, 247, 247, 0, 191, 191, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
"format": "RGBA8",
@@ -382,7 +382,7 @@
}
[sub_resource type="ImageTexture" id="63"]
-image = SubResource("Image_s5lkb")
+image = SubResource("Image_raohe")
[sub_resource type="StyleBoxTexture" id="64"]
content_margin_left = 2.0
@@ -392,7 +392,7 @@
texture = SubResource("63")
region_rect = Rect2(0, 0, 12, 12)
-[sub_resource type="Image" id="Image_5l5qw"]
+[sub_resource type="Image" id="Image_ccid8"]
data = {
"data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 127, 127, 0, 173, 173, 173, 0, 173, 173, 173, 0, 173, 173, 173, 0, 173, 173, 173, 0, 127, 127, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 127, 127, 0, 127, 127, 127, 4, 173, 173, 173, 97, 173, 173, 173, 166, 173, 173, 173, 166, 173, 173, 173, 97, 127, 127, 127, 4, 127, 127, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 172, 172, 172, 0, 172, 172, 172, 96, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 172, 172, 172, 96, 172, 172, 172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 173, 173, 173, 0, 173, 173, 173, 163, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 163, 173, 173, 173, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 173, 173, 173, 0, 173, 173, 173, 163, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 163, 173, 173, 173, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 172, 172, 172, 0, 172, 172, 172, 96, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 172, 172, 172, 96, 172, 172, 172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 127, 127, 0, 127, 127, 127, 4, 173, 173, 173, 97, 173, 173, 173, 166, 173, 173, 173, 166, 173, 173, 173, 97, 127, 127, 127, 4, 127, 127, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 127, 127, 0, 173, 173, 173, 0, 173, 173, 173, 0, 173, 173, 173, 0, 173, 173, 173, 0, 127, 127, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
"format": "RGBA8",
@@ -402,7 +402,7 @@
}
[sub_resource type="ImageTexture" id="66"]
-image = SubResource("Image_5l5qw")
+image = SubResource("Image_ccid8")
[sub_resource type="StyleBoxTexture" id="67"]
content_margin_left = 2.0
@@ -412,7 +412,7 @@
texture = SubResource("66")
region_rect = Rect2(0, 0, 12, 12)
-[sub_resource type="Image" id="Image_sv68y"]
+[sub_resource type="Image" id="Image_vvate"]
data = {
"data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 4, 255, 255, 255, 16, 255, 255, 255, 16, 255, 255, 255, 4, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 16, 255, 255, 255, 21, 255, 255, 255, 21, 255, 255, 255, 16, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 16, 255, 255, 255, 21, 255, 255, 255, 21, 255, 255, 255, 16, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 4, 255, 255, 255, 16, 255, 255, 255, 16, 255, 255, 255, 4, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
"format": "RGBA8",
@@ -422,7 +422,7 @@
}
[sub_resource type="ImageTexture" id="69"]
-image = SubResource("Image_sv68y")
+image = SubResource("Image_vvate")
[sub_resource type="StyleBoxTexture" id="70"]
content_margin_left = 0.0
@@ -446,7 +446,7 @@
content_margin_right = 4.0
content_margin_bottom = 4.0
-[sub_resource type="Image" id="Image_smoam"]
+[sub_resource type="Image" id="Image_pxi6j"]
data = {
"data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 76, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 76, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 76, 255, 255, 255, 228, 255, 255, 255, 188, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 188, 255, 255, 255, 228, 255, 255, 255, 76, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 18, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 187, 255, 255, 255, 17, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 187, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 18, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 185, 255, 255, 255, 17, 255, 255, 255, 17, 255, 255, 255, 186, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 190, 255, 255, 255, 229, 255, 255, 255, 185, 255, 255, 255, 185, 255, 255, 255, 229, 255, 255, 255, 189, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 191, 255, 255, 255, 229, 255, 255, 255, 229, 255, 255, 255, 190, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 187, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 187, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 18, 255, 255, 255, 19, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 186, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 185, 255, 255, 255, 229, 255, 255, 255, 189, 255, 255, 255, 19, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 189, 255, 255, 255, 229, 255, 255, 255, 185, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 76, 255, 255, 255, 229, 255, 255, 255, 190, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 190, 255, 255, 255, 229, 255, 255, 255, 76, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 77, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 77, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
"format": "RGBA8",
@@ -456,7 +456,7 @@
}
[sub_resource type="ImageTexture" id="56"]
-image = SubResource("Image_smoam")
+image = SubResource("Image_pxi6j")
[sub_resource type="StyleBoxFlat" id="57"]
content_margin_left = 6.0
diff --git a/DungeonShooting_Godot/src/config/ExcelConfig_Weapon.cs b/DungeonShooting_Godot/src/config/ExcelConfig_Weapon.cs
index b071501..ac16ffc 100644
--- a/DungeonShooting_Godot/src/config/ExcelConfig_Weapon.cs
+++ b/DungeonShooting_Godot/src/config/ExcelConfig_Weapon.cs
@@ -92,13 +92,13 @@
/// 单独装弹模式下,从触发装弹到开始装第一发子弹中间的间隔时间, 必须要将 'AloneReload' 属性设置为 true
///
[JsonInclude]
- public float AutoReloadBeginIntervalTime;
+ public float AloneReloadBeginIntervalTime;
///
/// 单独装弹模式下,从装完最后一发子弹到可以射击中间的间隔时间, 必须要将 'AloneReload' 属性设置为 true
///
[JsonInclude]
- public float AutoReloadFinishIntervalTime;
+ public float AloneReloadFinishIntervalTime;
///
/// 单独装填的子弹时可以立即射击, 必须要将 'AloneReload' 属性设置为 true
@@ -290,21 +290,22 @@
public Sound ReloadSound;
///
+ /// 换弹音效延时时间
+ ///
+ [JsonInclude]
+ public float ReloadSoundDelayTime;
+
+ ///
/// 换弹结束音效
///
public Sound ReloadFinishSound;
///
- /// 换弹结束音效延时
+ /// 换弹结束音效在换弹结束前多久开始
+ /// 注意: 如果'AloneReload'为true, 那么当前属性的值应该小于'AloneReloadFinishIntervalTime'
///
[JsonInclude]
- public float ReloadFinishSoundDelayTime;
-
- ///
- /// 换弹音效延时时间
- ///
- [JsonInclude]
- public float ReloadSoundDelayTime;
+ public float ReloadFinishSoundAdvanceTime;
///
/// 上膛音效
@@ -369,8 +370,8 @@
inst.ReloadTime = ReloadTime;
inst.AloneReload = AloneReload;
inst.AloneReloadCount = AloneReloadCount;
- inst.AutoReloadBeginIntervalTime = AutoReloadBeginIntervalTime;
- inst.AutoReloadFinishIntervalTime = AutoReloadFinishIntervalTime;
+ inst.AloneReloadBeginIntervalTime = AloneReloadBeginIntervalTime;
+ inst.AloneReloadFinishIntervalTime = AloneReloadFinishIntervalTime;
inst.AloneReloadCanShoot = AloneReloadCanShoot;
inst.LooseShoot = LooseShoot;
inst.MinChargeTime = MinChargeTime;
@@ -403,9 +404,9 @@
inst.BeginReloadSound = BeginReloadSound;
inst.BeginReloadSoundDelayTime = BeginReloadSoundDelayTime;
inst.ReloadSound = ReloadSound;
- inst.ReloadFinishSound = ReloadFinishSound;
- inst.ReloadFinishSoundDelayTime = ReloadFinishSoundDelayTime;
inst.ReloadSoundDelayTime = ReloadSoundDelayTime;
+ inst.ReloadFinishSound = ReloadFinishSound;
+ inst.ReloadFinishSoundAdvanceTime = ReloadFinishSoundAdvanceTime;
inst.EquipSound = EquipSound;
inst.EquipSoundDelayTime = EquipSoundDelayTime;
inst.OtherSoundMap = OtherSoundMap;
diff --git a/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs b/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs
index 10bfd07..87cd398 100644
--- a/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs
+++ b/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs
@@ -71,24 +71,40 @@
public bool Reloading { get; private set; } = false;
///
- /// 换弹计时器
- ///
- public float ReloadTimer { get; private set; } = 0;
-
- ///
- /// 换弹进度 (0 - 1)
+ /// 换弹进度 (从 0 到 1)
///
public float ReloadProgress
{
get
{
- if (Attribute.AloneReload)
+ if (!Reloading)
{
- var num = 1f / Attribute.AmmoCapacity;
- return num * (Attribute.AmmoCapacity - CurrAmmo - 1) + num * (ReloadTimer / Attribute.ReloadTime);
+ return 1;
}
- return ReloadTimer / Attribute.ReloadTime;
+ if (Attribute.AloneReload)
+ {
+ //总时间
+ var total = Attribute.AloneReloadBeginIntervalTime + (Attribute.ReloadTime * Attribute.AmmoCapacity) + Attribute.AloneReloadFinishIntervalTime;
+ //当前时间
+ float current;
+ if (_aloneReloadState == 1)
+ {
+ current = (Attribute.AloneReloadBeginIntervalTime - _reloadTimer) + Attribute.ReloadTime * CurrAmmo;
+ }
+ else if (_aloneReloadState == 2)
+ {
+ current = Attribute.AloneReloadBeginIntervalTime + (Attribute.ReloadTime * (CurrAmmo + (1 - _reloadTimer / Attribute.ReloadTime)));
+ }
+ else
+ {
+ current = Attribute.AloneReloadBeginIntervalTime + (Attribute.ReloadTime * CurrAmmo) + (Attribute.AloneReloadFinishIntervalTime - _reloadTimer);
+ }
+
+ return current / total;
+ }
+
+ return 1 - _reloadTimer / Attribute.ReloadTime;
}
}
@@ -171,7 +187,19 @@
//临时存放动画精灵位置
private Vector2 _tempAnimatedSpritePosition;
+
+ //换弹计时器
+ private float _reloadTimer = 0;
+ //单独换弹设置下的换弹状态, 0: 未换弹, 1: 装第一颗子弹之前, 2: 单独装弹中, 3: 单独装弹完成
+ private byte _aloneReloadState = 0;
+
+ //本次换弹已用时间
+ private float _reloadUseTime = 0;
+
+ //是否播放过换弹完成音效
+ private bool _playReloadFinishSoundFlag = false;
+
// ----------------------------------------------
private uint _tempLayer;
@@ -383,8 +411,10 @@
if (_dirtyFlag)
{
_dirtyFlag = false;
+ _aloneReloadState = 0;
Reloading = false;
- ReloadTimer = 0;
+ _reloadTimer = 0;
+ _reloadUseTime = 0;
_attackFlag = false;
_continuousCount = 0;
_delayedTime = 0;
@@ -399,10 +429,84 @@
//换弹
if (Reloading)
{
- ReloadTimer -= delta;
- if (ReloadTimer <= 0)
+ //换弹用时
+ _reloadUseTime += delta;
+ _reloadTimer -= delta;
+
+ if (Attribute.AloneReload) //单独装弹模式
{
- ReloadSuccess();
+ switch (_aloneReloadState)
+ {
+ case 0:
+ GD.PrintErr("AloneReload状态错误!");
+ break;
+ case 1: //装第一颗子弹之前
+ {
+ if (_reloadTimer <= 0)
+ {
+ //开始装第一颗子弹
+ _aloneReloadState = 2;
+ ReloadHandler();
+ }
+ }
+ break;
+ case 2: //单独装弹中
+ {
+ if (_reloadTimer <= 0)
+ {
+ ReloadSuccess();
+ if (ResidueAmmo == 0 || CurrAmmo == Attribute.AmmoCapacity) //单独装弹完成
+ {
+ AloneReloadStateFinish();
+ if (Attribute.AloneReloadFinishIntervalTime <= 0)
+ {
+ //换弹完成
+ StopReloadState();
+ ReloadFinishHandler();
+ }
+ else
+ {
+ _reloadTimer = Attribute.AloneReloadFinishIntervalTime;
+ _aloneReloadState = 3;
+ }
+ }
+ }
+ }
+ break;
+ case 3: //单独装弹完成
+ {
+ //播放换弹完成音效
+ if (!_playReloadFinishSoundFlag && Attribute.ReloadFinishSound != null && _reloadTimer <= Attribute.ReloadFinishSoundAdvanceTime)
+ {
+ _playReloadFinishSoundFlag = true;
+ // GD.Print("播放换弹完成音效.");
+ PlayReloadFinishSound();
+ }
+
+ if (_reloadTimer <= 0)
+ {
+ //换弹完成
+ StopReloadState();
+ ReloadFinishHandler();
+ }
+ }
+ break;
+ }
+ }
+ else //普通换弹模式
+ {
+ //播放换弹完成音效
+ if (!_playReloadFinishSoundFlag && Attribute.ReloadFinishSound != null && _reloadTimer <= Attribute.ReloadFinishSoundAdvanceTime)
+ {
+ _playReloadFinishSoundFlag = true;
+ // GD.Print("播放换弹完成音效.");
+ PlayReloadFinishSound();
+ }
+
+ if (_reloadTimer <= 0)
+ {
+ ReloadSuccess();
+ }
}
}
@@ -539,14 +643,24 @@
var fireFlag = true; //是否能开火
if (Reloading) //换弹中
{
- if (CurrAmmo > 0 && Attribute.AloneReload && Attribute.AloneReloadCanShoot) //立即停止换弹
+ fireFlag = false;
+ if (CurrAmmo > 0 && Attribute.AloneReload && Attribute.AloneReloadCanShoot)
{
- Reloading = false;
- ReloadTimer = 0;
- }
- else
- {
- fireFlag = false;
+ //检查是否允许停止换弹
+ if (_aloneReloadState == 2 || _aloneReloadState == 1)
+ {
+ if (Attribute.AloneReloadFinishIntervalTime <= 0)
+ {
+ //换弹完成
+ StopReloadState();
+ ReloadFinishHandler();
+ }
+ else
+ {
+ _reloadTimer = Attribute.AloneReloadFinishIntervalTime;
+ _aloneReloadState = 3;
+ }
+ }
}
}
else if (CurrAmmo <= 0) //子弹不够
@@ -701,30 +815,15 @@
{
PlaySpriteAnimation(AnimatorNames.Fire);
}
-
- var position = GameApplication.Instance.ViewToGlobalPosition(GlobalPosition);
//播放射击音效
- if (Attribute.ShootSound != null)
- {
- SoundManager.PlaySoundEffectPosition(Attribute.ShootSound.Path, position, Attribute.ShootSound.Volume);
- }
+ PlayShootSound();
//触发开火函数
OnFire();
//播放上膛音效
- if (Attribute.EquipSound != null)
- {
- if (Attribute.EquipSoundDelayTime <= 0)
- {
- SoundManager.PlaySoundEffectPosition(Attribute.EquipSound.Path, position, Attribute.EquipSound.Volume);
- }
- else
- {
- SoundManager.PlaySoundEffectPositionDelay(Attribute.EquipSound.Path, position, Attribute.EquipSoundDelayTime, Attribute.EquipSound.Volume);
- }
- }
+ PlayEquipSound();
//开火发射的子弹数量
var bulletCount = Utils.RandomRangeInt(Attribute.MaxFireBulletCount, Attribute.MinFireBulletCount);
@@ -867,39 +966,48 @@
if (CurrAmmo < Attribute.AmmoCapacity && ResidueAmmo > 0 && !Reloading)
{
Reloading = true;
- ReloadTimer = Attribute.ReloadTime;
+ _playReloadFinishSoundFlag = false;
//播放开始换弹音效
- if (Attribute.BeginReloadSound != null)
- {
- var position = GameApplication.Instance.ViewToGlobalPosition(GlobalPosition);
- if (Attribute.BeginReloadSoundDelayTime <= 0)
- {
- SoundManager.PlaySoundEffectPosition(Attribute.BeginReloadSound.Path, position, Attribute.BeginReloadSound.Volume);
- }
- else
- {
- SoundManager.PlaySoundEffectPositionDelay(Attribute.BeginReloadSound.Path, position, Attribute.BeginReloadSoundDelayTime, Attribute.BeginReloadSound.Volume);
- }
- }
+ PlayBeginReloadSound();
+ // GD.Print("开始换弹.");
//第一次换弹
OnBeginReload();
- GD.Print("OnBeginReload.");
- //换弹处理
- ReloadHandler();
+
+ if (Attribute.AloneReload)
+ {
+ //单独换弹, 特殊处理
+ AloneReloadHandler();
+ }
+ else
+ {
+ //普通换弹处理
+ ReloadHandler();
+ }
}
}
- private void ReloadHandler()
+ //播放换弹开始音效
+ private void PlayBeginReloadSound()
{
- //播放换弹动画
- if (IsAutoPlaySpriteFrames)
+ if (Attribute.BeginReloadSound != null)
{
- PlaySpriteAnimation(AnimatorNames.Reload);
+ var position = GameApplication.Instance.ViewToGlobalPosition(GlobalPosition);
+ if (Attribute.BeginReloadSoundDelayTime <= 0)
+ {
+ SoundManager.PlaySoundEffectPosition(Attribute.BeginReloadSound.Path, position, Attribute.BeginReloadSound.Volume);
+ }
+ else
+ {
+ SoundManager.PlaySoundEffectPositionDelay(Attribute.BeginReloadSound.Path, position, Attribute.BeginReloadSoundDelayTime, Attribute.BeginReloadSound.Volume);
+ }
}
-
- //播放换弹音效
+ }
+
+ //播放换弹音效
+ private void PlayReloadSound()
+ {
if (Attribute.ReloadSound != null)
{
var position = GameApplication.Instance.ViewToGlobalPosition(GlobalPosition);
@@ -912,9 +1020,99 @@
SoundManager.PlaySoundEffectPositionDelay(Attribute.ReloadSound.Path, position, Attribute.ReloadSoundDelayTime, Attribute.ReloadSound.Volume);
}
}
+ }
+
+ //播放换弹完成音效
+ private void PlayReloadFinishSound()
+ {
+ if (Attribute.ReloadFinishSound != null)
+ {
+ var position = GameApplication.Instance.ViewToGlobalPosition(GlobalPosition);
+ SoundManager.PlaySoundEffectPosition(Attribute.ReloadFinishSound.Path, position, Attribute.ReloadFinishSound.Volume);
+ }
+ }
+
+ //播放射击音效
+ private void PlayShootSound()
+ {
+ if (Attribute.ShootSound != null)
+ {
+ var position = GameApplication.Instance.ViewToGlobalPosition(GlobalPosition);
+ SoundManager.PlaySoundEffectPosition(Attribute.ShootSound.Path, position, Attribute.ShootSound.Volume);
+ }
+ }
+
+ //播放上膛音效
+ private void PlayEquipSound()
+ {
+ if (Attribute.EquipSound != null)
+ {
+ var position = GameApplication.Instance.ViewToGlobalPosition(GlobalPosition);
+ if (Attribute.EquipSoundDelayTime <= 0)
+ {
+ SoundManager.PlaySoundEffectPosition(Attribute.EquipSound.Path, position, Attribute.EquipSound.Volume);
+ }
+ else
+ {
+ SoundManager.PlaySoundEffectPositionDelay(Attribute.EquipSound.Path, position, Attribute.EquipSoundDelayTime, Attribute.EquipSound.Volume);
+ }
+ }
+ }
+
+ //单独换弹处理
+ private void AloneReloadHandler()
+ {
+ if (Attribute.AloneReloadBeginIntervalTime <= 0)
+ {
+ //开始装第一颗子弹
+ _aloneReloadState = 2;
+ ReloadHandler();
+ }
+ else
+ {
+ _aloneReloadState = 1;
+ _reloadTimer = Attribute.AloneReloadBeginIntervalTime;
+ }
+ }
+
+ //换弹处理逻辑
+ private void ReloadHandler()
+ {
+ _reloadTimer = Attribute.ReloadTime;
+
+ //播放换弹动画
+ if (IsAutoPlaySpriteFrames)
+ {
+ PlaySpriteAnimation(AnimatorNames.Reload);
+ }
+
+ //播放换弹音效
+ PlayReloadSound();
OnReload();
- GD.Print("OnReload.");
+ // GD.Print("装弹.");
+ }
+
+ //换弹完成处理逻辑
+ private void ReloadFinishHandler()
+ {
+ // GD.Print("装弹完成.");
+ OnReloadFinish();
+ }
+
+ //单独装弹完成
+ private void AloneReloadStateFinish()
+ {
+ // GD.Print("单独装弹完成.");
+ }
+
+ //停止当前的换弹状态
+ private void StopReloadState()
+ {
+ _aloneReloadState = 0;
+ Reloading = false;
+ _reloadTimer = 0;
+ _reloadUseTime = 0;
}
///
@@ -953,15 +1151,8 @@
}
}
- if (ResidueAmmo == 0 || CurrAmmo == Attribute.AmmoCapacity) //换弹结束
+ if (ResidueAmmo != 0 && CurrAmmo != Attribute.AmmoCapacity) //继续装弹
{
- Reloading = false;
- ReloadTimer = 0;
- OnReloadFinish();
- }
- else //继续装弹
- {
- ReloadTimer = Attribute.ReloadTime;
ReloadHandler();
}
}
@@ -978,9 +1169,8 @@
ResidueAmmo = 0;
}
- Reloading = false;
- ReloadTimer = 0;
- OnReloadFinish();
+ StopReloadState();
+ ReloadFinishHandler();
}
}
@@ -1142,11 +1332,9 @@
startPosition -= GripPoint.Position.Rotated(rotation);
var startHeight = -master.MountPoint.Position.Y;
- var direction = Mathf.RadToDeg(rotation) + Utils.RandomRangeInt(-20, 20);
- var velocity = new Vector2(20, 0).Rotated(direction * Mathf.Pi / 180);
+ var velocity = new Vector2(20, 0).Rotated(rotation);
var yf = Utils.RandomRangeInt(50, 70);
- var rotate = Utils.RandomRangeInt(-60, 60);
- Throw(startPosition, startHeight, yf, velocity, rotate);
+ Throw(startPosition, startHeight, yf, velocity, 0);
}
protected override void OnThrowStart()
diff --git a/DungeonShooting_Godot/src/game/ui/roomUI/ReloadBar.cs b/DungeonShooting_Godot/src/game/ui/roomUI/ReloadBar.cs
index 5cbaf58..1292394 100644
--- a/DungeonShooting_Godot/src/game/ui/roomUI/ReloadBar.cs
+++ b/DungeonShooting_Godot/src/game/ui/roomUI/ReloadBar.cs
@@ -58,7 +58,7 @@
var player = Player.Current;
if (player.Holster.ActiveWeapon != null && player.Holster.ActiveWeapon.Reloading)
{
- ShowBar(player.GlobalPosition, 1 - player.Holster.ActiveWeapon.ReloadProgress);
+ ShowBar(player.GlobalPosition, player.Holster.ActiveWeapon.ReloadProgress);
}
else
{