diff --git a/DungeonShooting_Godot/DungeonShooting.csproj b/DungeonShooting_Godot/DungeonShooting.csproj index ef9302f..4c62c1b 100644 --- a/DungeonShooting_Godot/DungeonShooting.csproj +++ b/DungeonShooting_Godot/DungeonShooting.csproj @@ -1,4 +1,4 @@ - + net6.0 true diff --git a/DungeonShooting_Godot/DungeonShooting.csproj.old.4 b/DungeonShooting_Godot/DungeonShooting.csproj.old.4 new file mode 100644 index 0000000..ef9302f --- /dev/null +++ b/DungeonShooting_Godot/DungeonShooting.csproj.old.4 @@ -0,0 +1,11 @@ + + + net6.0 + true + + + + + + + \ No newline at end of file diff --git a/DungeonShooting_Godot/prefab/effect/activityObject/Effect0001.tscn b/DungeonShooting_Godot/prefab/effect/activityObject/Effect0001.tscn index d83da8c..3ba7ecc 100644 --- a/DungeonShooting_Godot/prefab/effect/activityObject/Effect0001.tscn +++ b/DungeonShooting_Godot/prefab/effect/activityObject/Effect0001.tscn @@ -16,7 +16,6 @@ shader_parameter/outline_rainbow = false [sub_resource type="ShaderMaterial" id="ShaderMaterial_08fn3"] -resource_local_to_scene = true shader = ExtResource("2_b3d83") shader_parameter/blend = Color(1, 1, 1, 1) shader_parameter/schedule = 0.0 diff --git a/DungeonShooting_Godot/prefab/ui/RoomUI.tscn b/DungeonShooting_Godot/prefab/ui/RoomUI.tscn index 7449887..13605aa 100644 --- a/DungeonShooting_Godot/prefab/ui/RoomUI.tscn +++ b/DungeonShooting_Godot/prefab/ui/RoomUI.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=14 format=3 uid="uid://bvpmtfupny8iu"] [ext_resource type="Script" path="res://src/game/ui/roomUI/RoomUIPanel.cs" id="1_tfcrp"] -[ext_resource type="Texture2D" uid="uid://b67i86mtqrn32" path="res://resource/sprite/ui/icon/icon_bullet.png" id="2_a2ohq"] +[ext_resource type="Texture2D" uid="uid://b67i86mtqrn32" path="res://resource/sprite/ui/roomUI/icon_bullet.png" id="2_ruc0p"] [ext_resource type="Texture2D" uid="uid://dxstii6f4l8m0" path="res://resource/sprite/ui/keyboard/e.png" id="3_h7n2a"] [ext_resource type="Texture2D" uid="uid://cukrx5yyqw86o" path="res://resource/sprite/ui/roomUI/ReloadBar.png" id="4_hy44s"] [ext_resource type="Texture2D" uid="uid://cx3i1nkcc4307" path="res://resource/sprite/ui/roomUI/ReloadBarBlock.png" id="5_w3lq2"] @@ -53,7 +53,7 @@ offset_bottom = -18.0 grow_horizontal = 2 grow_vertical = 2 -texture = ExtResource("2_a2ohq") +texture = ExtResource("2_ruc0p") [node name="InteractiveIcon" type="TextureRect" parent="InteractiveTipBar"] visible = false diff --git a/DungeonShooting_Godot/project.godot b/DungeonShooting_Godot/project.godot index 20e8ef6..5b792d1 100644 --- a/DungeonShooting_Godot/project.godot +++ b/DungeonShooting_Godot/project.godot @@ -132,12 +132,12 @@ "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":83,"physical_keycode":0,"key_label":0,"unicode":115,"echo":false,"script":null) ] } -exchange={ +exchangeWeapon={ "deadzone": 0.5, "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":81,"physical_keycode":0,"key_label":0,"unicode":113,"echo":false,"script":null) ] } -throw={ +throwWeapon={ "deadzone": 0.5, "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":71,"physical_keycode":0,"key_label":0,"unicode":103,"echo":false,"script":null) ] @@ -172,6 +172,11 @@ "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":32,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null) ] } +useActiveProp={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":70,"physical_keycode":0,"key_label":0,"unicode":102,"echo":false,"script":null) +] +} [layer_names] diff --git a/DungeonShooting_Godot/resource/sprite/role/enemy0001/Enemy0001.png.import b/DungeonShooting_Godot/resource/sprite/role/enemy0001/Enemy0001.png.import index b20c9a6..c36be94 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-1247a3ddf8a1a163d812cad12c4340fd.ctex" +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-1247a3ddf8a1a163d812cad12c4340fd.ctex"] +source_file="res://resource/sprite/role/enemy0001/Enemy0001.png" +dest_files=["res://.godot/imported/Enemy0001.png-148a38dfa95953b26d890356e8875de4.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 56388a2..d563acf 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-297a2fb6680cb862a9a085cf58f8268c.ctex" +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-297a2fb6680cb862a9a085cf58f8268c.ctex"] +source_file="res://resource/sprite/role/enemy0001/Enemy0001_Debris.png" +dest_files=["res://.godot/imported/Enemy0001_Debris.png-ac416dc79cd3c1217b27e1ef1fbe0d0b.ctex"] [params] diff --git a/DungeonShooting_Godot/resource/sprite/ui/icon/icon_bullet.png b/DungeonShooting_Godot/resource/sprite/ui/icon/icon_bullet.png deleted file mode 100644 index 6afda7f..0000000 --- a/DungeonShooting_Godot/resource/sprite/ui/icon/icon_bullet.png +++ /dev/null Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/icon/icon_bullet.png.import b/DungeonShooting_Godot/resource/sprite/ui/icon/icon_bullet.png.import deleted file mode 100644 index 80a074a..0000000 --- a/DungeonShooting_Godot/resource/sprite/ui/icon/icon_bullet.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://b67i86mtqrn32" -path="res://.godot/imported/icon_bullet.png-c2767feaa9ebe0084fe04f619ec7ad30.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://resource/sprite/ui/icon/icon_bullet.png" -dest_files=["res://.godot/imported/icon_bullet.png-c2767feaa9ebe0084fe04f619ec7ad30.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/ui/icon/icon_pickup.png b/DungeonShooting_Godot/resource/sprite/ui/icon/icon_pickup.png deleted file mode 100644 index 617b0ae..0000000 --- a/DungeonShooting_Godot/resource/sprite/ui/icon/icon_pickup.png +++ /dev/null Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/icon/icon_pickup.png.import b/DungeonShooting_Godot/resource/sprite/ui/icon/icon_pickup.png.import deleted file mode 100644 index d1e2ec4..0000000 --- a/DungeonShooting_Godot/resource/sprite/ui/icon/icon_pickup.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://defqbeh0lufxq" -path="res://.godot/imported/icon_pickup.png-87270fcf0757cfa3230028f25ad3ee19.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://resource/sprite/ui/icon/icon_pickup.png" -dest_files=["res://.godot/imported/icon_pickup.png-87270fcf0757cfa3230028f25ad3ee19.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/ui/icon/icon_replace.png b/DungeonShooting_Godot/resource/sprite/ui/icon/icon_replace.png deleted file mode 100644 index 640b4be..0000000 --- a/DungeonShooting_Godot/resource/sprite/ui/icon/icon_replace.png +++ /dev/null Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/icon/icon_replace.png.import b/DungeonShooting_Godot/resource/sprite/ui/icon/icon_replace.png.import deleted file mode 100644 index 99aacb8..0000000 --- a/DungeonShooting_Godot/resource/sprite/ui/icon/icon_replace.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://dy6agj7ogwl4b" -path="res://.godot/imported/icon_replace.png-6e605c83622b5a2d459c2a9108a7d72a.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://resource/sprite/ui/icon/icon_replace.png" -dest_files=["res://.godot/imported/icon_replace.png-6e605c83622b5a2d459c2a9108a7d72a.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/ui/roomUI/icon_bullet.png b/DungeonShooting_Godot/resource/sprite/ui/roomUI/icon_bullet.png new file mode 100644 index 0000000..e5f56d9 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/roomUI/icon_bullet.png Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/roomUI/icon_bullet.png.import b/DungeonShooting_Godot/resource/sprite/ui/roomUI/icon_bullet.png.import new file mode 100644 index 0000000..204b41a --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/roomUI/icon_bullet.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b67i86mtqrn32" +path="res://.godot/imported/icon_bullet.png-73a9184f834a317937e34f30a3077866.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/ui/roomUI/icon_bullet.png" +dest_files=["res://.godot/imported/icon_bullet.png-73a9184f834a317937e34f30a3077866.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/ui/roomUI/icon_pickup.png b/DungeonShooting_Godot/resource/sprite/ui/roomUI/icon_pickup.png new file mode 100644 index 0000000..8588bdd --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/roomUI/icon_pickup.png Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/roomUI/icon_pickup.png.import b/DungeonShooting_Godot/resource/sprite/ui/roomUI/icon_pickup.png.import new file mode 100644 index 0000000..e284191 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/roomUI/icon_pickup.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://defqbeh0lufxq" +path="res://.godot/imported/icon_pickup.png-999581fda76ef45d7110fa7eddd1fbdc.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/ui/roomUI/icon_pickup.png" +dest_files=["res://.godot/imported/icon_pickup.png-999581fda76ef45d7110fa7eddd1fbdc.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/ui/roomUI/icon_replace.png b/DungeonShooting_Godot/resource/sprite/ui/roomUI/icon_replace.png new file mode 100644 index 0000000..8129c52 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/roomUI/icon_replace.png Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/roomUI/icon_replace.png.import b/DungeonShooting_Godot/resource/sprite/ui/roomUI/icon_replace.png.import new file mode 100644 index 0000000..877b927 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/roomUI/icon_replace.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dy6agj7ogwl4b" +path="res://.godot/imported/icon_replace.png-6f4af84637234fb9af6615a381704ed6.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/ui/roomUI/icon_replace.png" +dest_files=["res://.godot/imported/icon_replace.png-6f4af84637234fb9af6615a381704ed6.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/theme/mainTheme.tres b/DungeonShooting_Godot/resource/theme/mainTheme.tres index 668332a..8fd1a0e 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_53iwr"] +[sub_resource type="Image" id="Image_bp5nu"] 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_53iwr") +image = SubResource("Image_bp5nu") [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_sxg3y"] +[sub_resource type="Image" id="Image_7vkec"] 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_sxg3y") +image = SubResource("Image_7vkec") [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_gteoy"] +[sub_resource type="Image" id="Image_fdr5k"] 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_gteoy") +image = SubResource("Image_fdr5k") [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_fr7jb"] +[sub_resource type="Image" id="Image_r34yi"] 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_fr7jb") +image = SubResource("Image_r34yi") [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_6yo53"] +[sub_resource type="Image" id="Image_mj58c"] 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_6yo53") +image = SubResource("Image_mj58c") [sub_resource type="StyleBoxFlat" id="57"] content_margin_left = 6.0 diff --git a/DungeonShooting_Godot/src/framework/activity/CheckInteractiveResult.cs b/DungeonShooting_Godot/src/framework/activity/CheckInteractiveResult.cs index 7603ef9..de50959 100644 --- a/DungeonShooting_Godot/src/framework/activity/CheckInteractiveResult.cs +++ b/DungeonShooting_Godot/src/framework/activity/CheckInteractiveResult.cs @@ -1,9 +1,27 @@ +using Godot; + /// /// 检测互动返回的数据集 /// public class CheckInteractiveResult { + public enum InteractiveType + { + /// + /// 拾起物体 + /// + PickUp, + /// + /// 拾起弹药 + /// + Bullet, + /// + /// 替换 + /// + Replace, + } + /// /// 互动物体 /// @@ -13,9 +31,9 @@ /// public bool CanInteractive; /// - /// 互动提示显示的图标 + /// 互动提示类型 /// - public string ShowIcon; + public InteractiveType Type = InteractiveType.PickUp; public CheckInteractiveResult(ActivityObject target) { @@ -28,10 +46,44 @@ CanInteractive = canInteractive; } - public CheckInteractiveResult(ActivityObject target, bool canInteractive, string showIcon) + public CheckInteractiveResult(ActivityObject target, bool canInteractive, InteractiveType type) { Target = target; CanInteractive = canInteractive; - ShowIcon = showIcon; + Type = type; + } + + /// + /// 互动提示显示的图标 + /// + public Texture2D GetIcon() + { + if (!_init) + { + Init(); + } + switch (Type) + { + case InteractiveType.PickUp: + return _pickUpIcon; + case InteractiveType.Bullet: + return _bulletIcon; + case InteractiveType.Replace: + return _replaceIcon; + } + + return null; + } + + private static Texture2D _pickUpIcon; + private static Texture2D _bulletIcon; + private static Texture2D _replaceIcon; + private static bool _init = false; + private static void Init() + { + _init = true; + _pickUpIcon = ResourceManager.Load(ResourcePath.resource_sprite_ui_roomUI_icon_pickup_png); + _bulletIcon = ResourceManager.Load(ResourcePath.resource_sprite_ui_roomUI_icon_bullet_png); + _replaceIcon = ResourceManager.Load(ResourcePath.resource_sprite_ui_roomUI_icon_replace_png); } } \ 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 91a73eb..ef1879d 100644 --- a/DungeonShooting_Godot/src/game/activity/prop/Prop.cs +++ b/DungeonShooting_Godot/src/game/activity/prop/Prop.cs @@ -33,7 +33,6 @@ if (master is Role role) { Pickup(); - Master = role; role.PushProp(this); OnPickUp(role); } @@ -43,7 +42,7 @@ { if (master is Player) { - return new CheckInteractiveResult(this, true, ResourcePath.resource_sprite_ui_icon_icon_pickup_png); + return new CheckInteractiveResult(this, true, CheckInteractiveResult.InteractiveType.PickUp); } return base.CheckInteractive(master); } diff --git a/DungeonShooting_Godot/src/game/activity/prop/active/ActiveProp.cs b/DungeonShooting_Godot/src/game/activity/prop/active/ActiveProp.cs index 2e255d3..26cc05e 100644 --- a/DungeonShooting_Godot/src/game/activity/prop/active/ActiveProp.cs +++ b/DungeonShooting_Godot/src/game/activity/prop/active/ActiveProp.cs @@ -5,21 +5,64 @@ public abstract partial class ActiveProp : Prop { /// + /// 道具可使用次数 + /// + public int Count { get; set; } = 1; + + /// + /// 道具最大可使用次数 + /// + public int MaxCount { get; set; } = 1; + + /// + /// 道具当前叠加数量 + /// + public int OverlaysCount { get; set; } = 1; + + /// + /// 道具最大叠加数量 + /// + public int MaxOverlaysCount { get; set; } = 1; + + /// + /// 使用一次后的冷却时间, 单位: 秒 + /// + public float CooldownTime { get; set; } = 1f; + + /// + /// 当道具使用完后是否自动销毁 + /// + public bool AutoDestroy { get; set; } = true; + + /// + /// 道具充能进度, 必须要充能完成才能使用, 值范围: 0 - 1 + /// + public float ChargeProgress { get; set; } = 1; + + /// /// 是否可以使用 /// - public bool CanUse { get; set; } + public abstract bool CanUse(); /// /// 当道具被使用时调用 /// protected abstract void OnUse(); + protected override void OnPickUp(Role master) + { + } + + protected override void OnRemove(Role master) + { + } + /// /// 触发使用道具 /// public void Use() { - if (CanUse) + if (ChargeProgress >= 1 && CanUse()) { OnUse(); } diff --git a/DungeonShooting_Godot/src/game/activity/prop/active/ActiveProp5000.cs b/DungeonShooting_Godot/src/game/activity/prop/active/ActiveProp5000.cs index 53dd30d..4e4202b 100644 --- a/DungeonShooting_Godot/src/game/activity/prop/active/ActiveProp5000.cs +++ b/DungeonShooting_Godot/src/game/activity/prop/active/ActiveProp5000.cs @@ -4,18 +4,13 @@ [Tool] public partial class ActiveProp5000 : ActiveProp { - protected override void OnPickUp(Role master) + public override bool CanUse() { - - } - - protected override void OnRemove(Role master) - { - + return !Master.IsHpFull(); } protected override void OnUse() { - GD.Print("使用道具..."); + Master.Hp += 2; } } \ 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 d3ed34d..02867ee 100644 --- a/DungeonShooting_Godot/src/game/activity/role/Player.cs +++ b/DungeonShooting_Godot/src/game/activity/role/Player.cs @@ -112,6 +112,11 @@ Attack(); } + if (InputManager.UseActiveProp) //使用道具 + { + UseActiveProp(); + } + if (Input.IsKeyPressed(Key.P)) { Hurt(1000, 0); diff --git a/DungeonShooting_Godot/src/game/activity/role/Role.cs b/DungeonShooting_Godot/src/game/activity/role/Role.cs index 5a7878c..c796fa2 100644 --- a/DungeonShooting_Godot/src/game/activity/role/Role.cs +++ b/DungeonShooting_Godot/src/game/activity/role/Role.cs @@ -39,9 +39,14 @@ public uint AttackLayer { get; set; } = PhysicsLayer.Wall; /// - /// 携带的道具包裹 + /// 携带的被动道具包裹 /// - public Package PropsPack { get; private set; } + public List BuffPropPack { get; } = new List(); + + /// + /// 携带的主动道具包裹 + /// + public Package ActivePropsPack { get; private set; } /// /// 角色携带的武器背包 @@ -85,7 +90,7 @@ set { int temp = _hp; - _hp = value; + _hp = Mathf.Clamp(value, 0, _maxHp); if (temp != _hp) { OnChangeHp(_hp); @@ -306,7 +311,7 @@ public override void OnInit() { - PropsPack = new Package(this); + ActivePropsPack = new Package(this); WeaponPack = new Package(this); _startScale = Scale; MountPoint.Master = this; @@ -367,7 +372,7 @@ InteractiveItem = item; ChangeInteractiveItem(prev, result); } - else if (result.ShowIcon != _currentResultData.ShowIcon) //切换状态 + else if (result.Type != _currentResultData.Type) //切换状态 { ChangeInteractiveItem(prev, result); } @@ -423,8 +428,18 @@ } } - //道具调用更新 - var props = (Prop[])PropsPack.ItemSlot.Clone(); + //被动道具更新 + if (BuffPropPack.Count > 0) + { + var buffProps = BuffPropPack.ToArray(); + foreach (var prop in buffProps) + { + prop.PackProcess(delta); + } + } + + //主动道具调用更新 + var props = (Prop[])ActivePropsPack.ItemSlot.Clone(); foreach (var prop in props) { if (prop != null) @@ -479,6 +494,14 @@ } /// + /// 是否是满血 + /// + public bool IsHpFull() + { + return Hp >= MaxHp; + } + + /// /// 获取当前角色的中心点坐标 /// public Vector2 GetCenterPosition() @@ -644,6 +667,18 @@ } /// + /// 触发使用道具 + /// + public virtual void UseActiveProp() + { + var activeItem = ActivePropsPack.ActiveItem; + if (activeItem != null) + { + activeItem.Use(); + } + } + + /// /// 受到伤害, 如果是在碰撞信号处理函数中调用该函数, 请使用 CallDeferred 来延时调用, 否则很有可能导致报错 /// /// 伤害的量 @@ -793,12 +828,29 @@ /// public void PushProp(Prop prop) { - if (PropsPack.PickupItem(prop) == -1) + if (prop is ActiveProp activeProp) //主动道具 { - GD.PrintErr("道具无法存入背包中!"); - return; + if (ActivePropsPack.PickupItem(activeProp) == -1) + { + GD.PrintErr("主动道具无法存入背包中!"); + return; + } + OnPushProp(prop); } - OnPushProp(prop); + else if (prop is BuffProp buffProp) //被动道具 + { + if (BuffPropPack.Contains(buffProp)) + { + GD.PrintErr("被动道具已经在背包中了!"); + return; + } + BuffPropPack.Add(buffProp); + OnPushProp(prop); + } + else + { + GD.PrintErr("尚未被支持的道具类型: " + prop.GetType().FullName); + } } /// @@ -806,12 +858,28 @@ /// public bool RemoveProp(Prop prop) { - if (PropsPack.RemoveItem(prop) != null) + if (prop is ActiveProp activeProp) //主动道具 { - OnRemoveProp(prop); - return true; + if (ActivePropsPack.RemoveItem(activeProp) != null) + { + OnRemoveProp(prop); + return true; + } + GD.PrintErr("当前道具不在角色背包中!"); + return false; } - GD.PrintErr("当前道具不在角色背包中!"); + else if (prop is BuffProp buffProp) //被动道具 + { + if (BuffPropPack.Contains(buffProp)) + { + OnRemoveProp(prop); + BuffPropPack.Remove(buffProp); + return true; + } + GD.PrintErr("被动道具不在背包中!"); + return false; + } + GD.PrintErr("尚未被支持的道具类型: " + prop.GetType().FullName); return false; } } \ 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 9a0d562..223f47b 100644 --- a/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs +++ b/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs @@ -1451,7 +1451,7 @@ { //可以互动拾起弹药 result.CanInteractive = true; - result.ShowIcon = ResourcePath.resource_sprite_ui_icon_icon_bullet_png; + result.Type = CheckInteractiveResult.InteractiveType.Bullet; return result; } } @@ -1462,14 +1462,14 @@ { //可以互动, 拾起武器 result.CanInteractive = true; - result.ShowIcon = ResourcePath.resource_sprite_ui_icon_icon_pickup_png; + result.Type = CheckInteractiveResult.InteractiveType.PickUp; return result; } else if (masterWeapon != null) //替换武器 // && masterWeapon.Attribute.WeightType == Attribute.WeightType) { //可以互动, 切换武器 result.CanInteractive = true; - result.ShowIcon = ResourcePath.resource_sprite_ui_icon_icon_replace_png; + result.Type = CheckInteractiveResult.InteractiveType.Replace; return result; } } diff --git a/DungeonShooting_Godot/src/game/manager/InputManager.cs b/DungeonShooting_Godot/src/game/manager/InputManager.cs index e19d61c..1dd83ac 100644 --- a/DungeonShooting_Godot/src/game/manager/InputManager.cs +++ b/DungeonShooting_Godot/src/game/manager/InputManager.cs @@ -34,7 +34,7 @@ /// /// 是否按下使用道具按钮, 键鼠: 键盘F /// - public static bool UseProp { get; private set; } + public static bool UseActiveProp { get; private set; } /// /// 是否按下切换道具按钮, 键鼠: 键盘Z @@ -84,13 +84,13 @@ var application = GameApplication.Instance; MoveAxis = Input.GetVector("move_left", "move_right", "move_up", "move_down"); CursorPosition = application.GlobalToViewPosition(application.GetGlobalMousePosition()); - ExchangeWeapon = Input.IsActionJustPressed("exchange"); - ThrowWeapon = Input.IsActionJustPressed("throw"); + ExchangeWeapon = Input.IsActionJustPressed("exchangeWeapon"); + ThrowWeapon = Input.IsActionJustPressed("throwWeapon"); Interactive = Input.IsActionJustPressed("interactive"); Reload = Input.IsActionJustPressed("reload"); Fire = Input.IsActionPressed("fire"); - MeleeAttack = Input.IsActionPressed("meleeAttack"); - Roll = Input.IsActionPressed("roll"); + MeleeAttack = Input.IsActionJustPressed("meleeAttack"); + Roll = Input.IsActionJustPressed("roll"); + UseActiveProp = Input.IsActionJustPressed("useActiveProp"); } - } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/manager/ResourcePath.cs b/DungeonShooting_Godot/src/game/manager/ResourcePath.cs index 4a06581..a13ebeb 100644 --- a/DungeonShooting_Godot/src/game/manager/ResourcePath.cs +++ b/DungeonShooting_Godot/src/game/manager/ResourcePath.cs @@ -24,6 +24,8 @@ public const string prefab_map_RoomDoor_N_tscn = "res://prefab/map/RoomDoor_N.tscn"; public const string prefab_map_RoomDoor_S_tscn = "res://prefab/map/RoomDoor_S.tscn"; public const string prefab_map_RoomDoor_W_tscn = "res://prefab/map/RoomDoor_W.tscn"; + public const string prefab_prop_PropTemplate_tscn = "res://prefab/prop/PropTemplate.tscn"; + public const string prefab_prop_active_ActiveProp5000_tscn = "res://prefab/prop/active/ActiveProp5000.tscn"; public const string prefab_prop_buff_BuffProp0001_tscn = "res://prefab/prop/buff/BuffProp0001.tscn"; public const string prefab_prop_buff_BuffProp0002_tscn = "res://prefab/prop/buff/BuffProp0002.tscn"; public const string prefab_prop_buff_BuffProp0003_tscn = "res://prefab/prop/buff/BuffProp0003.tscn"; @@ -156,10 +158,10 @@ public const string resource_sprite_ui_cursors_png = "res://resource/sprite/ui/cursors.png"; public const string resource_sprite_ui_font_bg_png = "res://resource/sprite/ui/font_bg.png"; public const string resource_sprite_ui_GUI_png = "res://resource/sprite/ui/GUI.png"; - public const string resource_sprite_ui_icon_icon_bullet_png = "res://resource/sprite/ui/icon/icon_bullet.png"; - public const string resource_sprite_ui_icon_icon_pickup_png = "res://resource/sprite/ui/icon/icon_pickup.png"; - public const string resource_sprite_ui_icon_icon_replace_png = "res://resource/sprite/ui/icon/icon_replace.png"; public const string resource_sprite_ui_keyboard_e_png = "res://resource/sprite/ui/keyboard/e.png"; + public const string resource_sprite_ui_roomUI_icon_bullet_png = "res://resource/sprite/ui/roomUI/icon_bullet.png"; + public const string resource_sprite_ui_roomUI_icon_pickup_png = "res://resource/sprite/ui/roomUI/icon_pickup.png"; + public const string resource_sprite_ui_roomUI_icon_replace_png = "res://resource/sprite/ui/roomUI/icon_replace.png"; public const string resource_sprite_ui_roomUI_Life_empty_png = "res://resource/sprite/ui/roomUI/Life_empty.png"; public const string resource_sprite_ui_roomUI_Life_full_png = "res://resource/sprite/ui/roomUI/Life_full.png"; public const string resource_sprite_ui_roomUI_Life_half_png = "res://resource/sprite/ui/roomUI/Life_half.png"; @@ -190,6 +192,7 @@ public const string resource_spriteFrames_effect_KnifeHit1_tres = "res://resource/spriteFrames/effect/KnifeHit1.tres"; public const string resource_spriteFrames_other_RoomDoor_EW_tres = "res://resource/spriteFrames/other/RoomDoor_EW.tres"; public const string resource_spriteFrames_other_RoomDoor_NS_tres = "res://resource/spriteFrames/other/RoomDoor_NS.tres"; + public const string resource_spriteFrames_prop_active_ActiveProp5000_tres = "res://resource/spriteFrames/prop/active/ActiveProp5000.tres"; public const string resource_spriteFrames_prop_buff_BuffProp0001_tres = "res://resource/spriteFrames/prop/buff/BuffProp0001.tres"; public const string resource_spriteFrames_prop_buff_BuffProp0002_tres = "res://resource/spriteFrames/prop/buff/BuffProp0002.tres"; public const string resource_spriteFrames_prop_buff_BuffProp0003_tres = "res://resource/spriteFrames/prop/buff/BuffProp0003.tres"; diff --git a/DungeonShooting_Godot/src/game/ui/roomUI/ActivePropBar.cs b/DungeonShooting_Godot/src/game/ui/roomUI/ActivePropBar.cs index d17e6b2..6ced339 100644 --- a/DungeonShooting_Godot/src/game/ui/roomUI/ActivePropBar.cs +++ b/DungeonShooting_Godot/src/game/ui/roomUI/ActivePropBar.cs @@ -24,9 +24,10 @@ public void Process(float delta) { - var prop = Player.Current?.PropsPack.ActiveItem; + var prop = Player.Current?.ActivePropsPack.ActiveItem; if (prop != null) { + SetActivePropCount(prop.Count); SetActivePropTexture(prop.GetCurrentTexture()); } else @@ -47,4 +48,17 @@ _activePropBar.Instance.Visible = false; } } + + public void SetActivePropCount(int count) + { + if (count > 1) + { + _activePropBar.L_ActivePropPanel.L_ActivePropCount.Instance.Visible = true; + _activePropBar.L_ActivePropPanel.L_ActivePropCount.Instance.Text = count.ToString(); + } + else + { + _activePropBar.L_ActivePropPanel.L_ActivePropCount.Instance.Visible = false; + } + } } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/ui/roomUI/InteractiveTipBar.cs b/DungeonShooting_Godot/src/game/ui/roomUI/InteractiveTipBar.cs index db7ad3c..0779db9 100644 --- a/DungeonShooting_Godot/src/game/ui/roomUI/InteractiveTipBar.cs +++ b/DungeonShooting_Godot/src/game/ui/roomUI/InteractiveTipBar.cs @@ -8,7 +8,6 @@ public class InteractiveTipBar { private RoomUI.UiNode_InteractiveTipBar _interactiveTipBar; - private string _currImage; private EventBinder _binder; private ActivityObject _interactiveTarget; @@ -45,14 +44,10 @@ /// 所在坐标 /// 显示文本 /// 显示图标 - public void ShowBar(ActivityObject target, string showText, string icon) + public void ShowBar(ActivityObject target, string showText, Texture2D icon) { _interactiveTipBar.Instance.GlobalPosition = target.GlobalPosition; - if (_currImage != icon) - { - _currImage = icon; - _interactiveTipBar.L_Icon.Instance.Texture = ResourceManager.Load(icon); - } + _interactiveTipBar.L_Icon.Instance.Texture = icon; _interactiveTipBar.Instance.Visible = true; _interactiveTipBar.L_NameLabel.Instance.Text = showText; } @@ -70,11 +65,12 @@ var result = (CheckInteractiveResult)o; var interactiveItem = Player.Current.InteractiveItem; //if (interactiveItem is Weapon) - if (!string.IsNullOrEmpty(result.ShowIcon)) + var icon = result.GetIcon(); + if (icon != null) { _interactiveTarget = interactiveItem; //显示互动提示 - ShowBar(result.Target, result.Target.ItemConfig.Name, result.ShowIcon); + ShowBar(result.Target, result.Target.ItemConfig.Name, icon); } else { diff --git a/DungeonShooting_Godot/src/game/ui/roomUI/WeaponBar.cs b/DungeonShooting_Godot/src/game/ui/roomUI/WeaponBar.cs index 33ef47f..e6beffc 100644 --- a/DungeonShooting_Godot/src/game/ui/roomUI/WeaponBar.cs +++ b/DungeonShooting_Godot/src/game/ui/roomUI/WeaponBar.cs @@ -63,7 +63,7 @@ { if (curr != _prevAmmo || total != _prevResidue) { - _weaponBar.L_AmmoCount.Instance.Text = curr + "/" + total; + _weaponBar.L_AmmoCount.Instance.Text = curr + " / " + total; _prevAmmo = curr; _prevResidue = total; }