diff --git a/DungeonShooting_Godot/excel/excelFile/ActivityObject.xlsx b/DungeonShooting_Godot/excel/excelFile/ActivityObject.xlsx index 67a7fdd..b5ef62e 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/Weapon.xlsx b/DungeonShooting_Godot/excel/excelFile/Weapon.xlsx index 6f54753..bd6cc04 100644 --- a/DungeonShooting_Godot/excel/excelFile/Weapon.xlsx +++ b/DungeonShooting_Godot/excel/excelFile/Weapon.xlsx Binary files differ diff --git a/DungeonShooting_Godot/prefab/weapon/Weapon0005.tscn b/DungeonShooting_Godot/prefab/weapon/Weapon0005.tscn new file mode 100644 index 0000000..7237343 --- /dev/null +++ b/DungeonShooting_Godot/prefab/weapon/Weapon0005.tscn @@ -0,0 +1,94 @@ +[gd_scene load_steps=10 format=3 uid="uid://cisivapjn5rq2"] + +[ext_resource type="Script" path="res://src/game/activity/weapon/gun/Gun.cs" id="1_3lu3r"] +[ext_resource type="Shader" path="res://resource/material/Blend.gdshader" id="1_466gw"] +[ext_resource type="SpriteFrames" uid="uid://djdvlmqsn8bie" path="res://resource/spriteFrames/Weapon0005.tres" id="2_m3plc"] + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_cbiyh"] +resource_local_to_scene = true +shader = ExtResource("1_466gw") +shader_parameter/blend = Color(0, 0, 0, 0.470588) +shader_parameter/schedule = 1 + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_o36tv"] +resource_local_to_scene = true +shader = ExtResource("1_466gw") +shader_parameter/blend = Color(1, 1, 1, 1) +shader_parameter/schedule = 0 + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_3p5jk"] +size = Vector2(26, 8) + +[sub_resource type="Animation" id="Animation_x136i"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("AnimatedSprite:material:shader_parameter/schedule") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [0] +} + +[sub_resource type="Animation" id="Animation_3piau"] +resource_name = "floodlight" +length = 3.0 +loop_mode = 1 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("AnimatedSprite:material:shader_parameter/schedule") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 2.3, 2.6, 2.7, 3), +"transitions": PackedFloat32Array(1, 1, 1, 1, 1), +"update": 0, +"values": [0, 0, 0.5, 0.5, 0] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_trkjd"] +_data = { +"RESET": SubResource("Animation_x136i"), +"floodlight": SubResource("Animation_3piau") +} + +[node name="Weapon0005" type="CharacterBody2D" node_paths=PackedStringArray("FirePoint", "ShellPoint", "GripPoint", "AnimationPlayer", "ShadowSprite", "AnimatedSprite", "Collision")] +collision_layer = 4 +script = ExtResource("1_3lu3r") +FirePoint = NodePath("AnimatedSprite/FirePoint") +ShellPoint = NodePath("AnimatedSprite/ShellPoint") +GripPoint = NodePath("GripPoint") +AnimationPlayer = NodePath("AnimationPlayer") +ShadowSprite = NodePath("ShadowSprite") +AnimatedSprite = NodePath("AnimatedSprite") +Collision = NodePath("Collision") + +[node name="ShadowSprite" type="Sprite2D" parent="."] +z_index = -1 +material = SubResource("ShaderMaterial_cbiyh") + +[node name="AnimatedSprite" type="AnimatedSprite2D" parent="."] +material = SubResource("ShaderMaterial_o36tv") +sprite_frames = ExtResource("2_m3plc") + +[node name="ShellPoint" type="Marker2D" parent="AnimatedSprite"] +position = Vector2(-1, -3.5) + +[node name="FirePoint" type="Marker2D" parent="AnimatedSprite"] +position = Vector2(20, -3.5) + +[node name="GripPoint" type="Marker2D" parent="."] +position = Vector2(-9, 0) + +[node name="Collision" type="CollisionShape2D" parent="."] +shape = SubResource("RectangleShape2D_3p5jk") + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +libraries = { +"": SubResource("AnimationLibrary_trkjd") +} diff --git a/DungeonShooting_Godot/resource/config/ActivityObject.json b/DungeonShooting_Godot/resource/config/ActivityObject.json index ba0b651..d44e410 100644 --- a/DungeonShooting_Godot/resource/config/ActivityObject.json +++ b/DungeonShooting_Godot/resource/config/ActivityObject.json @@ -36,6 +36,12 @@ "Remark": "" }, { + "Id": "weapon0005", + "Type": 5, + "Prefab": "res://prefab/weapon/Weapon0005.tscn", + "Remark": "" + }, + { "Id": "bullet0001", "Type": 6, "Prefab": "res://prefab/bullet/Bullet0001.tscn", diff --git a/DungeonShooting_Godot/resource/config/Weapon.json b/DungeonShooting_Godot/resource/config/Weapon.json index 4e79170..71eebd0 100644 --- a/DungeonShooting_Godot/resource/config/Weapon.json +++ b/DungeonShooting_Godot/resource/config/Weapon.json @@ -10,7 +10,7 @@ "AmmoCapacity": 30, "MaxAmmoCapacity": 90, "StandbyAmmoCapacity": 90, - "ReloadTime": 2.5, + "ReloadTime": 2, "AloneReload": false, "AloneReloadCount": 1, "AloneReloadCanShoot": false, @@ -44,6 +44,11 @@ "X": 20, "Y": 15 }, + "ShootSound": "res://resource/sound/sfx/Shooting0002.mp3", + "ReloadSound": "", + "ReloadSoundDelayTime": 0, + "EquipSound": "", + "EquipSoundDelayTime": 0, "AiUseAttributeId": "0002", "AiTargetLockingTime": 0, "AiBulletSpeedScale": 0, @@ -60,7 +65,7 @@ "AmmoCapacity": 30, "MaxAmmoCapacity": 90, "StandbyAmmoCapacity": 30, - "ReloadTime": 2.5, + "ReloadTime": 2, "AloneReload": false, "AloneReloadCount": 1, "AloneReloadCanShoot": false, @@ -94,6 +99,11 @@ "X": 20, "Y": 15 }, + "ShootSound": "res://resource/sound/sfx/Shooting0002.mp3", + "ReloadSound": "", + "ReloadSoundDelayTime": 0, + "EquipSound": "", + "EquipSoundDelayTime": 0, "AiUseAttributeId": "", "AiTargetLockingTime": 0.5, "AiBulletSpeedScale": 0.7, @@ -144,6 +154,11 @@ "X": 20, "Y": 15 }, + "ShootSound": "res://resource/sound/sfx/Shooting0003.mp3", + "ReloadSound": "", + "ReloadSoundDelayTime": 0, + "EquipSound": "", + "EquipSoundDelayTime": 0, "AiUseAttributeId": "0004", "AiTargetLockingTime": 0, "AiBulletSpeedScale": 0, @@ -194,6 +209,11 @@ "X": 20, "Y": 15 }, + "ShootSound": "res://resource/sound/sfx/Shooting0003.mp3", + "ReloadSound": "", + "ReloadSoundDelayTime": 0, + "EquipSound": "", + "EquipSoundDelayTime": 0, "AiUseAttributeId": "", "AiTargetLockingTime": 0.4, "AiBulletSpeedScale": 0.7, @@ -244,6 +264,11 @@ "X": 20, "Y": 15 }, + "ShootSound": "res://resource/sound/sfx/Shooting0001.ogg", + "ReloadSound": "res://resource/sound/sfx/Reloading0001.mp3", + "ReloadSoundDelayTime": 0.3, + "EquipSound": "", + "EquipSoundDelayTime": 0, "AiUseAttributeId": "0006", "AiTargetLockingTime": 0, "AiBulletSpeedScale": 0, @@ -294,6 +319,11 @@ "X": 20, "Y": 15 }, + "ShootSound": "res://resource/sound/sfx/Shooting0001.ogg", + "ReloadSound": "res://resource/sound/sfx/Reloading0001.mp3", + "ReloadSoundDelayTime": 0.3, + "EquipSound": "", + "EquipSoundDelayTime": 0, "AiUseAttributeId": "", "AiTargetLockingTime": 1, "AiBulletSpeedScale": 0.7, @@ -310,7 +340,7 @@ "AmmoCapacity": 180, "MaxAmmoCapacity": 180, "StandbyAmmoCapacity": 180, - "ReloadTime": 2.5, + "ReloadTime": 2, "AloneReload": false, "AloneReloadCount": 1, "AloneReloadCanShoot": false, @@ -344,6 +374,11 @@ "X": 20, "Y": 15 }, + "ShootSound": "", + "ReloadSound": "", + "ReloadSoundDelayTime": 0, + "EquipSound": "", + "EquipSoundDelayTime": 0, "AiUseAttributeId": "0008", "AiTargetLockingTime": 0, "AiBulletSpeedScale": 0, @@ -360,7 +395,7 @@ "AmmoCapacity": 180, "MaxAmmoCapacity": 180, "StandbyAmmoCapacity": 180, - "ReloadTime": 2.5, + "ReloadTime": 2, "AloneReload": false, "AloneReloadCount": 1, "AloneReloadCanShoot": false, @@ -394,9 +429,69 @@ "X": 20, "Y": 15 }, + "ShootSound": "", + "ReloadSound": "", + "ReloadSoundDelayTime": 0, + "EquipSound": "", + "EquipSoundDelayTime": 0, "AiUseAttributeId": "", "AiTargetLockingTime": 0.7, "AiBulletSpeedScale": 0.7, "AiAmmoConsumptionProbability": 0 + }, + { + "Id": "0009", + "WeaponId": "weapon0005", + "Name": "\u72D9\u51FB\u67AA", + "Icon": "res://resource/sprite/gun/gun4.png", + "Weight": 50, + "WeightType": 2, + "ContinuousShoot": false, + "AmmoCapacity": 10, + "MaxAmmoCapacity": 40, + "StandbyAmmoCapacity": 40, + "ReloadTime": 2.5, + "AloneReload": false, + "AloneReloadCount": 1, + "AloneReloadCanShoot": false, + "LooseShoot": false, + "MinChargeTime": 0, + "MinContinuousCount": 1, + "MaxContinuousCount": 1, + "TriggerInterval": 0, + "StartFiringSpeed": 45, + "FinalFiringSpeed": 45, + "FiringSpeedAddSpeed": 0, + "FiringSpeedBackSpeed": 0, + "MinFireBulletCount": 1, + "MaxFireBulletCount": 1, + "DelayedTime": 0, + "StartScatteringRange": 3, + "FinalScatteringRange": 60, + "ScatteringRangeAddValue": 40, + "ScatteringRangeBackSpeed": 25, + "ScatteringRangeBackTime": 1, + "MinDistance": 700, + "MaxDistance": 900, + "MinBacklash": 5, + "MaxBacklash": 7, + "BacklashRegressionSpeed": 20, + "UpliftAngle": 20, + "DefaultAngle": 0, + "UpliftAngleRestore": 3, + "BulletId": "bullet0001", + "ThrowCollisionSize": { + "X": 20, + "Y": 15 + }, + "ShootSound": "res://resource/sound/sfx/Shooting0003.mp3", + "ReloadSound": "res://resource/sound/sfx/Reloading0002.ogg", + "ReloadSoundDelayTime": 0.7, + "EquipSound": "res://resource/sound/sfx/Reloading0004.ogg", + "EquipSoundDelayTime": 0.3, + "AiUseAttributeId": "", + "AiTargetLockingTime": 0.6, + "AiBulletSpeedScale": 0.7, + "AiAmmoConsumptionProbability": 0 } ] \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/inlet/Room1.tscn b/DungeonShooting_Godot/resource/map/tileMaps/testGroup/inlet/Room1.tscn index ae17ba9..a38049e 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/inlet/Room1.tscn +++ b/DungeonShooting_Godot/resource/map/tileMaps/testGroup/inlet/Room1.tscn @@ -23,6 +23,13 @@ ItemExpression = "0001" WaveNumber = 2 +[node name="ActivityMark4" type="Node2D" parent="."] +position = Vector2(129, 68) +script = ExtResource("3_m4jrh") +Type = 5 +ItemExpression = "0002" +WaveNumber = 2 + [node name="ActivityMark2" type="Node2D" parent="."] position = Vector2(29, 75) script = ExtResource("3_m4jrh") @@ -30,3 +37,10 @@ ItemExpression = "0003 " WaveNumber = 3 + +[node name="ActivityMark3" type="Node2D" parent="."] +position = Vector2(29, 22) +script = ExtResource("3_m4jrh") +Type = 5 +ItemExpression = "0005" +WaveNumber = 4 diff --git a/DungeonShooting_Godot/resource/sound/sfx/Equip0001.ogg b/DungeonShooting_Godot/resource/sound/sfx/Equip0001.ogg new file mode 100644 index 0000000..5921758 --- /dev/null +++ b/DungeonShooting_Godot/resource/sound/sfx/Equip0001.ogg Binary files differ diff --git a/DungeonShooting_Godot/resource/sound/sfx/Equip0001.ogg.import b/DungeonShooting_Godot/resource/sound/sfx/Equip0001.ogg.import new file mode 100644 index 0000000..cb89324 --- /dev/null +++ b/DungeonShooting_Godot/resource/sound/sfx/Equip0001.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://dip1xa8wpxdjo" +path="res://.godot/imported/Equip0001.ogg-0f060e55a565fb3d05f50f4d89e22394.oggvorbisstr" + +[deps] + +source_file="res://resource/sound/sfx/Equip0001.ogg" +dest_files=["res://.godot/imported/Equip0001.ogg-0f060e55a565fb3d05f50f4d89e22394.oggvorbisstr"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/DungeonShooting_Godot/resource/sound/sfx/Equip0002.ogg b/DungeonShooting_Godot/resource/sound/sfx/Equip0002.ogg new file mode 100644 index 0000000..69130e6 --- /dev/null +++ b/DungeonShooting_Godot/resource/sound/sfx/Equip0002.ogg Binary files differ diff --git a/DungeonShooting_Godot/resource/sound/sfx/Equip0002.ogg.import b/DungeonShooting_Godot/resource/sound/sfx/Equip0002.ogg.import new file mode 100644 index 0000000..cc0121d --- /dev/null +++ b/DungeonShooting_Godot/resource/sound/sfx/Equip0002.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://dkrjt31o0eucf" +path="res://.godot/imported/Equip0002.ogg-18b2612fbdcea05574238dd2355d78e7.oggvorbisstr" + +[deps] + +source_file="res://resource/sound/sfx/Equip0002.ogg" +dest_files=["res://.godot/imported/Equip0002.ogg-18b2612fbdcea05574238dd2355d78e7.oggvorbisstr"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/DungeonShooting_Godot/resource/sound/sfx/Equip0003.ogg b/DungeonShooting_Godot/resource/sound/sfx/Equip0003.ogg new file mode 100644 index 0000000..997de27 --- /dev/null +++ b/DungeonShooting_Godot/resource/sound/sfx/Equip0003.ogg Binary files differ diff --git a/DungeonShooting_Godot/resource/sound/sfx/Equip0003.ogg.import b/DungeonShooting_Godot/resource/sound/sfx/Equip0003.ogg.import new file mode 100644 index 0000000..b040c80 --- /dev/null +++ b/DungeonShooting_Godot/resource/sound/sfx/Equip0003.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://djrsm2nwhxcug" +path="res://.godot/imported/Equip0003.ogg-dae81fb10e5b44c75fe894bbe95f75de.oggvorbisstr" + +[deps] + +source_file="res://resource/sound/sfx/Equip0003.ogg" +dest_files=["res://.godot/imported/Equip0003.ogg-dae81fb10e5b44c75fe894bbe95f75de.oggvorbisstr"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/DungeonShooting_Godot/resource/sound/sfx/Explosion0001.ogg b/DungeonShooting_Godot/resource/sound/sfx/Explosion0001.ogg new file mode 100644 index 0000000..57a9ec2 --- /dev/null +++ b/DungeonShooting_Godot/resource/sound/sfx/Explosion0001.ogg Binary files differ diff --git a/DungeonShooting_Godot/resource/sound/sfx/Explosion0001.ogg.import b/DungeonShooting_Godot/resource/sound/sfx/Explosion0001.ogg.import new file mode 100644 index 0000000..03200cf --- /dev/null +++ b/DungeonShooting_Godot/resource/sound/sfx/Explosion0001.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://dif1ehqqak60r" +path="res://.godot/imported/Explosion0001.ogg-3998886713ed22da0f09534afefebbf4.oggvorbisstr" + +[deps] + +source_file="res://resource/sound/sfx/Explosion0001.ogg" +dest_files=["res://.godot/imported/Explosion0001.ogg-3998886713ed22da0f09534afefebbf4.oggvorbisstr"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/DungeonShooting_Godot/resource/sound/sfx/Explosion0002.ogg b/DungeonShooting_Godot/resource/sound/sfx/Explosion0002.ogg new file mode 100644 index 0000000..31f8f34 --- /dev/null +++ b/DungeonShooting_Godot/resource/sound/sfx/Explosion0002.ogg Binary files differ diff --git a/DungeonShooting_Godot/resource/sound/sfx/Explosion0002.ogg.import b/DungeonShooting_Godot/resource/sound/sfx/Explosion0002.ogg.import new file mode 100644 index 0000000..71af49d --- /dev/null +++ b/DungeonShooting_Godot/resource/sound/sfx/Explosion0002.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://bhesqipwmgvtg" +path="res://.godot/imported/Explosion0002.ogg-e3e0d2c66b67aa61f8a61877ec95b9be.oggvorbisstr" + +[deps] + +source_file="res://resource/sound/sfx/Explosion0002.ogg" +dest_files=["res://.godot/imported/Explosion0002.ogg-e3e0d2c66b67aa61f8a61877ec95b9be.oggvorbisstr"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/DungeonShooting_Godot/resource/sound/sfx/Explosion0003.ogg b/DungeonShooting_Godot/resource/sound/sfx/Explosion0003.ogg new file mode 100644 index 0000000..0edc916 --- /dev/null +++ b/DungeonShooting_Godot/resource/sound/sfx/Explosion0003.ogg Binary files differ diff --git a/DungeonShooting_Godot/resource/sound/sfx/Explosion0003.ogg.import b/DungeonShooting_Godot/resource/sound/sfx/Explosion0003.ogg.import new file mode 100644 index 0000000..3429b65 --- /dev/null +++ b/DungeonShooting_Godot/resource/sound/sfx/Explosion0003.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://dbnu0nwcie1oq" +path="res://.godot/imported/Explosion0003.ogg-2285833a7bd7d651bfa22c9d4e13ccc5.oggvorbisstr" + +[deps] + +source_file="res://resource/sound/sfx/Explosion0003.ogg" +dest_files=["res://.godot/imported/Explosion0003.ogg-2285833a7bd7d651bfa22c9d4e13ccc5.oggvorbisstr"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/DungeonShooting_Godot/resource/sound/sfx/Reloading0001.mp3 b/DungeonShooting_Godot/resource/sound/sfx/Reloading0001.mp3 new file mode 100644 index 0000000..586e772 --- /dev/null +++ b/DungeonShooting_Godot/resource/sound/sfx/Reloading0001.mp3 Binary files differ diff --git a/DungeonShooting_Godot/resource/sound/sfx/Reloading0001.mp3.import b/DungeonShooting_Godot/resource/sound/sfx/Reloading0001.mp3.import new file mode 100644 index 0000000..0a49000 --- /dev/null +++ b/DungeonShooting_Godot/resource/sound/sfx/Reloading0001.mp3.import @@ -0,0 +1,19 @@ +[remap] + +importer="mp3" +type="AudioStreamMP3" +uid="uid://cubladp3u8jbj" +path="res://.godot/imported/Reloading0001.mp3-e0aa400da581f2f6ebdc337714439d82.mp3str" + +[deps] + +source_file="res://resource/sound/sfx/Reloading0001.mp3" +dest_files=["res://.godot/imported/Reloading0001.mp3-e0aa400da581f2f6ebdc337714439d82.mp3str"] + +[params] + +loop=false +loop_offset=0.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 new file mode 100644 index 0000000..5d48d01 --- /dev/null +++ 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 new file mode 100644 index 0000000..8f02ff0 --- /dev/null +++ b/DungeonShooting_Godot/resource/sound/sfx/Reloading0002.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://lf1ylcyoem5j" +path="res://.godot/imported/Reloading0002.ogg-1b8209757ee63ea95fa23f03c6f3caaa.oggvorbisstr" + +[deps] + +source_file="res://resource/sound/sfx/Reloading0002.ogg" +dest_files=["res://.godot/imported/Reloading0002.ogg-1b8209757ee63ea95fa23f03c6f3caaa.oggvorbisstr"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/DungeonShooting_Godot/resource/sound/sfx/Reloading0003.ogg b/DungeonShooting_Godot/resource/sound/sfx/Reloading0003.ogg new file mode 100644 index 0000000..8b80080 --- /dev/null +++ b/DungeonShooting_Godot/resource/sound/sfx/Reloading0003.ogg Binary files differ diff --git a/DungeonShooting_Godot/resource/sound/sfx/Reloading0003.ogg.import b/DungeonShooting_Godot/resource/sound/sfx/Reloading0003.ogg.import new file mode 100644 index 0000000..9bac0a8 --- /dev/null +++ b/DungeonShooting_Godot/resource/sound/sfx/Reloading0003.ogg.import @@ -0,0 +1,19 @@ +[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 new file mode 100644 index 0000000..d33e2b6 --- /dev/null +++ b/DungeonShooting_Godot/resource/sound/sfx/Reloading0004.ogg Binary files differ diff --git a/DungeonShooting_Godot/resource/sound/sfx/Reloading0004.ogg.import b/DungeonShooting_Godot/resource/sound/sfx/Reloading0004.ogg.import new file mode 100644 index 0000000..1246aa4 --- /dev/null +++ b/DungeonShooting_Godot/resource/sound/sfx/Reloading0004.ogg.import @@ -0,0 +1,19 @@ +[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/resource/sound/sfx/Reloading_begin0001.ogg b/DungeonShooting_Godot/resource/sound/sfx/Reloading_begin0001.ogg new file mode 100644 index 0000000..801ab54 --- /dev/null +++ b/DungeonShooting_Godot/resource/sound/sfx/Reloading_begin0001.ogg Binary files differ diff --git a/DungeonShooting_Godot/resource/sound/sfx/Reloading_begin0001.ogg.import b/DungeonShooting_Godot/resource/sound/sfx/Reloading_begin0001.ogg.import new file mode 100644 index 0000000..238d7bd --- /dev/null +++ b/DungeonShooting_Godot/resource/sound/sfx/Reloading_begin0001.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://hpyer4baoptl" +path="res://.godot/imported/Reloading_begin0001.ogg-b3c0c7d63c726e7dfdd556cc41bbecf1.oggvorbisstr" + +[deps] + +source_file="res://resource/sound/sfx/Reloading_begin0001.ogg" +dest_files=["res://.godot/imported/Reloading_begin0001.ogg-b3c0c7d63c726e7dfdd556cc41bbecf1.oggvorbisstr"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/DungeonShooting_Godot/resource/sound/sfx/Reloading_finish0001.ogg b/DungeonShooting_Godot/resource/sound/sfx/Reloading_finish0001.ogg new file mode 100644 index 0000000..7e149a1 --- /dev/null +++ b/DungeonShooting_Godot/resource/sound/sfx/Reloading_finish0001.ogg Binary files differ diff --git a/DungeonShooting_Godot/resource/sound/sfx/Reloading_finish0001.ogg.import b/DungeonShooting_Godot/resource/sound/sfx/Reloading_finish0001.ogg.import new file mode 100644 index 0000000..e31095e --- /dev/null +++ b/DungeonShooting_Godot/resource/sound/sfx/Reloading_finish0001.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://cxu23trqe00ij" +path="res://.godot/imported/Reloading_finish0001.ogg-def829198f233ebe6b00cfbc7e4625f7.oggvorbisstr" + +[deps] + +source_file="res://resource/sound/sfx/Reloading_finish0001.ogg" +dest_files=["res://.godot/imported/Reloading_finish0001.ogg-def829198f233ebe6b00cfbc7e4625f7.oggvorbisstr"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/DungeonShooting_Godot/resource/sound/sfx/Shooting0001.ogg b/DungeonShooting_Godot/resource/sound/sfx/Shooting0001.ogg new file mode 100644 index 0000000..dca1774 --- /dev/null +++ b/DungeonShooting_Godot/resource/sound/sfx/Shooting0001.ogg Binary files differ diff --git a/DungeonShooting_Godot/resource/sound/sfx/Shooting0001.ogg.import b/DungeonShooting_Godot/resource/sound/sfx/Shooting0001.ogg.import new file mode 100644 index 0000000..56e3ced --- /dev/null +++ b/DungeonShooting_Godot/resource/sound/sfx/Shooting0001.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://bnrursvt8gg11" +path="res://.godot/imported/Shooting0001.ogg-8050fb383c434d15397f2869fd9b4603.oggvorbisstr" + +[deps] + +source_file="res://resource/sound/sfx/Shooting0001.ogg" +dest_files=["res://.godot/imported/Shooting0001.ogg-8050fb383c434d15397f2869fd9b4603.oggvorbisstr"] + +[params] + +loop=false +loop_offset=0.0 +bpm=0.0 +beat_count=0 +bar_beats=4 diff --git a/DungeonShooting_Godot/resource/sound/sfx/Shooting0002.mp3 b/DungeonShooting_Godot/resource/sound/sfx/Shooting0002.mp3 new file mode 100644 index 0000000..09faa04 --- /dev/null +++ b/DungeonShooting_Godot/resource/sound/sfx/Shooting0002.mp3 Binary files differ diff --git a/DungeonShooting_Godot/resource/sound/sfx/Shooting0002.mp3.import b/DungeonShooting_Godot/resource/sound/sfx/Shooting0002.mp3.import new file mode 100644 index 0000000..862df18 --- /dev/null +++ b/DungeonShooting_Godot/resource/sound/sfx/Shooting0002.mp3.import @@ -0,0 +1,19 @@ +[remap] + +importer="mp3" +type="AudioStreamMP3" +uid="uid://ddie4d8go1t8g" +path="res://.godot/imported/Shooting0002.mp3-2e045b269e2ea080c15811bc4f51f16d.mp3str" + +[deps] + +source_file="res://resource/sound/sfx/Shooting0002.mp3" +dest_files=["res://.godot/imported/Shooting0002.mp3-2e045b269e2ea080c15811bc4f51f16d.mp3str"] + +[params] + +loop=false +loop_offset=0.0 +bpm=0.0 +beat_count=0 +bar_beats=4 diff --git a/DungeonShooting_Godot/resource/sound/sfx/Shooting0003.mp3 b/DungeonShooting_Godot/resource/sound/sfx/Shooting0003.mp3 new file mode 100644 index 0000000..06b18e6 --- /dev/null +++ b/DungeonShooting_Godot/resource/sound/sfx/Shooting0003.mp3 Binary files differ diff --git a/DungeonShooting_Godot/resource/sound/sfx/Shooting0003.mp3.import b/DungeonShooting_Godot/resource/sound/sfx/Shooting0003.mp3.import new file mode 100644 index 0000000..490e5d3 --- /dev/null +++ b/DungeonShooting_Godot/resource/sound/sfx/Shooting0003.mp3.import @@ -0,0 +1,19 @@ +[remap] + +importer="mp3" +type="AudioStreamMP3" +uid="uid://j6d3n7f5rf8e" +path="res://.godot/imported/Shooting0003.mp3-d85c5b09dcaf6f48682b5dc947b8fdd4.mp3str" + +[deps] + +source_file="res://resource/sound/sfx/Shooting0003.mp3" +dest_files=["res://.godot/imported/Shooting0003.mp3-d85c5b09dcaf6f48682b5dc947b8fdd4.mp3str"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/DungeonShooting_Godot/resource/sound/sfx/ordinaryBullet.ogg b/DungeonShooting_Godot/resource/sound/sfx/ordinaryBullet.ogg deleted file mode 100644 index f5a886a..0000000 --- a/DungeonShooting_Godot/resource/sound/sfx/ordinaryBullet.ogg +++ /dev/null Binary files differ diff --git a/DungeonShooting_Godot/resource/sound/sfx/ordinaryBullet.ogg.import b/DungeonShooting_Godot/resource/sound/sfx/ordinaryBullet.ogg.import deleted file mode 100644 index 0d7e06a..0000000 --- a/DungeonShooting_Godot/resource/sound/sfx/ordinaryBullet.ogg.import +++ /dev/null @@ -1,19 +0,0 @@ -[remap] - -importer="oggvorbisstr" -type="AudioStreamOggVorbis" -uid="uid://bnrursvt8gg11" -path="res://.godot/imported/ordinaryBullet.ogg-cfe42761de70631705f4e117ce06ad61.oggvorbisstr" - -[deps] - -source_file="res://resource/sound/sfx/ordinaryBullet.ogg" -dest_files=["res://.godot/imported/ordinaryBullet.ogg-cfe42761de70631705f4e117ce06ad61.oggvorbisstr"] - -[params] - -loop=false -loop_offset=0 -bpm=0 -beat_count=0 -bar_beats=4 diff --git a/DungeonShooting_Godot/resource/sound/sfx/ordinaryBullet2.mp3 b/DungeonShooting_Godot/resource/sound/sfx/ordinaryBullet2.mp3 deleted file mode 100644 index 09faa04..0000000 --- a/DungeonShooting_Godot/resource/sound/sfx/ordinaryBullet2.mp3 +++ /dev/null Binary files differ diff --git a/DungeonShooting_Godot/resource/sound/sfx/ordinaryBullet2.mp3.import b/DungeonShooting_Godot/resource/sound/sfx/ordinaryBullet2.mp3.import deleted file mode 100644 index 43ceb9a..0000000 --- a/DungeonShooting_Godot/resource/sound/sfx/ordinaryBullet2.mp3.import +++ /dev/null @@ -1,19 +0,0 @@ -[remap] - -importer="mp3" -type="AudioStreamMP3" -uid="uid://ddie4d8go1t8g" -path="res://.godot/imported/ordinaryBullet2.mp3-363566e6f98fe28405c9762713f94f39.mp3str" - -[deps] - -source_file="res://resource/sound/sfx/ordinaryBullet2.mp3" -dest_files=["res://.godot/imported/ordinaryBullet2.mp3-363566e6f98fe28405c9762713f94f39.mp3str"] - -[params] - -loop=false -loop_offset=0 -bpm=0 -beat_count=0 -bar_beats=4 diff --git a/DungeonShooting_Godot/resource/sound/sfx/ordinaryBullet3.mp3 b/DungeonShooting_Godot/resource/sound/sfx/ordinaryBullet3.mp3 deleted file mode 100644 index 06b18e6..0000000 --- a/DungeonShooting_Godot/resource/sound/sfx/ordinaryBullet3.mp3 +++ /dev/null Binary files differ diff --git a/DungeonShooting_Godot/resource/sound/sfx/ordinaryBullet3.mp3.import b/DungeonShooting_Godot/resource/sound/sfx/ordinaryBullet3.mp3.import deleted file mode 100644 index b20f030..0000000 --- a/DungeonShooting_Godot/resource/sound/sfx/ordinaryBullet3.mp3.import +++ /dev/null @@ -1,19 +0,0 @@ -[remap] - -importer="mp3" -type="AudioStreamMP3" -uid="uid://j6d3n7f5rf8e" -path="res://.godot/imported/ordinaryBullet3.mp3-071f70567ddf76a565a2dbe75703e424.mp3str" - -[deps] - -source_file="res://resource/sound/sfx/ordinaryBullet3.mp3" -dest_files=["res://.godot/imported/ordinaryBullet3.mp3-071f70567ddf76a565a2dbe75703e424.mp3str"] - -[params] - -loop=false -loop_offset=0 -bpm=0 -beat_count=0 -bar_beats=4 diff --git a/DungeonShooting_Godot/resource/sound/sfx/reloading.mp3 b/DungeonShooting_Godot/resource/sound/sfx/reloading.mp3 deleted file mode 100644 index 586e772..0000000 --- a/DungeonShooting_Godot/resource/sound/sfx/reloading.mp3 +++ /dev/null Binary files differ diff --git a/DungeonShooting_Godot/resource/sound/sfx/reloading.mp3.import b/DungeonShooting_Godot/resource/sound/sfx/reloading.mp3.import deleted file mode 100644 index f4a33b4..0000000 --- a/DungeonShooting_Godot/resource/sound/sfx/reloading.mp3.import +++ /dev/null @@ -1,19 +0,0 @@ -[remap] - -importer="mp3" -type="AudioStreamMP3" -uid="uid://cubladp3u8jbj" -path="res://.godot/imported/reloading.mp3-a718918dc3dc57c0c17a3c31a9e33c3f.mp3str" - -[deps] - -source_file="res://resource/sound/sfx/reloading.mp3" -dest_files=["res://.godot/imported/reloading.mp3-a718918dc3dc57c0c17a3c31a9e33c3f.mp3str"] - -[params] - -loop=false -loop_offset=0.0 -bpm=0 -beat_count=0 -bar_beats=4 diff --git a/DungeonShooting_Godot/resource/sprite/role/enemy0001/Enemy0001.png b/DungeonShooting_Godot/resource/sprite/role/enemy0001/Enemy0001.png new file mode 100644 index 0000000..f902601 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/role/enemy0001/Enemy0001.png Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/role/enemy0001/Enemy0001.png.import b/DungeonShooting_Godot/resource/sprite/role/enemy0001/Enemy0001.png.import new file mode 100644 index 0000000..c36be94 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/role/enemy0001/Enemy0001.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://chd2vtesap5cf" +path="res://.godot/imported/Enemy0001.png-148a38dfa95953b26d890356e8875de4.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/role/enemy0001/Enemy0001.png" +dest_files=["res://.godot/imported/Enemy0001.png-148a38dfa95953b26d890356e8875de4.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/role/enemy0001/Enemy0001_Debris.png b/DungeonShooting_Godot/resource/sprite/role/enemy0001/Enemy0001_Debris.png new file mode 100644 index 0000000..60d644b --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/role/enemy0001/Enemy0001_Debris.png Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/role/enemy0001/Enemy0001_Debris.png.import b/DungeonShooting_Godot/resource/sprite/role/enemy0001/Enemy0001_Debris.png.import new file mode 100644 index 0000000..d563acf --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/role/enemy0001/Enemy0001_Debris.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://d2f55lu60x64i" +path="res://.godot/imported/Enemy0001_Debris.png-ac416dc79cd3c1217b27e1ef1fbe0d0b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/role/enemy0001/Enemy0001_Debris.png" +dest_files=["res://.godot/imported/Enemy0001_Debris.png-ac416dc79cd3c1217b27e1ef1fbe0d0b.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/src/config/ExcelConfig_Weapon.cs b/DungeonShooting_Godot/src/config/ExcelConfig_Weapon.cs index 3e7bd66..a2953d8 100644 --- a/DungeonShooting_Godot/src/config/ExcelConfig_Weapon.cs +++ b/DungeonShooting_Godot/src/config/ExcelConfig_Weapon.cs @@ -257,8 +257,39 @@ public SerializeVector2 ThrowCollisionSize; /// + /// 射击音效 + /// + [JsonInclude] + public string ShootSound; + + /// + /// 换弹音效 + /// + [JsonInclude] + public string ReloadSound; + + /// + /// 换弹音效延时时间 + /// + [JsonInclude] + public float ReloadSoundDelayTime; + + /// + /// 上膛音效 + /// + [JsonInclude] + public string EquipSound; + + /// + /// 上膛音效延时时间 + /// + [JsonInclude] + public float EquipSoundDelayTime; + + /// /// Ai属性
- /// Ai 使用该武器时的武器数据, 设置该字段, 可让同一把武器在敌人和玩家手上有不同属性 + /// Ai 使用该武器时的武器数据, 设置该字段, 可让同一把武器在敌人和玩家手上有不同属性
+ /// 如果不填则Ai和玩家使用同一种属性 ///
[JsonInclude] public string AiUseAttributeId; @@ -331,6 +362,11 @@ inst.UpliftAngleRestore = UpliftAngleRestore; inst.BulletId = BulletId; inst.ThrowCollisionSize = ThrowCollisionSize; + inst.ShootSound = ShootSound; + inst.ReloadSound = ReloadSound; + inst.ReloadSoundDelayTime = ReloadSoundDelayTime; + inst.EquipSound = EquipSound; + inst.EquipSoundDelayTime = EquipSoundDelayTime; inst.AiUseAttributeId = AiUseAttributeId; inst.AiTargetLockingTime = AiTargetLockingTime; inst.AiBulletSpeedScale = AiBulletSpeedScale; diff --git a/DungeonShooting_Godot/src/framework/activity/ActivityObject_Init.cs b/DungeonShooting_Godot/src/framework/activity/ActivityObject_Init.cs index 1825de5..4190405 100644 --- a/DungeonShooting_Godot/src/framework/activity/ActivityObject_Init.cs +++ b/DungeonShooting_Godot/src/framework/activity/ActivityObject_Init.cs @@ -20,6 +20,7 @@ public const string Id_weapon0002 = "weapon0002"; public const string Id_weapon0003 = "weapon0003"; public const string Id_weapon0004 = "weapon0004"; + public const string Id_weapon0005 = "weapon0005"; public const string Id_bullet0001 = "bullet0001"; public const string Id_bullet0002 = "bullet0002"; public const string Id_shell0001 = "shell0001"; @@ -52,6 +53,7 @@ _activityRegisterMap.Add("weapon0002", "res://prefab/weapon/Weapon0002.tscn"); _activityRegisterMap.Add("weapon0003", "res://prefab/weapon/Weapon0003.tscn"); _activityRegisterMap.Add("weapon0004", "res://prefab/weapon/Weapon0004.tscn"); + _activityRegisterMap.Add("weapon0005", "res://prefab/weapon/Weapon0005.tscn"); _activityRegisterMap.Add("bullet0001", "res://prefab/bullet/Bullet0001.tscn"); _activityRegisterMap.Add("bullet0002", "res://prefab/bullet/Bullet0002.tscn"); _activityRegisterMap.Add("shell0001", "res://prefab/shell/Shell0001.tscn"); diff --git a/DungeonShooting_Godot/src/game/activity/weapon/gun/Gun.cs b/DungeonShooting_Godot/src/game/activity/weapon/gun/Gun.cs index 3b7631a..46bca47 100644 --- a/DungeonShooting_Godot/src/game/activity/weapon/gun/Gun.cs +++ b/DungeonShooting_Godot/src/game/activity/weapon/gun/Gun.cs @@ -6,12 +6,28 @@ [Tool, GlobalClass] public partial class Gun : Weapon { - + protected override void OnReload() + { + //播放换弹音效 + if (!string.IsNullOrEmpty(Attribute.ReloadSound)) + { + var position = GameApplication.Instance.ViewToGlobalPosition(GlobalPosition); + if (Attribute.ReloadSoundDelayTime <= 0) + { + SoundManager.PlaySoundEffectPosition(Attribute.ReloadSound, position); + } + else + { + SoundManager.PlaySoundEffectPositionDelay(Attribute.ReloadSound, position, Attribute.ReloadSoundDelayTime); + } + } + } + protected override void OnFire() { //创建一个弹壳 ThrowShell(ActivityObject.Ids.Id_shell0001); - + if (Master == Player.Current) { //创建抖动 @@ -25,8 +41,25 @@ sprite.GlobalRotation = FirePoint.GlobalRotation; sprite.AddToActivityRoot(RoomLayerEnum.YSortLayer); + var position = GameApplication.Instance.ViewToGlobalPosition(GlobalPosition); //播放射击音效 - SoundManager.PlaySoundEffectPosition(ResourcePath.resource_sound_sfx_ordinaryBullet2_mp3, GameApplication.Instance.ViewToGlobalPosition(GlobalPosition), -8); + if (!string.IsNullOrEmpty(Attribute.ShootSound)) + { + SoundManager.PlaySoundEffectPosition(Attribute.ShootSound, position, 0); + } + + //播放上膛音效 + if (!string.IsNullOrEmpty(Attribute.EquipSound)) + { + if (Attribute.EquipSoundDelayTime <= 0) + { + SoundManager.PlaySoundEffectPosition(Attribute.EquipSound, position); + } + else + { + SoundManager.PlaySoundEffectPositionDelay(Attribute.EquipSound, position, Attribute.EquipSoundDelayTime); + } + } } 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 6928687..4af92c9 100644 --- a/DungeonShooting_Godot/src/game/activity/weapon/gun/Shotgun.cs +++ b/DungeonShooting_Godot/src/game/activity/weapon/gun/Shotgun.cs @@ -3,6 +3,11 @@ [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() { //创建一个弹壳 @@ -22,7 +27,7 @@ sprite.AddToActivityRoot(RoomLayerEnum.YSortLayer); //播放射击音效 - SoundManager.PlaySoundEffectPosition(ResourcePath.resource_sound_sfx_ordinaryBullet3_mp3, GameApplication.Instance.ViewToGlobalPosition(GlobalPosition), -15); + SoundManager.PlaySoundEffectPosition(ResourcePath.resource_sound_sfx_Shooting0003_mp3, GameApplication.Instance.ViewToGlobalPosition(GlobalPosition), -15); } protected override void OnShoot(float fireRotation) diff --git a/DungeonShooting_Godot/src/game/manager/ResourcePath.cs b/DungeonShooting_Godot/src/game/manager/ResourcePath.cs index 9e709fc..0da5ef6 100644 --- a/DungeonShooting_Godot/src/game/manager/ResourcePath.cs +++ b/DungeonShooting_Godot/src/game/manager/ResourcePath.cs @@ -39,6 +39,7 @@ public const string prefab_weapon_Weapon0002_tscn = "res://prefab/weapon/Weapon0002.tscn"; public const string prefab_weapon_Weapon0003_tscn = "res://prefab/weapon/Weapon0003.tscn"; public const string prefab_weapon_Weapon0004_tscn = "res://prefab/weapon/Weapon0004.tscn"; + public const string prefab_weapon_Weapon0005_tscn = "res://prefab/weapon/Weapon0005.tscn"; public const string prefab_weapon_WeaponTemplate_tscn = "res://prefab/weapon/WeaponTemplate.tscn"; public const string resource_config_ActivityObject_json = "res://resource/config/ActivityObject.json"; public const string resource_config_Weapon_json = "res://resource/config/Weapon.json"; @@ -55,10 +56,21 @@ public const string resource_material_Blend_tres = "res://resource/material/Blend.tres"; public const string resource_material_SmokeParticleMaterial_tres = "res://resource/material/SmokeParticleMaterial.tres"; public const string resource_sound_bgm_Intro_ogg = "res://resource/sound/bgm/Intro.ogg"; - public const string resource_sound_sfx_ordinaryBullet_ogg = "res://resource/sound/sfx/ordinaryBullet.ogg"; - public const string resource_sound_sfx_ordinaryBullet2_mp3 = "res://resource/sound/sfx/ordinaryBullet2.mp3"; - public const string resource_sound_sfx_ordinaryBullet3_mp3 = "res://resource/sound/sfx/ordinaryBullet3.mp3"; - public const string resource_sound_sfx_reloading_mp3 = "res://resource/sound/sfx/reloading.mp3"; + public const string resource_sound_sfx_Equip0001_ogg = "res://resource/sound/sfx/Equip0001.ogg"; + public const string resource_sound_sfx_Equip0002_ogg = "res://resource/sound/sfx/Equip0002.ogg"; + public const string resource_sound_sfx_Equip0003_ogg = "res://resource/sound/sfx/Equip0003.ogg"; + public const string resource_sound_sfx_Explosion0001_ogg = "res://resource/sound/sfx/Explosion0001.ogg"; + public const string resource_sound_sfx_Explosion0002_ogg = "res://resource/sound/sfx/Explosion0002.ogg"; + public const string resource_sound_sfx_Explosion0003_ogg = "res://resource/sound/sfx/Explosion0003.ogg"; + public const string resource_sound_sfx_Reloading0001_mp3 = "res://resource/sound/sfx/Reloading0001.mp3"; + public const string resource_sound_sfx_Reloading0002_ogg = "res://resource/sound/sfx/Reloading0002.ogg"; + public const string resource_sound_sfx_Reloading0003_ogg = "res://resource/sound/sfx/Reloading0003.ogg"; + public const string resource_sound_sfx_Reloading0004_ogg = "res://resource/sound/sfx/Reloading0004.ogg"; + public const string resource_sound_sfx_Reloading_begin0001_ogg = "res://resource/sound/sfx/Reloading_begin0001.ogg"; + public const string resource_sound_sfx_Reloading_finish0001_ogg = "res://resource/sound/sfx/Reloading_finish0001.ogg"; + public const string resource_sound_sfx_Shooting0001_ogg = "res://resource/sound/sfx/Shooting0001.ogg"; + public const string resource_sound_sfx_Shooting0002_mp3 = "res://resource/sound/sfx/Shooting0002.mp3"; + public const string resource_sound_sfx_Shooting0003_mp3 = "res://resource/sound/sfx/Shooting0003.mp3"; public const string resource_sprite_bullet_arrow_png = "res://resource/sprite/bullet/arrow.png"; public const string resource_sprite_bullet_bullet_png = "res://resource/sprite/bullet/bullet.png"; public const string resource_sprite_bullet_bullet2_png = "res://resource/sprite/bullet/bullet2.png"; diff --git a/DungeonShooting_Godot/src/game/manager/SoundManager.cs b/DungeonShooting_Godot/src/game/manager/SoundManager.cs index 1b5bc35..bbb3d05 100644 --- a/DungeonShooting_Godot/src/game/manager/SoundManager.cs +++ b/DungeonShooting_Godot/src/game/manager/SoundManager.cs @@ -24,13 +24,45 @@ /// private partial class AudioPlayer2D : AudioStreamPlayer2D { + private float _delayTimer = -1; + public override void _Ready() { Finished += OnPlayFinish; } - public void OnPlayFinish() + /// + /// 延时播放 + /// + public void DelayPlay(float time) { + _delayTimer = time; + } + + /// + /// 停止播放, 并回收节点 + /// + public void StopPlay() + { + Stop(); + OnPlayFinish(); + } + + public override void _Process(double delta) + { + if (_delayTimer > 0) + { + _delayTimer -= (float)delta; + if (_delayTimer <= 0) + { + Play(); + } + } + } + + private void OnPlayFinish() + { + _delayTimer = -1; RecycleAudioPlayer2D(this); } } @@ -45,7 +77,16 @@ Finished += OnPlayFinish; } - public void OnPlayFinish() + /// + /// 停止播放, 并回收节点 + /// + public void StopPlay() + { + Stop(); + OnPlayFinish(); + } + + private void OnPlayFinish() { GetParent().RemoveChild(this); Stream = null; @@ -117,6 +158,35 @@ } /// + /// 在指定的节点下延时播放音效 用于音效 + /// + /// 音效文件路径 + /// 发声节点所在全局坐标 + /// 延时时间 + /// 音量 + /// 挂载节点, 为null则挂载到房间根节点下 + public static AudioStreamPlayer2D PlaySoundEffectPositionDelay(string soundName, Vector2 pos, float delayTime, float volume = 0.5f, Node2D target = null) + { + var sound = ResourceManager.Load(soundName); + var soundNode = GetAudioPlayer2DInstance(); + if (target != null) + { + target.AddChild(soundNode); + } + else + { + GameApplication.Instance.GlobalNodeRoot.AddChild(soundNode); + } + + soundNode.GlobalPosition = pos; + soundNode.Stream = sound; + soundNode.Bus = Enum.GetName(typeof(BUS), 1); + soundNode.VolumeDb = volume; + soundNode.DelayPlay(delayTime); + return soundNode; + } + + /// /// 获取2D音频播放节点 /// private static AudioPlayer2D GetAudioPlayer2DInstance()