diff --git a/DungeonShooting_Godot/excel/excelFile/ActivityObject.xlsx b/DungeonShooting_Godot/excel/excelFile/ActivityObject.xlsx index 3d87e7d..07dca8e 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 8564612..21fa3f2 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 e160783..f487c94 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 b72a46c..a0d83c3 100644 --- a/DungeonShooting_Godot/resource/config/Sound.json +++ b/DungeonShooting_Godot/resource/config/Sound.json @@ -2,37 +2,67 @@ { "Id": "shooting0001", "Path": "res://resource/sound/sfx/Shooting0001.ogg", - "Volume": 15, - "Remark": "" + "Volume": 1, + "Remark": "\u624B\u67AA" }, { "Id": "shooting0002", - "Path": "res://resource/sound/sfx/Shooting0001.ogg", - "Volume": 15, - "Remark": "" + "Path": "res://resource/sound/sfx/Shooting0002.mp3", + "Volume": 1, + "Remark": "\u6B65\u67AA(\u6D88\u97F3)" }, { "Id": "shooting0003", "Path": "res://resource/sound/sfx/Shooting0003.mp3", - "Volume": 0, - "Remark": "" + "Volume": 1, + "Remark": "\u9730\u5F39\u67AA" }, { "Id": "reloading0001", "Path": "res://resource/sound/sfx/Reloading0001.mp3", - "Volume": 0, - "Remark": "" + "Volume": 1, + "Remark": "\u624B\u67AA" }, { "Id": "reloading0002", "Path": "res://resource/sound/sfx/Reloading0002.ogg", - "Volume": 0, + "Volume": 1, + "Remark": "\u9730\u5F39\u67AA\u5355\u72EC\u88C5\u5F39" + }, + { + "Id": "equip0001", + "Path": "res://resource/sound/sfx/Equip0001.ogg", + "Volume": 1, "Remark": "" }, { - "Id": "reloading0004", - "Path": "res://resource/sound/sfx/Reloading0004.ogg", - "Volume": 0, + "Id": "equip0002", + "Path": "res://resource/sound/sfx/Equip0002.ogg", + "Volume": 1, "Remark": "" + }, + { + "Id": "equip0003", + "Path": "res://resource/sound/sfx/Equip0003.ogg", + "Volume": 1, + "Remark": "" + }, + { + "Id": "equip0004", + "Path": "res://resource/sound/sfx/Equip0004.ogg", + "Volume": 1, + "Remark": "\u9730\u5F39\u67AA" + }, + { + "Id": "equip0005", + "Path": "res://resource/sound/sfx/Equip0005.ogg", + "Volume": 1, + "Remark": "\u9730\u5F39\u67AA" + }, + { + "Id": "equip0006", + "Path": "res://resource/sound/sfx/Equip0006.ogg", + "Volume": 1, + "Remark": "\u9730\u5F39\u67AA" } ] \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/config/Weapon.json b/DungeonShooting_Godot/resource/config/Weapon.json index c12d1ce..15808a3 100644 --- a/DungeonShooting_Godot/resource/config/Weapon.json +++ b/DungeonShooting_Godot/resource/config/Weapon.json @@ -13,6 +13,8 @@ "ReloadTime": 2, "AloneReload": false, "AloneReloadCount": 1, + "AutoReloadBeginIntervalTime": 0, + "AutoReloadFinishIntervalTime": 0, "AloneReloadCanShoot": false, "LooseShoot": false, "MinChargeTime": 0, @@ -45,10 +47,15 @@ "Y": 15 }, "__ShootSound": "shooting0002", + "__BeginReloadSound": "", + "BeginReloadSoundDelayTime": 0, "__ReloadSound": "", + "__ReloadFinishSound": "", + "ReloadFinishSoundDelayTime": 0, "ReloadSoundDelayTime": 0, "__EquipSound": "", "EquipSoundDelayTime": 0, + "__OtherSoundMap": null, "AiUseAttributeId": "0002", "AiTargetLockingTime": 0, "AiBulletSpeedScale": 0, @@ -68,6 +75,8 @@ "ReloadTime": 2, "AloneReload": false, "AloneReloadCount": 1, + "AutoReloadBeginIntervalTime": 0, + "AutoReloadFinishIntervalTime": 0, "AloneReloadCanShoot": false, "LooseShoot": false, "MinChargeTime": 0, @@ -100,10 +109,15 @@ "Y": 15 }, "__ShootSound": "shooting0002", + "__BeginReloadSound": "", + "BeginReloadSoundDelayTime": 0, "__ReloadSound": "", + "__ReloadFinishSound": "", + "ReloadFinishSoundDelayTime": 0, "ReloadSoundDelayTime": 0, "__EquipSound": "", "EquipSoundDelayTime": 0, + "__OtherSoundMap": null, "AiUseAttributeId": "", "AiTargetLockingTime": 0.5, "AiBulletSpeedScale": 0.7, @@ -120,26 +134,28 @@ "AmmoCapacity": 7, "MaxAmmoCapacity": 42, "StandbyAmmoCapacity": 42, - "ReloadTime": 0.6, + "ReloadTime": 0.4, "AloneReload": true, "AloneReloadCount": 1, + "AutoReloadBeginIntervalTime": 0, + "AutoReloadFinishIntervalTime": 0, "AloneReloadCanShoot": true, "LooseShoot": false, "MinChargeTime": 0, "MinContinuousCount": 1, "MaxContinuousCount": 1, "TriggerInterval": 0, - "StartFiringSpeed": 400, - "FinalFiringSpeed": 400, + "StartFiringSpeed": 55, + "FinalFiringSpeed": 55, "FiringSpeedAddSpeed": 0, "FiringSpeedBackSpeed": 0, "MinFireBulletCount": 5, "MaxFireBulletCount": 5, "DelayedTime": 0, "StartScatteringRange": 30, - "FinalScatteringRange": 90, - "ScatteringRangeAddValue": 50, - "ScatteringRangeBackSpeed": 50, + "FinalScatteringRange": 60, + "ScatteringRangeAddValue": 20, + "ScatteringRangeBackSpeed": 40, "ScatteringRangeBackTime": 0.5, "MinDistance": 200, "MaxDistance": 250, @@ -148,17 +164,22 @@ "BacklashRegressionSpeed": 35, "UpliftAngle": 15, "DefaultAngle": 0, - "UpliftAngleRestore": 1, + "UpliftAngleRestore": 2.5, "BulletId": "bullet0002", "ThrowCollisionSize": { "X": 20, "Y": 15 }, "__ShootSound": "shooting0003", - "__ReloadSound": "", + "__BeginReloadSound": "", + "BeginReloadSoundDelayTime": 0, + "__ReloadSound": "reloading0002", + "__ReloadFinishSound": "", + "ReloadFinishSoundDelayTime": 0, "ReloadSoundDelayTime": 0, - "__EquipSound": "", - "EquipSoundDelayTime": 0, + "__EquipSound": "equip0005", + "EquipSoundDelayTime": 0.4, + "__OtherSoundMap": null, "AiUseAttributeId": "0004", "AiTargetLockingTime": 0, "AiBulletSpeedScale": 0, @@ -175,26 +196,28 @@ "AmmoCapacity": 7, "MaxAmmoCapacity": 42, "StandbyAmmoCapacity": 42, - "ReloadTime": 0.6, + "ReloadTime": 0.4, "AloneReload": true, "AloneReloadCount": 1, + "AutoReloadBeginIntervalTime": 0, + "AutoReloadFinishIntervalTime": 0, "AloneReloadCanShoot": true, "LooseShoot": false, "MinChargeTime": 0, "MinContinuousCount": 1, "MaxContinuousCount": 1, "TriggerInterval": 3.5, - "StartFiringSpeed": 400, - "FinalFiringSpeed": 400, + "StartFiringSpeed": 55, + "FinalFiringSpeed": 55, "FiringSpeedAddSpeed": 0, "FiringSpeedBackSpeed": 0, "MinFireBulletCount": 5, "MaxFireBulletCount": 5, "DelayedTime": 0, "StartScatteringRange": 30, - "FinalScatteringRange": 90, - "ScatteringRangeAddValue": 50, - "ScatteringRangeBackSpeed": 50, + "FinalScatteringRange": 60, + "ScatteringRangeAddValue": 20, + "ScatteringRangeBackSpeed": 40, "ScatteringRangeBackTime": 0.5, "MinDistance": 200, "MaxDistance": 250, @@ -203,17 +226,22 @@ "BacklashRegressionSpeed": 35, "UpliftAngle": 15, "DefaultAngle": 0, - "UpliftAngleRestore": 1, + "UpliftAngleRestore": 2.5, "BulletId": "bullet0002", "ThrowCollisionSize": { "X": 20, "Y": 15 }, "__ShootSound": "shooting0003", - "__ReloadSound": "", + "__BeginReloadSound": "", + "BeginReloadSoundDelayTime": 0, + "__ReloadSound": "reloading0002", + "__ReloadFinishSound": "", + "ReloadFinishSoundDelayTime": 0, "ReloadSoundDelayTime": 0, - "__EquipSound": "", - "EquipSoundDelayTime": 0, + "__EquipSound": "equip0005", + "EquipSoundDelayTime": 0.4, + "__OtherSoundMap": null, "AiUseAttributeId": "", "AiTargetLockingTime": 0.4, "AiBulletSpeedScale": 0.7, @@ -233,6 +261,8 @@ "ReloadTime": 1.5, "AloneReload": false, "AloneReloadCount": 1, + "AutoReloadBeginIntervalTime": 0, + "AutoReloadFinishIntervalTime": 0, "AloneReloadCanShoot": false, "LooseShoot": false, "MinChargeTime": 0, @@ -265,10 +295,15 @@ "Y": 15 }, "__ShootSound": "shooting0001", - "__ReloadSound": "reloading0001", - "ReloadSoundDelayTime": 0.3, + "__BeginReloadSound": "reloading0001", + "BeginReloadSoundDelayTime": 0.3, + "__ReloadSound": "", + "__ReloadFinishSound": "", + "ReloadFinishSoundDelayTime": 0, + "ReloadSoundDelayTime": 0, "__EquipSound": "", "EquipSoundDelayTime": 0, + "__OtherSoundMap": null, "AiUseAttributeId": "0006", "AiTargetLockingTime": 0, "AiBulletSpeedScale": 0, @@ -288,6 +323,8 @@ "ReloadTime": 1.5, "AloneReload": false, "AloneReloadCount": 1, + "AutoReloadBeginIntervalTime": 0, + "AutoReloadFinishIntervalTime": 0, "AloneReloadCanShoot": false, "LooseShoot": false, "MinChargeTime": 0, @@ -320,10 +357,15 @@ "Y": 15 }, "__ShootSound": "shooting0001", - "__ReloadSound": "reloading0001", - "ReloadSoundDelayTime": 0.3, + "__BeginReloadSound": "reloading0001", + "BeginReloadSoundDelayTime": 0.3, + "__ReloadSound": "", + "__ReloadFinishSound": "", + "ReloadFinishSoundDelayTime": 0, + "ReloadSoundDelayTime": 0, "__EquipSound": "", "EquipSoundDelayTime": 0, + "__OtherSoundMap": null, "AiUseAttributeId": "", "AiTargetLockingTime": 1, "AiBulletSpeedScale": 0.7, @@ -343,6 +385,8 @@ "ReloadTime": 2, "AloneReload": false, "AloneReloadCount": 1, + "AutoReloadBeginIntervalTime": 0, + "AutoReloadFinishIntervalTime": 0, "AloneReloadCanShoot": false, "LooseShoot": true, "MinChargeTime": 0, @@ -375,10 +419,15 @@ "Y": 15 }, "__ShootSound": "", + "__BeginReloadSound": "", + "BeginReloadSoundDelayTime": 0, "__ReloadSound": "", + "__ReloadFinishSound": "", + "ReloadFinishSoundDelayTime": 0, "ReloadSoundDelayTime": 0, "__EquipSound": "", "EquipSoundDelayTime": 0, + "__OtherSoundMap": null, "AiUseAttributeId": "0008", "AiTargetLockingTime": 0, "AiBulletSpeedScale": 0, @@ -398,6 +447,8 @@ "ReloadTime": 2, "AloneReload": false, "AloneReloadCount": 1, + "AutoReloadBeginIntervalTime": 0, + "AutoReloadFinishIntervalTime": 0, "AloneReloadCanShoot": false, "LooseShoot": true, "MinChargeTime": 0, @@ -430,10 +481,15 @@ "Y": 15 }, "__ShootSound": "", + "__BeginReloadSound": "", + "BeginReloadSoundDelayTime": 0, "__ReloadSound": "", + "__ReloadFinishSound": "", + "ReloadFinishSoundDelayTime": 0, "ReloadSoundDelayTime": 0, "__EquipSound": "", "EquipSoundDelayTime": 0, + "__OtherSoundMap": null, "AiUseAttributeId": "", "AiTargetLockingTime": 0.7, "AiBulletSpeedScale": 0.7, @@ -453,6 +509,8 @@ "ReloadTime": 2.5, "AloneReload": false, "AloneReloadCount": 1, + "AutoReloadBeginIntervalTime": 0, + "AutoReloadFinishIntervalTime": 0, "AloneReloadCanShoot": false, "LooseShoot": false, "MinChargeTime": 0, @@ -485,10 +543,15 @@ "Y": 15 }, "__ShootSound": "shooting0003", - "__ReloadSound": "reloading0002", + "__BeginReloadSound": "", + "BeginReloadSoundDelayTime": 0, + "__ReloadSound": "", + "__ReloadFinishSound": "", + "ReloadFinishSoundDelayTime": 0, "ReloadSoundDelayTime": 1.2, - "__EquipSound": "reloading0004", + "__EquipSound": "", "EquipSoundDelayTime": 0.7, + "__OtherSoundMap": null, "AiUseAttributeId": "", "AiTargetLockingTime": 0.6, "AiBulletSpeedScale": 0.7, diff --git a/DungeonShooting_Godot/resource/sound/sfx/Equip0004.ogg b/DungeonShooting_Godot/resource/sound/sfx/Equip0004.ogg new file mode 100644 index 0000000..5d48d01 --- /dev/null +++ b/DungeonShooting_Godot/resource/sound/sfx/Equip0004.ogg Binary files differ diff --git a/DungeonShooting_Godot/resource/sound/sfx/Equip0004.ogg.import b/DungeonShooting_Godot/resource/sound/sfx/Equip0004.ogg.import new file mode 100644 index 0000000..353e29d --- /dev/null +++ b/DungeonShooting_Godot/resource/sound/sfx/Equip0004.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://lf1ylcyoem5j" +path="res://.godot/imported/Equip0004.ogg-bde6d107d90fe969a7d4debb6f1f4268.oggvorbisstr" + +[deps] + +source_file="res://resource/sound/sfx/Equip0004.ogg" +dest_files=["res://.godot/imported/Equip0004.ogg-bde6d107d90fe969a7d4debb6f1f4268.oggvorbisstr"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/DungeonShooting_Godot/resource/sound/sfx/Equip0005.ogg b/DungeonShooting_Godot/resource/sound/sfx/Equip0005.ogg new file mode 100644 index 0000000..8b80080 --- /dev/null +++ b/DungeonShooting_Godot/resource/sound/sfx/Equip0005.ogg Binary files differ diff --git a/DungeonShooting_Godot/resource/sound/sfx/Equip0005.ogg.import b/DungeonShooting_Godot/resource/sound/sfx/Equip0005.ogg.import new file mode 100644 index 0000000..d5f184e --- /dev/null +++ b/DungeonShooting_Godot/resource/sound/sfx/Equip0005.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://cthbancmpyj7" +path="res://.godot/imported/Equip0005.ogg-3ca997c2676e6c9bd4391911f7d5f68c.oggvorbisstr" + +[deps] + +source_file="res://resource/sound/sfx/Equip0005.ogg" +dest_files=["res://.godot/imported/Equip0005.ogg-3ca997c2676e6c9bd4391911f7d5f68c.oggvorbisstr"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/DungeonShooting_Godot/resource/sound/sfx/Equip0006.ogg b/DungeonShooting_Godot/resource/sound/sfx/Equip0006.ogg new file mode 100644 index 0000000..d33e2b6 --- /dev/null +++ b/DungeonShooting_Godot/resource/sound/sfx/Equip0006.ogg Binary files differ diff --git a/DungeonShooting_Godot/resource/sound/sfx/Equip0006.ogg.import b/DungeonShooting_Godot/resource/sound/sfx/Equip0006.ogg.import new file mode 100644 index 0000000..f77a0ca --- /dev/null +++ b/DungeonShooting_Godot/resource/sound/sfx/Equip0006.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://b8md3alwndnnd" +path="res://.godot/imported/Equip0006.ogg-6694e0194fc473d2e74f0f21b8efe115.oggvorbisstr" + +[deps] + +source_file="res://resource/sound/sfx/Equip0006.ogg" +dest_files=["res://.godot/imported/Equip0006.ogg-6694e0194fc473d2e74f0f21b8efe115.oggvorbisstr"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/DungeonShooting_Godot/resource/sound/sfx/Reloading0002.ogg b/DungeonShooting_Godot/resource/sound/sfx/Reloading0002.ogg index 5d48d01..6754397 100644 --- a/DungeonShooting_Godot/resource/sound/sfx/Reloading0002.ogg +++ b/DungeonShooting_Godot/resource/sound/sfx/Reloading0002.ogg Binary files differ diff --git a/DungeonShooting_Godot/resource/sound/sfx/Reloading0002.ogg.import b/DungeonShooting_Godot/resource/sound/sfx/Reloading0002.ogg.import index 8f02ff0..60bb83c 100644 --- a/DungeonShooting_Godot/resource/sound/sfx/Reloading0002.ogg.import +++ b/DungeonShooting_Godot/resource/sound/sfx/Reloading0002.ogg.import @@ -2,7 +2,7 @@ importer="oggvorbisstr" type="AudioStreamOggVorbis" -uid="uid://lf1ylcyoem5j" +uid="uid://c107t2g7g38l" path="res://.godot/imported/Reloading0002.ogg-1b8209757ee63ea95fa23f03c6f3caaa.oggvorbisstr" [deps] diff --git a/DungeonShooting_Godot/resource/sound/sfx/Reloading0003.ogg b/DungeonShooting_Godot/resource/sound/sfx/Reloading0003.ogg deleted file mode 100644 index 8b80080..0000000 --- a/DungeonShooting_Godot/resource/sound/sfx/Reloading0003.ogg +++ /dev/null Binary files differ diff --git a/DungeonShooting_Godot/resource/sound/sfx/Reloading0003.ogg.import b/DungeonShooting_Godot/resource/sound/sfx/Reloading0003.ogg.import deleted file mode 100644 index 9bac0a8..0000000 --- a/DungeonShooting_Godot/resource/sound/sfx/Reloading0003.ogg.import +++ /dev/null @@ -1,19 +0,0 @@ -[remap] - -importer="oggvorbisstr" -type="AudioStreamOggVorbis" -uid="uid://cthbancmpyj7" -path="res://.godot/imported/Reloading0003.ogg-465d9f910b670f76fac98b068b7bdd5a.oggvorbisstr" - -[deps] - -source_file="res://resource/sound/sfx/Reloading0003.ogg" -dest_files=["res://.godot/imported/Reloading0003.ogg-465d9f910b670f76fac98b068b7bdd5a.oggvorbisstr"] - -[params] - -loop=false -loop_offset=0 -bpm=0 -beat_count=0 -bar_beats=4 diff --git a/DungeonShooting_Godot/resource/sound/sfx/Reloading0004.ogg b/DungeonShooting_Godot/resource/sound/sfx/Reloading0004.ogg deleted file mode 100644 index d33e2b6..0000000 --- a/DungeonShooting_Godot/resource/sound/sfx/Reloading0004.ogg +++ /dev/null Binary files differ diff --git a/DungeonShooting_Godot/resource/sound/sfx/Reloading0004.ogg.import b/DungeonShooting_Godot/resource/sound/sfx/Reloading0004.ogg.import deleted file mode 100644 index 1246aa4..0000000 --- a/DungeonShooting_Godot/resource/sound/sfx/Reloading0004.ogg.import +++ /dev/null @@ -1,19 +0,0 @@ -[remap] - -importer="oggvorbisstr" -type="AudioStreamOggVorbis" -uid="uid://b8md3alwndnnd" -path="res://.godot/imported/Reloading0004.ogg-593728a5cd3512218630957453e03a14.oggvorbisstr" - -[deps] - -source_file="res://resource/sound/sfx/Reloading0004.ogg" -dest_files=["res://.godot/imported/Reloading0004.ogg-593728a5cd3512218630957453e03a14.oggvorbisstr"] - -[params] - -loop=false -loop_offset=0 -bpm=0 -beat_count=0 -bar_beats=4 diff --git a/DungeonShooting_Godot/src/config/ExcelConfig.cs b/DungeonShooting_Godot/src/config/ExcelConfig.cs index 323bca9..ceeb5e3 100644 --- a/DungeonShooting_Godot/src/config/ExcelConfig.cs +++ b/DungeonShooting_Godot/src/config/ExcelConfig.cs @@ -116,16 +116,35 @@ item.ShootSound = Sound_Map[item.__ShootSound]; } + if (!string.IsNullOrEmpty(item.__BeginReloadSound)) + { + item.BeginReloadSound = Sound_Map[item.__BeginReloadSound]; + } + if (!string.IsNullOrEmpty(item.__ReloadSound)) { item.ReloadSound = Sound_Map[item.__ReloadSound]; } + if (!string.IsNullOrEmpty(item.__ReloadFinishSound)) + { + item.ReloadFinishSound = Sound_Map[item.__ReloadFinishSound]; + } + if (!string.IsNullOrEmpty(item.__EquipSound)) { item.EquipSound = Sound_Map[item.__EquipSound]; } + if (item.__OtherSoundMap != null) + { + item.OtherSoundMap = new Dictionary(); + foreach (var pair in item.__OtherSoundMap) + { + item.OtherSoundMap.Add(pair.Key, Sound_Map[pair.Value]); + } + } + } catch (Exception e) { diff --git a/DungeonShooting_Godot/src/config/ExcelConfig_Sound.cs b/DungeonShooting_Godot/src/config/ExcelConfig_Sound.cs index aacfceb..5131c2a 100644 --- a/DungeonShooting_Godot/src/config/ExcelConfig_Sound.cs +++ b/DungeonShooting_Godot/src/config/ExcelConfig_Sound.cs @@ -20,7 +20,7 @@ public string Path; /// - /// 音量(建议范围:-80到+20) + /// 音量(范围0 - 1) /// [JsonInclude] public float Volume; diff --git a/DungeonShooting_Godot/src/config/ExcelConfig_Weapon.cs b/DungeonShooting_Godot/src/config/ExcelConfig_Weapon.cs index 9fcba1f..0242e15 100644 --- a/DungeonShooting_Godot/src/config/ExcelConfig_Weapon.cs +++ b/DungeonShooting_Godot/src/config/ExcelConfig_Weapon.cs @@ -89,6 +89,18 @@ public int AloneReloadCount; /// + /// 单独装弹模式下,从触发装弹到开始装第一发子弹中间的间隔时间, 必须要将 'AloneReload' 属性设置为 true + /// + [JsonInclude] + public float AutoReloadBeginIntervalTime; + + /// + /// 单独装弹模式下,从装完最后一发子弹到可以射击中间的间隔时间, 必须要将 'AloneReload' 属性设置为 true + /// + [JsonInclude] + public float AutoReloadFinishIntervalTime; + + /// /// 单独装填的子弹时可以立即射击, 必须要将 'AloneReload' 属性设置为 true /// [JsonInclude] @@ -262,11 +274,33 @@ public Sound ShootSound; /// + /// 开始换弹音效 + /// + public Sound BeginReloadSound; + + /// + /// 开始换弹音效延时时间 + /// + [JsonInclude] + public float BeginReloadSoundDelayTime; + + /// /// 换弹音效 /// public Sound ReloadSound; /// + /// 换弹结束音效 + /// + public Sound ReloadFinishSound; + + /// + /// 换弹结束音效延时 + /// + [JsonInclude] + public float ReloadFinishSoundDelayTime; + + /// /// 换弹音效延时时间 /// [JsonInclude] @@ -284,6 +318,11 @@ public float EquipSoundDelayTime; /// + /// 其他音效 + /// + public Dictionary OtherSoundMap; + + /// /// Ai属性
/// Ai 使用该武器时的武器数据, 设置该字段, 可让同一把武器在敌人和玩家手上有不同属性
/// 如果不填则Ai和玩家使用同一种属性 @@ -331,6 +370,8 @@ inst.ReloadTime = ReloadTime; inst.AloneReload = AloneReload; inst.AloneReloadCount = AloneReloadCount; + inst.AutoReloadBeginIntervalTime = AutoReloadBeginIntervalTime; + inst.AutoReloadFinishIntervalTime = AutoReloadFinishIntervalTime; inst.AloneReloadCanShoot = AloneReloadCanShoot; inst.LooseShoot = LooseShoot; inst.MinChargeTime = MinChargeTime; @@ -360,10 +401,15 @@ inst.BulletId = BulletId; inst.ThrowCollisionSize = ThrowCollisionSize; inst.ShootSound = ShootSound; + inst.BeginReloadSound = BeginReloadSound; + inst.BeginReloadSoundDelayTime = BeginReloadSoundDelayTime; inst.ReloadSound = ReloadSound; + inst.ReloadFinishSound = ReloadFinishSound; + inst.ReloadFinishSoundDelayTime = ReloadFinishSoundDelayTime; inst.ReloadSoundDelayTime = ReloadSoundDelayTime; inst.EquipSound = EquipSound; inst.EquipSoundDelayTime = EquipSoundDelayTime; + inst.OtherSoundMap = OtherSoundMap; inst.AiUseAttributeId = AiUseAttributeId; inst.AiTargetLockingTime = AiTargetLockingTime; inst.AiBulletSpeedScale = AiBulletSpeedScale; @@ -377,10 +423,19 @@ public string __ShootSound; [JsonInclude] + public string __BeginReloadSound; + + [JsonInclude] public string __ReloadSound; [JsonInclude] + public string __ReloadFinishSound; + + [JsonInclude] public string __EquipSound; + [JsonInclude] + public Dictionary __OtherSoundMap; + } } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs b/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs index ab91b9b..270ec50 100644 --- a/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs +++ b/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs @@ -278,13 +278,21 @@ } /// - /// 当开始换弹时调用 + /// 当换弹时调用, 如果设置单独装弹, 则每装一次弹调用一次该函数 /// protected virtual void OnReload() { } /// + /// 当开始换弹时调用 + /// + protected virtual void OnBeginReload() + { + + } + + /// /// 当换弹完成时调用 /// protected virtual void OnReloadFinish() @@ -685,8 +693,30 @@ { PlaySpriteAnimation(AnimatorNames.Fire); } + + var position = GameApplication.Instance.ViewToGlobalPosition(GlobalPosition); + + //播放射击音效 + if (Attribute.ShootSound != null) + { + SoundManager.PlaySoundEffectPosition(Attribute.ShootSound.Path, position, Attribute.ShootSound.Volume); + } + //触发开火函数 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); + } + } //开火发射的子弹数量 var bulletCount = Utils.RandomRangeInt(Attribute.MaxFireBulletCount, Attribute.MinFireBulletCount); @@ -830,15 +860,55 @@ { Reloading = true; ReloadTimer = Attribute.ReloadTime; - //播放换弹动画 - 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); + } } - OnReload(); + + //第一次换弹 + OnBeginReload(); + GD.Print("OnBeginReload."); + //换弹处理 + ReloadHandler(); } } + private void ReloadHandler() + { + //播放换弹动画 + if (IsAutoPlaySpriteFrames) + { + PlaySpriteAnimation(AnimatorNames.Reload); + } + + //播放换弹音效 + if (Attribute.ReloadSound != null) + { + var position = GameApplication.Instance.ViewToGlobalPosition(GlobalPosition); + if (Attribute.ReloadSoundDelayTime <= 0) + { + SoundManager.PlaySoundEffectPosition(Attribute.ReloadSound.Path, position, Attribute.ReloadSound.Volume); + } + else + { + SoundManager.PlaySoundEffectPositionDelay(Attribute.ReloadSound.Path, position, Attribute.ReloadSoundDelayTime, Attribute.ReloadSound.Volume); + } + } + + OnReload(); + GD.Print("OnReload."); + } + /// /// 换弹计时器时间到, 执行换弹操作 /// @@ -881,15 +951,10 @@ ReloadTimer = 0; OnReloadFinish(); } - else + else //继续装弹 { ReloadTimer = Attribute.ReloadTime; - //播放换弹动画 - if (IsAutoPlaySpriteFrames) - { - PlaySpriteAnimation(AnimatorNames.Reload); - } - OnReload(); + ReloadHandler(); } } else //换弹结束 diff --git a/DungeonShooting_Godot/src/game/activity/weapon/gun/Gun.cs b/DungeonShooting_Godot/src/game/activity/weapon/gun/Gun.cs index 79dfa72..83b94aa 100644 --- a/DungeonShooting_Godot/src/game/activity/weapon/gun/Gun.cs +++ b/DungeonShooting_Godot/src/game/activity/weapon/gun/Gun.cs @@ -8,19 +8,7 @@ { protected override void OnReload() { - //播放换弹音效 - if (Attribute.ReloadSound != null) - { - var position = GameApplication.Instance.ViewToGlobalPosition(GlobalPosition); - if (Attribute.ReloadSoundDelayTime <= 0) - { - SoundManager.PlaySoundEffectPosition(Attribute.ReloadSound.Path, position, Attribute.ReloadSound.Volume); - } - else - { - SoundManager.PlaySoundEffectPositionDelay(Attribute.ReloadSound.Path, position, Attribute.ReloadSoundDelayTime, Attribute.ReloadSound.Volume); - } - } + base.OnReload(); } protected override void OnFire() @@ -40,26 +28,6 @@ sprite.GlobalPosition = FirePoint.GlobalPosition; sprite.GlobalRotation = FirePoint.GlobalRotation; sprite.AddToActivityRoot(RoomLayerEnum.YSortLayer); - - var position = GameApplication.Instance.ViewToGlobalPosition(GlobalPosition); - //播放射击音效 - if (Attribute.ShootSound != null) - { - SoundManager.PlaySoundEffectPosition(Attribute.ShootSound.Path, position, Attribute.ShootSound.Volume); - } - - //播放上膛音效 - 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); - } - } } protected override void OnShoot(float fireRotation) diff --git a/DungeonShooting_Godot/src/game/activity/weapon/gun/Shotgun.cs b/DungeonShooting_Godot/src/game/activity/weapon/gun/Shotgun.cs index 4af92c9..fc79ef3 100644 --- a/DungeonShooting_Godot/src/game/activity/weapon/gun/Shotgun.cs +++ b/DungeonShooting_Godot/src/game/activity/weapon/gun/Shotgun.cs @@ -3,11 +3,6 @@ [Tool, GlobalClass] public partial class Shotgun : Weapon { - protected override void OnReload() - { - SoundManager.PlaySoundEffectPosition(ResourcePath.resource_sound_sfx_Reloading0003_ogg, GameApplication.Instance.ViewToGlobalPosition(GlobalPosition)); - } - protected override void OnFire() { //创建一个弹壳 @@ -25,9 +20,6 @@ sprite.GlobalPosition = FirePoint.GlobalPosition; sprite.GlobalRotation = FirePoint.GlobalRotation; sprite.AddToActivityRoot(RoomLayerEnum.YSortLayer); - - //播放射击音效 - SoundManager.PlaySoundEffectPosition(ResourcePath.resource_sound_sfx_Shooting0003_mp3, GameApplication.Instance.ViewToGlobalPosition(GlobalPosition), -15); } protected override void OnShoot(float fireRotation) @@ -39,7 +31,7 @@ Utils.RandomRangeInt(280, 380), Utils.RandomRangeFloat(Attribute.MinDistance, Attribute.MaxDistance), FirePoint.GlobalPosition, - fireRotation + Utils.RandomRangeFloat(-20 / 180f * Mathf.Pi, 20 / 180f * Mathf.Pi), + fireRotation + Utils.RandomRangeFloat(Mathf.DegToRad(-10), Mathf.DegToRad(10)), GetAttackLayer() ); bullet.PutDown(RoomLayerEnum.YSortLayer); diff --git a/DungeonShooting_Godot/src/game/manager/SoundManager.cs b/DungeonShooting_Godot/src/game/manager/SoundManager.cs index bbb3d05..c6e2cd7 100644 --- a/DungeonShooting_Godot/src/game/manager/SoundManager.cs +++ b/DungeonShooting_Godot/src/game/manager/SoundManager.cs @@ -116,15 +116,15 @@ /// 添加并播放音效 用于音效 ///
/// 音效文件路径 - /// 音量 - public static AudioStreamPlayer PlaySoundEffect(string soundName, float volume = 0.5f) + /// 音量 (0 - 1) + public static AudioStreamPlayer PlaySoundEffect(string soundName, float volume = 1f) { var sound = ResourceManager.Load(soundName); var soundNode = GetAudioPlayerInstance(); GameApplication.Instance.GlobalNodeRoot.AddChild(soundNode); soundNode.Stream = sound; soundNode.Bus = Enum.GetName(typeof(BUS), 1); - soundNode.VolumeDb = volume; + soundNode.VolumeDb = Mathf.LinearToDb(Mathf.Clamp(volume, 0, 1)); soundNode.Play(); return soundNode; } @@ -134,9 +134,9 @@ /// /// 音效文件路径 /// 发声节点所在全局坐标 - /// 音量 + /// 音量 (0 - 1) /// 挂载节点, 为null则挂载到房间根节点下 - public static AudioStreamPlayer2D PlaySoundEffectPosition(string soundName, Vector2 pos, float volume = 0.5f, Node2D target = null) + public static AudioStreamPlayer2D PlaySoundEffectPosition(string soundName, Vector2 pos, float volume = 1f, Node2D target = null) { var sound = ResourceManager.Load(soundName); var soundNode = GetAudioPlayer2DInstance(); @@ -152,7 +152,7 @@ soundNode.GlobalPosition = pos; soundNode.Stream = sound; soundNode.Bus = Enum.GetName(typeof(BUS), 1); - soundNode.VolumeDb = volume; + soundNode.VolumeDb = Mathf.LinearToDb(Mathf.Clamp(volume, 0, 1)); soundNode.Play(); return soundNode; } @@ -163,9 +163,9 @@ /// 音效文件路径 /// 发声节点所在全局坐标 /// 延时时间 - /// 音量 + /// 音量 (0 - 1) /// 挂载节点, 为null则挂载到房间根节点下 - public static AudioStreamPlayer2D PlaySoundEffectPositionDelay(string soundName, Vector2 pos, float delayTime, float volume = 0.5f, Node2D target = null) + public static AudioStreamPlayer2D PlaySoundEffectPositionDelay(string soundName, Vector2 pos, float delayTime, float volume = 1f, Node2D target = null) { var sound = ResourceManager.Load(soundName); var soundNode = GetAudioPlayer2DInstance(); @@ -181,7 +181,7 @@ soundNode.GlobalPosition = pos; soundNode.Stream = sound; soundNode.Bus = Enum.GetName(typeof(BUS), 1); - soundNode.VolumeDb = volume; + soundNode.VolumeDb = Mathf.LinearToDb(Mathf.Clamp(volume, 0, 1)); soundNode.DelayPlay(delayTime); return soundNode; }