diff --git a/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001.png.import b/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001.png.import index c36be94..b20c9a6 100644 --- a/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001.png.import +++ b/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://chd2vtesap5cf" -path="res://.godot/imported/Enemy0001.png-148a38dfa95953b26d890356e8875de4.ctex" +path="res://.godot/imported/enemy0001.png-1247a3ddf8a1a163d812cad12c4340fd.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://resource/sprite/role/enemy0001/Enemy0001.png" -dest_files=["res://.godot/imported/Enemy0001.png-148a38dfa95953b26d890356e8875de4.ctex"] +source_file="res://resource/sprite/role/enemy0001/enemy0001.png" +dest_files=["res://.godot/imported/enemy0001.png-1247a3ddf8a1a163d812cad12c4340fd.ctex"] [params] diff --git a/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001_Debris.png.import b/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001_Debris.png.import index d563acf..56388a2 100644 --- a/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001_Debris.png.import +++ b/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001_Debris.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://d2f55lu60x64i" -path="res://.godot/imported/Enemy0001_Debris.png-ac416dc79cd3c1217b27e1ef1fbe0d0b.ctex" +path="res://.godot/imported/enemy0001_Debris.png-297a2fb6680cb862a9a085cf58f8268c.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"] +source_file="res://resource/sprite/role/enemy0001/enemy0001_Debris.png" +dest_files=["res://.godot/imported/enemy0001_Debris.png-297a2fb6680cb862a9a085cf58f8268c.ctex"] [params] diff --git a/DungeonShooting_Godot/resource/theme/mainTheme.tres b/DungeonShooting_Godot/resource/theme/mainTheme.tres index ec8b719..668332a 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_tiopb"] +[sub_resource type="Image" id="Image_53iwr"] 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_tiopb") +image = SubResource("Image_53iwr") [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_3mc6w"] +[sub_resource type="Image" id="Image_sxg3y"] 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_3mc6w") +image = SubResource("Image_sxg3y") [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_4kug6"] +[sub_resource type="Image" id="Image_gteoy"] 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_4kug6") +image = SubResource("Image_gteoy") [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_yud6e"] +[sub_resource type="Image" id="Image_fr7jb"] 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_yud6e") +image = SubResource("Image_fr7jb") [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_luetf"] +[sub_resource type="Image" id="Image_6yo53"] 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_luetf") +image = SubResource("Image_6yo53") [sub_resource type="StyleBoxFlat" id="57"] content_margin_left = 6.0 diff --git a/DungeonShooting_Godot/src/game/Cursor.cs b/DungeonShooting_Godot/src/game/Cursor.cs index cbde2ae..01de4a2 100644 --- a/DungeonShooting_Godot/src/game/Cursor.cs +++ b/DungeonShooting_Godot/src/game/Cursor.cs @@ -37,7 +37,7 @@ { if (!_isGuiMode) { - var targetGun = _mountRole?.Holster.ActiveWeapon; + var targetGun = _mountRole?.Holster.ActiveItem; if (targetGun != null) { SetScope(targetGun.CurrScatteringRange, targetGun); diff --git a/DungeonShooting_Godot/src/game/activity/package/IPackageItem.cs b/DungeonShooting_Godot/src/game/activity/package/IPackageItem.cs new file mode 100644 index 0000000..2cf1e93 --- /dev/null +++ b/DungeonShooting_Godot/src/game/activity/package/IPackageItem.cs @@ -0,0 +1,41 @@ + +/// +/// 可放入背包中的物体接口 +/// +public interface IPackageItem +{ + /// + /// 物体所属角色 + /// + Role Master { get; set; } + + /// + /// 物体在背包中的索引, 如果不在背包中则为 -1 + /// + int PackageIndex { get; set; } + + /// + /// 当物体拾起并放入背包时调用 + /// + void OnPickUpItem(); + + /// + /// 当物体从背包中移除时调用 + /// + void OnRemoveItem(); + + /// + /// 当切换到当前物体时调用 + /// + void OnActiveItem(); + + /// + /// 当收起当前物体时调用 + /// + void OnConcealItem(); + + /// + /// 当道具溢出时调用, 也就是修改了背包大小后背包容不下这个道具时调用, 用于处理扔下道具 + /// + void OnOverflowItem(); +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/activity/package/Package.cs b/DungeonShooting_Godot/src/game/activity/package/Package.cs new file mode 100644 index 0000000..678b4e3 --- /dev/null +++ b/DungeonShooting_Godot/src/game/activity/package/Package.cs @@ -0,0 +1,355 @@ +using System; +using System.Collections.Generic; + +public class Package where T : ActivityObject, IPackageItem +{ + /// + /// 归属者 + /// + public Role Master { get; } + + /// + /// 当前使用的物体对象 + /// + public T ActiveItem { get; private set; } + + /// + /// 当前使用的物体的索引 + /// + public int ActiveIndex { get; private set; } = 0; + + /// + /// 物体袋容量 + /// + public int Capacity { get; private set; } = 0; + + /// + /// 物体插槽 + /// + public T[] ItemSlot { get; private set; } + + public Package(Role master) + { + Master = master; + //默认容量4 + SetCapacity(4); + } + + /// + /// 修改物体袋容量 + /// + public void SetCapacity(int capacity) + { + if (capacity < 0) + { + capacity = 0; + } + + if (capacity == Capacity) + { + return; + } + + if (ItemSlot == null) + { + ItemSlot = new T[capacity]; + } + else if (ItemSlot.Length > capacity) //删减格子 + { + var newArray = new T[capacity]; + for (var i = 0; i < ItemSlot.Length; i++) + { + var packageItem = ItemSlot[i]; + if (i < capacity) + { + newArray[i] = packageItem; + } + else + { + //溢出的item + packageItem.OnOverflowItem(); + packageItem.Master = null; + packageItem.PackageIndex = -1; + } + } + + ItemSlot = newArray; + } + else //添加格子 + { + var newArray = new T[capacity]; + for (var i = 0; i < ItemSlot.Length; i++) + { + newArray[i] = ItemSlot[i]; + } + ItemSlot = newArray; + } + Capacity = capacity; + + } + + /// + /// 返回当前物体袋是否是空的 + /// + public bool IsEmpty() + { + for (var i = 0; i < ItemSlot.Length; i++) + { + if (ItemSlot[i] != null) + { + return false; + } + } + + return true; + } + + /// + /// 返回当前物体袋是否还有空位 + /// + public bool HasVacancy() + { + for (var i = 0; i < ItemSlot.Length; i++) + { + if (ItemSlot[i] == null) + { + return true; + } + } + + return false; + } + + /// + /// 根据索引获取物体 + /// + public T GetItem(int index) + { + if (index < 0 || index >= ItemSlot.Length) + { + return null; + } + return ItemSlot[index]; + } + + /// + /// 根据物体id查找物体袋中该物体所在的位置, 如果没有, 则返回 -1 + /// + /// 物体id + public int FindItem(string id) + { + for (var i = 0; i < ItemSlot.Length; i++) + { + var item = ItemSlot[i]; + if (item != null && item.ItemConfig.Id == id) + { + return i; + } + } + return -1; + } + + /// + /// 通过回调函数查询物体在物体袋中的位置, 如果没有, 则返回 -1 + /// + public int FindItem(Func handler) + { + for (var i = 0; i < ItemSlot.Length; i++) + { + var item = ItemSlot[i]; + if (item != null && handler(item, i)) + { + return i; + } + } + return -1; + } + + /// + /// 遍历所有物体 + /// + public void ForEach(Action handler) + { + for (var i = 0; i < ItemSlot.Length; i++) + { + var item = ItemSlot[i]; + if (item != null) + { + handler(item, i); + } + } + } + + /// + /// 从物体袋中移除所有物体, 并返回 + /// + public T[] GetAndClearItem() + { + var items = new List(); + for (var i = 0; i < ItemSlot.Length; i++) + { + var item = ItemSlot[i]; + if (item != null) + { + //触发移除物体 + item.OnRemoveItem(); + item.Master = null; + item.PackageIndex = -1; + + items.Add(item); + ItemSlot[i] = null; + } + } + + return items.ToArray(); + } + + /// + /// 返回是否能放入物体 + /// + /// 物体对象 + public bool CanPickupItem(T item) + { + for (var i = 0; i < ItemSlot.Length; i++) + { + var tempItem = ItemSlot[i]; + if (tempItem == null) + { + return true; + } + } + return false; + } + + /// + /// 拾起物体, 存入物体袋中, 返回存放在物体袋的位置, 如果容不下这个物体, 则会返回 -1 + /// + /// 物体对象 + /// 是否立即切换到该物体, 默认 true + public int PickupItem(T item, bool exchange = true) + { + //已经被拾起了 + if (item.Master != null) + { + return -1; + } + for (var i = 0; i < ItemSlot.Length; i++) + { + var tempItem = ItemSlot[i]; + if (tempItem == null) + { + ItemSlot[i] = item; + item.Master = Master; + item.PackageIndex = i; + item.OnPickUpItem(); + if (exchange) + { + ExchangeByIndex(i); + } + + return i; + } + } + return -1; + } + + /// + /// 移除指定位置的物体, 并返回这个物体对象, 如果移除正在使用的这个物体, 则会自动切换到上一个物体 + /// + /// 所在物体袋的位置索引 + public T RemoveItem(int index) + { + if (index < 0 || index >= ItemSlot.Length) + { + return null; + } + var item = ItemSlot[index]; + if (item == null) + { + return null; + } + ItemSlot[index] = null; + + //如果是当前手持的物体, 就需要调用切换物体操作 + if (index == ActiveIndex) + { + //没有其他物体了 + if (ExchangePrev() == index) + { + ActiveIndex = 0; + ActiveItem = null; + } + } + //移除物体 + item.OnRemoveItem(); + item.Master = null; + item.PackageIndex = -1; + // item.GetParent().RemoveChild(item); + // item.Remove(); + return item; + } + + /// + /// 切换到上一个物体 + /// + public int ExchangePrev() + { + var index = ActiveIndex - 1; + do + { + if (index < 0) + { + index = ItemSlot.Length - 1; + } + if (ExchangeByIndex(index)) + { + return index; + } + } while (index-- != ActiveIndex); + return -1; + } + + /// + /// 切换到下一个物体, + /// + public int ExchangeNext() + { + var index = ActiveIndex + 1; + do + { + if (index >= ItemSlot.Length) + { + index = 0; + } + if (ExchangeByIndex(index)) + { + return index; + } + } while (index++ != ActiveIndex); + return -1; + } + + /// + /// 切换到指定索引的物体 + /// + public bool ExchangeByIndex(int index) + { + if (index == ActiveIndex && ActiveItem != null) return true; + if (index < 0 || index > ItemSlot.Length) return false; + var item = ItemSlot[index]; + if (item == null) return false; + + //将上一个物体放到背后 + if (ActiveItem != null) + { + //收起物体 + ActiveItem.OnConcealItem(); + } + + //切换物体 + ActiveItem = item; + ActiveIndex = index; + ActiveItem.OnActiveItem(); + return true; + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/activity/prop/Prop.cs b/DungeonShooting_Godot/src/game/activity/prop/Prop.cs index 47846da..91a73eb 100644 --- a/DungeonShooting_Godot/src/game/activity/prop/Prop.cs +++ b/DungeonShooting_Godot/src/game/activity/prop/Prop.cs @@ -2,13 +2,12 @@ /// /// 道具基类 /// -public abstract partial class Prop : ActivityObject +public abstract partial class Prop : ActivityObject, IPackageItem { - /// - /// 道具的拥有者 - /// - public Role Master { get; private set; } - + public Role Master { get; set; } + + public int PackageIndex { get; set; } = -1; + /// /// 当被动被道具被拾起时调用 /// @@ -48,4 +47,29 @@ } return base.CheckInteractive(master); } + + public void OnRemoveItem() + { + + } + + public void OnPickUpItem() + { + + } + + public void OnActiveItem() + { + + } + + public void OnConcealItem() + { + + } + + public void OnOverflowItem() + { + + } } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/activity/role/Player.cs b/DungeonShooting_Godot/src/game/activity/role/Player.cs index 729abb7..f556597 100644 --- a/DungeonShooting_Godot/src/game/activity/role/Player.cs +++ b/DungeonShooting_Godot/src/game/activity/role/Player.cs @@ -145,7 +145,7 @@ public override void ThrowWeapon() { //扔掉武器 - var weapon = Holster.ActiveWeapon; + var weapon = Holster.ActiveItem; base.ThrowWeapon(); EventManager.EmitEvent(EventEnum.OnPlayerRemoveWeapon, weapon); } @@ -153,7 +153,7 @@ public override void ThrowWeapon(int index) { //扔掉武器 - var weapon = Holster.GetWeapon(index); + var weapon = Holster.GetItem(index); base.ThrowWeapon(index); EventManager.EmitEvent(EventEnum.OnPlayerRemoveWeapon, weapon); } diff --git a/DungeonShooting_Godot/src/game/activity/role/Role.cs b/DungeonShooting_Godot/src/game/activity/role/Role.cs index 5afe001..597e221 100644 --- a/DungeonShooting_Godot/src/game/activity/role/Role.cs +++ b/DungeonShooting_Godot/src/game/activity/role/Role.cs @@ -46,7 +46,7 @@ /// /// 角色携带的武器袋 /// - public Holster Holster { get; private set; } + public Package Holster { get; private set; } /// /// 武器挂载点 @@ -199,6 +199,11 @@ /// 当前角色所看向的对象, 也就是枪口指向的对象 /// public ActivityObject LookTarget { get; set; } + + /// + /// 当前可以互动的物体 + /// + public ActivityObject InteractiveItem { get; private set; } //初始缩放 private Vector2 _startScale; @@ -217,11 +222,6 @@ private float _shieldRecoveryTimer = 0; /// - /// 可以互动的物体 - /// - public ActivityObject InteractiveItem { get; private set; } - - /// /// 当血量改变时调用 /// protected virtual void OnChangeHp(int hp) @@ -306,7 +306,7 @@ public override void OnInit() { - Holster = new Holster(this); + Holster = new Package(this); _startScale = Scale; MountPoint.Master = this; @@ -519,7 +519,7 @@ /// public bool IsAllWeaponTotalAmmoEmpty() { - foreach (var weapon in Holster.Weapons) + foreach (var weapon in Holster.ItemSlot) { if (weapon != null && !weapon.IsTotalAmmoEmpty()) { @@ -537,7 +537,7 @@ /// 是否立即切换到该武器, 默认 true public virtual bool PickUpWeapon(Weapon weapon, bool exchange = true) { - if (Holster.PickupWeapon(weapon, exchange) != -1) + if (Holster.PickupItem(weapon, exchange) != -1) { //从可互动队列中移除 _interactiveItemList.Remove(weapon); @@ -577,7 +577,7 @@ /// 武器在武器袋中的位置 public virtual void ThrowWeapon(int index) { - var weapon = Holster.GetWeapon(index); + var weapon = Holster.GetItem(index); if (weapon == null) { return; @@ -589,7 +589,7 @@ temp.Y = -temp.Y; } //var pos = GlobalPosition + temp.Rotated(weapon.GlobalRotation); - Holster.RemoveWeapon(index); + Holster.RemoveItem(index); //播放抛出效果 weapon.ThrowWeapon(this, GlobalPosition); } @@ -622,9 +622,9 @@ /// public virtual void Reload() { - if (Holster.ActiveWeapon != null) + if (Holster.ActiveItem != null) { - Holster.ActiveWeapon.Reload(); + Holster.ActiveItem.Reload(); } } @@ -633,9 +633,9 @@ /// public virtual void Attack() { - if (Holster.ActiveWeapon != null) + if (Holster.ActiveItem != null) { - Holster.ActiveWeapon.Trigger(); + Holster.ActiveItem.Trigger(); } } diff --git a/DungeonShooting_Godot/src/game/activity/role/enemy/Enemy.cs b/DungeonShooting_Godot/src/game/activity/role/enemy/Enemy.cs index 5895531..fc6ecda 100644 --- a/DungeonShooting_Godot/src/game/activity/role/enemy/Enemy.cs +++ b/DungeonShooting_Godot/src/game/activity/role/enemy/Enemy.cs @@ -111,7 +111,7 @@ protected override void OnDie() { //扔掉所有武器 - var weapons = Holster.GetAndClearWeapon(); + var weapons = Holster.GetAndClearItem(); for (var i = 0; i < weapons.Length; i++) { weapons[i].ThrowWeapon(this); @@ -283,13 +283,13 @@ /// public void EnemyAttack(float delta) { - var weapon = Holster.ActiveWeapon; + var weapon = Holster.ActiveItem; if (weapon != null) { if (weapon.IsTotalAmmoEmpty()) //当前武器弹药打空 { //切换到有子弹的武器 - var index = Holster.FindWeapon((we, i) => !we.IsTotalAmmoEmpty()); + var index = Holster.FindItem((we, i) => !we.IsTotalAmmoEmpty()); if (index != -1) { Holster.ExchangeByIndex(index); @@ -338,9 +338,9 @@ /// 从最小到最大距离的过渡量, 0 - 1, 默认 0.5 public float GetWeaponRange(float weight = 0.5f) { - if (Holster.ActiveWeapon != null) + if (Holster.ActiveItem != null) { - var attribute = Holster.ActiveWeapon.Attribute; + var attribute = Holster.ActiveItem.Attribute; return Mathf.Lerp(attribute.BulletMinDistance, attribute.BulletMaxDistance, weight); } @@ -415,7 +415,7 @@ //拾起地上的武器 if (InteractiveItem is Weapon weapon) { - if (Holster.ActiveWeapon == null) //手上没有武器, 无论如何也要拾起 + if (Holster.ActiveItem == null) //手上没有武器, 无论如何也要拾起 { TriggerInteractive(); return; @@ -427,10 +427,10 @@ return; } - var index = Holster.FindWeapon((we, i) => we.ItemConfig.Id == weapon.ItemConfig.Id); + var index = Holster.FindItem((we, i) => we.ItemConfig.Id == weapon.ItemConfig.Id); if (index != -1) //与武器袋中武器类型相同, 补充子弹 { - if (!Holster.GetWeapon(index).IsAmmoFull()) + if (!Holster.GetItem(index).IsAmmoFull()) { TriggerInteractive(); } @@ -440,7 +440,7 @@ // var index2 = Holster.FindWeapon((we, i) => // we.Attribute.WeightType == weapon.Attribute.WeightType && we.IsTotalAmmoEmpty()); - var index2 = Holster.FindWeapon((we, i) => we.IsTotalAmmoEmpty()); + var index2 = Holster.FindItem((we, i) => we.IsTotalAmmoEmpty()); if (index2 != -1) //扔掉没子弹的武器 { ThrowWeapon(index2); diff --git a/DungeonShooting_Godot/src/game/activity/role/enemy/state/AiFollowUpState.cs b/DungeonShooting_Godot/src/game/activity/role/enemy/state/AiFollowUpState.cs index 1e253ea..2200636 100644 --- a/DungeonShooting_Godot/src/game/activity/role/enemy/state/AiFollowUpState.cs +++ b/DungeonShooting_Godot/src/game/activity/role/enemy/state/AiFollowUpState.cs @@ -64,7 +64,7 @@ //是否在攻击范围内 var inAttackRange = false; - var weapon = Master.Holster.ActiveWeapon; + var weapon = Master.Holster.ActiveItem; if (weapon != null) { inAttackRange = masterPosition.DistanceSquaredTo(playerPos) <= Mathf.Pow(Master.GetWeaponRange(0.7f), 2); diff --git a/DungeonShooting_Godot/src/game/activity/role/enemy/state/AiSurroundState.cs b/DungeonShooting_Godot/src/game/activity/role/enemy/state/AiSurroundState.cs index 9a4c90e..c60e6ad 100644 --- a/DungeonShooting_Godot/src/game/activity/role/enemy/state/AiSurroundState.cs +++ b/DungeonShooting_Godot/src/game/activity/role/enemy/state/AiSurroundState.cs @@ -53,7 +53,7 @@ } var playerPos = Player.Current.GetCenterPosition(); - var weapon = Master.Holster.ActiveWeapon; + var weapon = Master.Holster.ActiveItem; //枪口指向玩家 Master.LookTargetPosition(playerPos); @@ -160,7 +160,7 @@ private void RunOver(Vector2 targetPos) { - var weapon = Master.Holster.ActiveWeapon; + var weapon = Master.Holster.ActiveItem; var distance = (int)(weapon == null ? 150 : (weapon.Attribute.BulletMinDistance * 0.7f)); _nextPosition = new Vector2( targetPos.X + Utils.RandomRangeInt(-distance, distance), diff --git a/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs b/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs index 8be8ddb..ca7cd48 100644 --- a/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs +++ b/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs @@ -6,7 +6,7 @@ /// /// 武器的基类 /// -public abstract partial class Weapon : ActivityObject +public abstract partial class Weapon : ActivityObject, IPackageItem { /// /// 武器属性数据 @@ -21,10 +21,9 @@ /// public CampEnum TargetCamp { get; set; } - /// - /// 该武器的拥有者 - /// - public Role Master { get; private set; } + public Role Master { get; set; } + + public int PackageIndex { get; set; } = -1; /// /// 当前弹夹弹药剩余量 @@ -117,7 +116,7 @@ /// /// 返回是否真正使用该武器 /// - public bool IsActive => Master != null && Master.Holster.ActiveWeapon == this; + public bool IsActive => Master != null && Master.Holster.ActiveItem == this; /// /// 动画播放器 @@ -415,7 +414,7 @@ _noAttackTime += delta; //这把武器被扔在地上, 或者当前武器没有被使用 - if (Master == null || Master.Holster.ActiveWeapon != this) + if (Master == null || Master.Holster.ActiveItem != this) { //_triggerTimer _triggerTimer = _triggerTimer > 0 ? _triggerTimer - delta : 0; @@ -1440,14 +1439,14 @@ { if (Master == null) { - var masterWeapon = roleMaster.Holster.ActiveWeapon; + var masterWeapon = roleMaster.Holster.ActiveItem; //查找是否有同类型武器 - var index = roleMaster.Holster.FindWeapon(ItemConfig.Id); + var index = roleMaster.Holster.FindItem(ItemConfig.Id); if (index != -1) //如果有这个武器 { if (CurrAmmo + ResidueAmmo != 0) //子弹不为空 { - var targetWeapon = roleMaster.Holster.GetWeapon(index); + var targetWeapon = roleMaster.Holster.GetItem(index); if (!targetWeapon.IsAmmoFull()) //背包里面的武器子弹未满 { //可以互动拾起弹药 @@ -1459,7 +1458,7 @@ } else //没有武器 { - if (roleMaster.Holster.CanPickupWeapon(this)) //能拾起武器 + if (roleMaster.Holster.CanPickupItem(this)) //能拾起武器 { //可以互动, 拾起武器 result.CanInteractive = true; @@ -1486,7 +1485,7 @@ { var holster = roleMaster.Holster; //查找是否有同类型武器 - var index = holster.FindWeapon(ItemConfig.Id); + var index = holster.FindItem(ItemConfig.Id); if (index != -1) //如果有这个武器 { if (CurrAmmo + ResidueAmmo == 0) //没有子弹了 @@ -1494,7 +1493,7 @@ return; } - var weapon = holster.GetWeapon(index); + var weapon = holster.GetItem(index); //子弹上限 var maxCount = Attribute.MaxAmmoCapacity; //是否捡到子弹 @@ -1535,7 +1534,7 @@ } else //没有武器 { - if (holster.PickupWeapon(this) == -1) + if (holster.PickupItem(this) == -1) { //替换武器 roleMaster.ThrowWeapon(); @@ -1609,12 +1608,42 @@ } /// - /// 触发拾起到 Holster, 这个函数由 Holster 对象调用 + /// 触发启用武器, 这个函数由 Holster 对象调用 /// - public void PickUpWeapon(Role master) + private void Active() { - Master = master; - if (master.IsAi) + //调整阴影 + ShadowOffset = new Vector2(0, Master.GlobalPosition.Y - GlobalPosition.Y); + //枪口默认抬起角度 + RotationDegrees = -Attribute.DefaultAngle; + ShowShadowSprite(); + OnActive(); + } + + /// + /// 触发收起武器, 这个函数由 Holster 对象调用 + /// + private void Conceal() + { + HideShadowSprite(); + OnConceal(); + } + + public void OnRemoveItem() + { + GetParent().RemoveChild(this); + CollisionLayer = _tempLayer; + _weaponAttribute = _playerWeaponAttribute; + AnimatedSprite.Position = _tempAnimatedSpritePosition; + //清除 Ai 拾起标记 + RemoveSign(SignNames.AiFindWeaponSign); + OnRemove(Master); + } + + public void OnPickUpItem() + { + Pickup(); + if (Master.IsAi) { _weaponAttribute = _aiWeaponAttribute; } @@ -1638,44 +1667,45 @@ CollisionLayer = PhysicsLayer.OnHand; //清除 Ai 拾起标记 RemoveSign(SignNames.AiFindWeaponSign); - OnPickUp(master); + OnPickUp(Master); } - /// - /// 触发从 Holster 中移除, 这个函数由 Holster 对象调用 - /// - public void RemoveAt() + public void OnActiveItem() { - var master = Master; - Master = null; - CollisionLayer = _tempLayer; - _weaponAttribute = _playerWeaponAttribute; - AnimatedSprite.Position = _tempAnimatedSpritePosition; - //清除 Ai 拾起标记 - RemoveSign(SignNames.AiFindWeaponSign); - OnRemove(master); + //更改父节点 + var parent = GetParentOrNull(); + if (parent == null) + { + Master.MountPoint.AddChild(this); + } + else if (parent != Master.MountPoint) + { + parent.RemoveChild(this); + Master.MountPoint.AddChild(this); + } + + Position = Vector2.Zero; + Scale = Vector2.One; + RotationDegrees = 0; + Visible = true; + Active(); } - /// - /// 触发启用武器 - /// - public void Active() + public void OnConcealItem() { - //调整阴影 - ShadowOffset = new Vector2(0, Master.GlobalPosition.Y - GlobalPosition.Y); - //枪口默认抬起角度 - RotationDegrees = -Attribute.DefaultAngle; - ShowShadowSprite(); - OnActive(); + var tempParent = GetParentOrNull(); + if (tempParent != null) + { + tempParent.RemoveChild(this); + Master.BackMountPoint.AddChild(this); + Master.OnPutBackMount(this, PackageIndex); + Conceal(); + } } - /// - /// 触发收起武器 - /// - public void Conceal() + public void OnOverflowItem() { - HideShadowSprite(); - OnConceal(); + Master.ThrowWeapon(PackageIndex); } //-------------------------- ----- 子弹相关 ----------------------------- diff --git a/DungeonShooting_Godot/src/game/ui/roomUI/ReloadBar.cs b/DungeonShooting_Godot/src/game/ui/roomUI/ReloadBar.cs index e593d8b..b1b9e93 100644 --- a/DungeonShooting_Godot/src/game/ui/roomUI/ReloadBar.cs +++ b/DungeonShooting_Godot/src/game/ui/roomUI/ReloadBar.cs @@ -56,9 +56,9 @@ public void OnCameraPositionUpdate(float delta) { var player = Player.Current; - if (player.Holster.ActiveWeapon != null && player.Holster.ActiveWeapon.Reloading) + if (player.Holster.ActiveItem != null && player.Holster.ActiveItem.Reloading) { - ShowBar(player.GlobalPosition, player.Holster.ActiveWeapon.ReloadProgress); + ShowBar(player.GlobalPosition, player.Holster.ActiveItem.ReloadProgress); } else { diff --git a/DungeonShooting_Godot/src/game/ui/roomUI/WeaponBar.cs b/DungeonShooting_Godot/src/game/ui/roomUI/WeaponBar.cs index e017b85..3f3c062 100644 --- a/DungeonShooting_Godot/src/game/ui/roomUI/WeaponBar.cs +++ b/DungeonShooting_Godot/src/game/ui/roomUI/WeaponBar.cs @@ -25,7 +25,7 @@ public void Process(float delta) { - var weapon = Player.Current?.Holster.ActiveWeapon; + var weapon = Player.Current?.Holster.ActiveItem; if (weapon != null) { SetWeaponTexture(weapon.GetCurrentTexture());