diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1788a79 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/DungeonShooting_Godot/android diff --git a/DungeonShooting_Art/ui/itch-io-Controllers and Keyboard/Split/e.png b/DungeonShooting_Art/ui/itch-io-Controllers and Keyboard/Split/e.png new file mode 100644 index 0000000..be2c639 --- /dev/null +++ b/DungeonShooting_Art/ui/itch-io-Controllers and Keyboard/Split/e.png Binary files differ diff --git a/DungeonShooting_Godot/export_presets.cfg b/DungeonShooting_Godot/export_presets.cfg index c726e26..96983c0 100644 --- a/DungeonShooting_Godot/export_presets.cfg +++ b/DungeonShooting_Godot/export_presets.cfg @@ -74,7 +74,7 @@ export_filter="all_resources" include_filter="" exclude_filter="" -export_path="" +export_path="../../export/test.apk" script_export_mode=1 script_encryption_key="" @@ -82,8 +82,10 @@ custom_template/debug="" custom_template/release="" -custom_template/use_custom_build=false -custom_template/export_format=0 +custom_build/use_custom_build=true +custom_build/export_format=0 +custom_build/min_sdk="" +custom_build/target_sdk="" architectures/armeabi-v7a=true architectures/arm64-v8a=true architectures/x86=false @@ -97,8 +99,6 @@ one_click_deploy/clear_previous_install=false version/code=1 version/name="1.0" -version/min_sdk=19 -version/target_sdk=30 package/unique_name="org.godotengine.$genname" package/name="" package/signed=true @@ -196,6 +196,7 @@ permissions/manage_accounts=false permissions/manage_app_tokens=false permissions/manage_documents=false +permissions/manage_external_storage=false permissions/master_clear=false permissions/media_content_control=false permissions/modify_audio_settings=false diff --git a/DungeonShooting_Godot/prefab/ui/Cursor.tscn b/DungeonShooting_Godot/prefab/ui/Cursor.tscn index 3b0e0e7..dd76fcc 100644 --- a/DungeonShooting_Godot/prefab/ui/Cursor.tscn +++ b/DungeonShooting_Godot/prefab/ui/Cursor.tscn @@ -4,6 +4,7 @@ [ext_resource path="res://src/effect/Cursor.cs" type="Script" id=2] [node name="Cursor" type="Node2D"] +z_index = 15 script = ExtResource( 2 ) [node name="LT" type="Sprite" parent="."] diff --git a/DungeonShooting_Godot/prefab/ui/RoomUI.tscn b/DungeonShooting_Godot/prefab/ui/RoomUI.tscn index 778ffae..e3af5ff 100644 --- a/DungeonShooting_Godot/prefab/ui/RoomUI.tscn +++ b/DungeonShooting_Godot/prefab/ui/RoomUI.tscn @@ -1,8 +1,7 @@ -[gd_scene load_steps=10 format=2] +[gd_scene load_steps=9 format=2] [ext_resource path="res://src/ui/RoomUI.cs" type="Script" id=1] [ext_resource path="res://resource/sprite/ui/mapBar.png" type="Texture" id=2] -[ext_resource path="res://resource/sprite/ui/RoomUi.png" type="Texture" id=3] [ext_resource path="res://resource/sprite/ui/healthBar.png" type="Texture" id=4] [ext_resource path="res://resource/sprite/gun/gun4.png" type="Texture" id=5] [ext_resource path="res://resource/sprite/ui/hpBar.png" type="Texture" id=6] @@ -15,11 +14,6 @@ anchor_bottom = 1.0 script = ExtResource( 1 ) -[node name="RoomUi" type="Sprite" parent="."] -visible = false -texture = ExtResource( 3 ) -centered = false - [node name="Control" type="Control" parent="."] anchor_right = 1.0 anchor_bottom = 1.0 diff --git a/DungeonShooting_Godot/resource/sprite/ui/keyboard/e.png b/DungeonShooting_Godot/resource/sprite/ui/keyboard/e.png new file mode 100644 index 0000000..be2c639 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/keyboard/e.png Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/keyboard/e.png.import b/DungeonShooting_Godot/resource/sprite/ui/keyboard/e.png.import new file mode 100644 index 0000000..fcb8059 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/keyboard/e.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/e.png-d1dbc742a6aa925ce067b6aa2ad41342.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/ui/keyboard/e.png" +dest_files=[ "res://.import/e.png-d1dbc742a6aa925ce067b6aa2ad41342.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=false +svg/scale=1.0 diff --git a/DungeonShooting_Godot/scene/TestNavigation.tscn b/DungeonShooting_Godot/scene/TestNavigation.tscn index cee8cd1..b2f8768 100644 --- a/DungeonShooting_Godot/scene/TestNavigation.tscn +++ b/DungeonShooting_Godot/scene/TestNavigation.tscn @@ -59,6 +59,7 @@ [node name="TileMap" type="TileMap" parent="Position2D/Navigation2D/Node2D"] tile_set = SubResource( 3 ) cell_size = Vector2( 16, 16 ) +bake_navigation = true format = 1 tile_data = PoolIntArray( 131074, 0, 0, 131075, 0, 0, 131076, 0, 0, 131077, 0, 0, 131078, 0, 0, 196610, 0, 0, 196611, 0, 0, 196612, 0, 0, 196613, 0, 0, 196614, 0, 0, 262146, 0, 0, 262147, 0, 0, 262148, 0, 0, 262149, 0, 0, 262150, 0, 0, 327682, 0, 0, 327683, 0, 0, 327684, 0, 0, 327685, 0, 0, 327686, 0, 0, 327699, 0, 0, 327700, 0, 0, 327701, 0, 0, 327702, 0, 0, 327703, 0, 0, 327704, 0, 0, 327705, 0, 0, 393218, 0, 0, 393219, 0, 0, 393220, 0, 0, 393221, 0, 0, 393222, 0, 0, 393223, 0, 0, 393224, 0, 0, 393225, 0, 0, 393226, 0, 0, 393227, 0, 0, 393228, 0, 0, 393229, 0, 0, 393235, 0, 0, 393236, 0, 0, 393237, 0, 0, 393238, 0, 0, 393239, 0, 0, 393240, 0, 0, 393241, 0, 0, 458754, 0, 0, 458755, 0, 0, 458756, 0, 0, 458757, 0, 0, 458758, 0, 0, 458759, 0, 0, 458760, 0, 0, 458761, 0, 0, 458762, 0, 0, 458763, 0, 0, 458764, 0, 0, 458765, 0, 0, 458771, 0, 0, 458772, 0, 0, 458773, 0, 0, 458774, 0, 0, 458775, 0, 0, 458776, 0, 0, 458777, 0, 0, 524299, 0, 0, 524300, 0, 0, 524301, 0, 0, 524307, 0, 0, 524308, 0, 0, 524309, 0, 0, 524310, 0, 0, 524311, 0, 0, 524312, 0, 0, 524313, 0, 0, 589835, 0, 0, 589836, 0, 0, 589837, 0, 0, 589843, 0, 0, 589844, 0, 0, 589845, 0, 0, 589846, 0, 0, 589847, 0, 0, 589848, 0, 0, 589849, 0, 0, 589850, 0, 0, 589851, 0, 0, 655371, 0, 0, 655372, 0, 0, 655373, 0, 0, 655379, 0, 0, 655380, 0, 0, 655381, 0, 0, 655382, 0, 0, 655383, 0, 0, 655384, 0, 0, 655385, 0, 0, 655386, 0, 0, 655387, 0, 0, 720897, 0, 0, 720898, 0, 0, 720899, 0, 0, 720900, 0, 0, 720901, 0, 0, 720902, 0, 0, 720903, 0, 0, 720904, 0, 0, 720905, 0, 0, 720906, 0, 0, 720907, 0, 0, 720908, 0, 0, 720909, 0, 0, 720915, 0, 0, 720916, 0, 0, 720917, 0, 0, 720918, 0, 0, 720919, 0, 0, 720920, 0, 0, 720921, 0, 0, 720922, 0, 0, 720923, 0, 0, 786433, 0, 0, 786434, 0, 0, 786435, 0, 0, 786436, 0, 0, 786437, 0, 0, 786438, 0, 0, 786439, 0, 0, 786440, 0, 0, 786441, 0, 0, 786442, 0, 0, 786443, 0, 0, 786444, 0, 0, 786445, 0, 0, 786446, 0, 0, 786447, 0, 0, 786448, 0, 0, 786449, 0, 0, 786450, 0, 0, 786451, 0, 0, 786452, 0, 0, 786453, 0, 0, 786454, 0, 0, 786455, 0, 0, 786456, 0, 0, 786457, 0, 0, 786458, 0, 0, 786459, 0, 0, 851979, 0, 0, 851980, 0, 0, 851981, 0, 0, 851982, 0, 0, 851983, 0, 0, 851984, 0, 0, 851985, 0, 0, 851986, 0, 0, 851987, 0, 0, 851988, 0, 0, 851989, 0, 0, 851990, 0, 0, 851991, 0, 0, 851992, 0, 0, 851993, 0, 0, 851994, 0, 0, 851995, 0, 0, 917515, 0, 0, 917516, 0, 0, 917517, 0, 0, 917518, 0, 0, 917519, 0, 0, 917520, 0, 0, 917521, 0, 0, 917522, 0, 0, 917523, 0, 0, 917524, 0, 0, 917525, 0, 0, 917526, 0, 0, 917527, 0, 0, 917528, 0, 0, 917529, 0, 0, 917530, 0, 0, 917531, 0, 0, 983051, 0, 0, 983052, 0, 0, 983053, 0, 0, 983054, 0, 0, 983055, 0, 0, 983056, 0, 0, 983057, 0, 0, 983058, 0, 0, 983059, 0, 0, 983060, 0, 0, 983061, 0, 0, 983062, 0, 0, 983063, 0, 0, 983064, 0, 0, 983065, 0, 0, 983066, 0, 0, 983067, 0, 0 ) @@ -67,6 +68,7 @@ [node name="TileMap" type="TileMap" parent="Position2D/Navigation2D/Node2D2"] tile_set = SubResource( 5 ) cell_size = Vector2( 16, 16 ) +bake_navigation = true format = 1 tile_data = PoolIntArray( 131088, 0, 0, 131089, 0, 0, 131090, 0, 0, 131091, 0, 0, 131092, 0, 0, 196622, 0, 0, 196623, 0, 0, 196624, 0, 0, 196628, 0, 0, 262156, 0, 0, 262157, 0, 0, 262158, 0, 0, 262164, 0, 0, 327692, 0, 0, 524302, 0, 0, 524303, 0, 0, 524304, 0, 0, 524305, 0, 0, 524306, 0, 0, 589838, 0, 0, 589839, 0, 0, 589840, 0, 0, 589841, 0, 0, 589842, 0, 0 ) diff --git a/DungeonShooting_Godot/src/effect/ThrowNode.cs b/DungeonShooting_Godot/src/effect/ThrowNode.cs index 3260128..73094ca 100644 --- a/DungeonShooting_Godot/src/effect/ThrowNode.cs +++ b/DungeonShooting_Godot/src/effect/ThrowNode.cs @@ -112,22 +112,28 @@ if (mount != null) { Mount = mount; - var parent = mount.GetParent(); - if (parent == null) + var mountParent = mount.GetParent(); + if (mountParent == null) { AddChild(mount); } - else if (parent != this) + else if (mountParent != this) { - parent.RemoveChild(mount); + mountParent.RemoveChild(mount); AddChild(mount); } mount.Position = new Vector2(0, -startHeight); } - if (GetParent() == null) + var parent = GetParent(); + if (parent == null) { RoomManager.Current.SortRoot.AddChild(this); } + else if (parent == RoomManager.Current.SortRoot) + { + parent.RemoveChild(this); + RoomManager.Current.SortRoot.AddChild(this); + } } /// diff --git a/DungeonShooting_Godot/src/package/Holster.cs b/DungeonShooting_Godot/src/package/Holster.cs index 932aa1a..3ce60be 100644 --- a/DungeonShooting_Godot/src/package/Holster.cs +++ b/DungeonShooting_Godot/src/package/Holster.cs @@ -92,6 +92,23 @@ } /// + /// 返回是否能放入武器 + /// + /// 武器对象 + public bool CanPickupGun(Gun gun) + { + for (int i = 0; i < SlotList.Length; i++) + { + var item = SlotList[i]; + if (item.Enable && gun.Attribute.WeightType == item.Type && item.Gun == null) + { + return true; + } + } + return false; + } + + /// /// 拾起武器, 存入枪套中, 返回存放在枪套的位置, 如果容不下这把武器, 则会返回 -1 /// /// 武器对象 diff --git a/DungeonShooting_Godot/src/props/IProp.cs b/DungeonShooting_Godot/src/props/IProp.cs index e7b1932..04f758e 100644 --- a/DungeonShooting_Godot/src/props/IProp.cs +++ b/DungeonShooting_Godot/src/props/IProp.cs @@ -5,6 +5,12 @@ public interface IProp { /// + /// 返回是否能互动 + /// + /// 触发者 + bool CanTnteractive(Role master); + + /// /// 与角色互动时调用 /// /// 触发者 diff --git a/DungeonShooting_Godot/src/room/RoomManager.cs b/DungeonShooting_Godot/src/room/RoomManager.cs index 50f37cd..7567ae7 100644 --- a/DungeonShooting_Godot/src/room/RoomManager.cs +++ b/DungeonShooting_Godot/src/room/RoomManager.cs @@ -24,7 +24,7 @@ public override void _EnterTree() { Current = this; - Input.SetMouseMode(Input.MouseMode.Hidden); + Input.MouseMode = Input.MouseModeEnum.Hidden; // 初始化鼠标 Cursor = MouseCursor.Instance(); AddChild(Cursor); diff --git a/DungeonShooting_Godot/src/weapon/gun/Gun.cs b/DungeonShooting_Godot/src/weapon/gun/Gun.cs index 7fe353d..a774bc7 100644 --- a/DungeonShooting_Godot/src/weapon/gun/Gun.cs +++ b/DungeonShooting_Godot/src/weapon/gun/Gun.cs @@ -477,8 +477,30 @@ } } + public bool CanTnteractive(Role master) + { + //查找是否有同类型武器 + var index = master.Holster.FindGun(Attribute.Id); + if (index != -1) //如果有这个武器 + { + if (CurrAmmo + ResidueAmmo == 0) //没有子弹了 + { + return false; + } + } + else //没有武器 + { + if (!master.Holster.CanPickupGun(this)) + { + return false; + } + } + return true; + } + public void Tnteractive(Role master) { + //查找是否有同类型武器 var index = master.Holster.FindGun(Attribute.Id); if (index != -1) //如果有这个武器 {