diff --git a/DungeonShooting_Godot/addons/dungeonShooting_plugin/Plugin.cs b/DungeonShooting_Godot/addons/dungeonShooting_plugin/Plugin.cs index f78f577..a5f7853 100644 --- a/DungeonShooting_Godot/addons/dungeonShooting_plugin/Plugin.cs +++ b/DungeonShooting_Godot/addons/dungeonShooting_plugin/Plugin.cs @@ -42,18 +42,18 @@ //自定义节点 private CustomTypeInfo[] _customTypeInfos = new CustomTypeInfo[] { - new CustomTypeInfo( - "ActivityMark", - "Node2D", - "res://src/framework/map/mark/ActivityMark.cs", - "res://addons/dungeonShooting_plugin/Mark.svg" - ), - new CustomTypeInfo( - "EnemyMark", - "Node2D", - "res://src/framework/map/mark/EnemyMark.cs", - "res://addons/dungeonShooting_plugin/Mark.svg" - ), + // new CustomTypeInfo( + // "ActivityMark", + // "Node2D", + // "res://src/framework/map/mark/ActivityMark.cs", + // "res://addons/dungeonShooting_plugin/Mark.svg" + // ), + // new CustomTypeInfo( + // "EnemyMark", + // "Node2D", + // "res://src/framework/map/mark/EnemyMark.cs", + // "res://addons/dungeonShooting_plugin/Mark.svg" + // ), }; public override void _Process(double delta) diff --git a/DungeonShooting_Godot/project.godot b/DungeonShooting_Godot/project.godot index 4fb326f..c36c7b6 100644 --- a/DungeonShooting_Godot/project.godot +++ b/DungeonShooting_Godot/project.godot @@ -211,7 +211,7 @@ [rendering] textures/canvas_textures/default_texture_filter=0 -environment/defaults/default_clear_color=Color(0, 0, 0, 1) +environment/defaults/default_clear_color=Color(0.109804, 0.0666667, 0.0901961, 1) 2d/snapping/use_gpu_pixel_snap=true environment/default_environment="res://default_env.tres" diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle3/Preview.png b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle3/Preview.png index 95d5f00..fa1c7d6 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle3/Preview.png +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle3/Preview.png Binary files differ diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/Preinstall.json b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/Preinstall.json index 30d1488..fd75129 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/Preinstall.json +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/Preinstall.json @@ -1 +1 @@ -[{"Name":"test1","Weight":100,"Remark":"","WaveList":[[{"Position":{"X":19,"Y":2},"Size":{"X":0,"Y":0},"SpecialMarkType":1,"DelayTime":0,"MarkList":[]},{"Position":{"X":-38,"Y":41},"Size":{"X":0,"Y":0},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0001","Weight":100,"Attr":{"CurrAmmon":"30","ResidueAmmo":"210"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-38,"Y":55},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0002","Weight":100,"Attr":{"CurrAmmon":"7","ResidueAmmo":"70"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-38,"Y":11},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0004","Weight":100,"Attr":{"CurrAmmon":"180","ResidueAmmo":"90"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-39,"Y":69},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0005","Weight":100,"Attr":{"CurrAmmon":"10","ResidueAmmo":"40"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-38,"Y":-8},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0003","Weight":100,"Attr":{"CurrAmmon":"12","ResidueAmmo":"90"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-38,"Y":27},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0006","Weight":100,"Attr":{"CurrAmmon":"20","ResidueAmmo":"300"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-38,"Y":-28},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0007","Weight":100,"Attr":{"CurrAmmon":"60","ResidueAmmo":"300"},"Altitude":8,"VerticalSpeed":0}]}],[{"Position":{"X":55,"Y":67},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop0003","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":56,"Y":24},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0.5,"MarkList":[{"Id":"prop5000","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":56,"Y":0},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":1,"MarkList":[{"Id":"prop5001","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":34,"Y":23},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":1.5,"MarkList":[{"Id":"prop0002","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":55,"Y":44},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop5001","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":56,"Y":-24},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop5001","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]}]]}] \ No newline at end of file +[{"Name":"test1","Weight":100,"Remark":"","WaveList":[[{"Position":{"X":19,"Y":2},"Size":{"X":0,"Y":0},"SpecialMarkType":1,"DelayTime":0,"MarkList":[]},{"Position":{"X":-76,"Y":35},"Size":{"X":0,"Y":0},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0001","Weight":100,"Attr":{"CurrAmmon":"30","ResidueAmmo":"210"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-79,"Y":46},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0002","Weight":100,"Attr":{"CurrAmmon":"7","ResidueAmmo":"70"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-75,"Y":2},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0004","Weight":100,"Attr":{"CurrAmmon":"180","ResidueAmmo":"90"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-75,"Y":67},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0005","Weight":100,"Attr":{"CurrAmmon":"10","ResidueAmmo":"40"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-73,"Y":-18},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0003","Weight":100,"Attr":{"CurrAmmon":"12","ResidueAmmo":"90"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-76,"Y":21},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0006","Weight":100,"Attr":{"CurrAmmon":"20","ResidueAmmo":"300"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-74,"Y":-30},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0007","Weight":100,"Attr":{"CurrAmmon":"60","ResidueAmmo":"300"},"Altitude":8,"VerticalSpeed":0}]}],[{"Position":{"X":55,"Y":67},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop0003","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":56,"Y":24},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0.5,"MarkList":[{"Id":"prop5000","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":56,"Y":0},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":1,"MarkList":[{"Id":"prop5001","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":34,"Y":23},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":1.5,"MarkList":[{"Id":"prop0002","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":55,"Y":44},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop5001","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":56,"Y":-24},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop5001","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]}]]}] \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/Preview.png b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/Preview.png index 3f0900c..d64d95a 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/Preview.png +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/Preview.png Binary files differ diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/RoomInfo.json b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/RoomInfo.json index 4285d01..6005b11 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/RoomInfo.json +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/RoomInfo.json @@ -1 +1 @@ -{"Position":{"X":-5,"Y":-4},"Size":{"X":11,"Y":10},"DoorAreaInfos":[],"GroupName":"TestGroup1","RoomType":1,"RoomName":"Start1","Weight":100,"Remark":""} \ No newline at end of file +{"Position":{"X":-8,"Y":-4},"Size":{"X":15,"Y":10},"DoorAreaInfos":[{"Direction":3,"Start":0,"End":208},{"Direction":0,"Start":0,"End":128},{"Direction":2,"Start":128,"End":208},{"Direction":1,"Start":0,"End":128},{"Direction":2,"Start":0,"End":64}],"GroupName":"TestGroup1","RoomType":1,"RoomName":"Start1","Weight":100,"Remark":""} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/TileInfo.json b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/TileInfo.json index 22e1c00..68ed08e 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/TileInfo.json +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/TileInfo.json @@ -1 +1 @@ -{"NavigationList":[{"Type":0,"Points":[-56,-40,72,-40,72,80,-56,80]}],"Floor":[-4,-3,0,0,8,-4,-2,0,0,8,-4,-1,0,0,8,-4,0,0,0,8,-4,1,0,0,8,-4,2,0,0,8,-4,3,0,0,8,-4,4,0,0,8,-3,-3,0,0,8,-3,-2,0,0,8,-3,-1,0,0,8,-3,0,0,0,8,-3,1,0,0,8,-3,2,0,0,8,-3,3,0,0,8,-3,4,0,0,8,-2,-3,0,0,8,-2,-2,0,0,8,-2,-1,0,0,8,-2,0,0,0,8,-2,1,0,0,8,-2,2,0,0,8,-2,3,0,0,8,-2,4,0,0,8,-1,-3,0,0,8,-1,-2,0,0,8,-1,-1,0,0,8,-1,0,0,0,8,-1,1,0,0,8,-1,2,0,0,8,-1,3,0,0,8,-1,4,0,0,8,0,-3,0,0,8,0,-2,0,0,8,0,-1,0,0,8,0,0,0,0,8,0,1,0,0,8,0,2,0,0,8,0,3,0,0,8,0,4,0,0,8,4,-3,0,0,8,4,-2,0,0,8,4,-1,0,0,8,4,0,0,0,8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3,3,-8,0,0,3,3,-8,1,0,3,3,-8,2,0,3,3,-8,3,0,3,3,-8,4,0,3,3,-8,5,0,11,2,-7,5,0,2,2,-6,5,0,2,2,-5,5,0,2,2,-4,5,0,2,2,-3,3,0,1,2,-3,4,0,1,3,-3,5,0,13,2,-2,3,0,2,2,-1,3,0,2,2,0,3,0,3,2,0,4,0,3,3,0,5,0,11,2,1,5,0,2,2,2,5,0,2,2,3,5,0,2,2,4,5,0,2,2,5,5,0,2,2,6,-4,0,1,4,6,-3,0,1,3,6,-2,0,1,3,6,-1,0,1,3,6,0,0,1,3,6,1,0,1,3,6,2,0,1,3,6,3,0,1,3,6,4,0,1,3,6,5,0,13,2]} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start2/Preview.png b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start2/Preview.png index dbbb1d3..6d2fd01 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start2/Preview.png +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start2/Preview.png Binary files differ diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start2/TileInfo.json b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start2/TileInfo.json index 8ba5c2f..60689b8 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start2/TileInfo.json +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start2/TileInfo.json @@ -1 +1 @@ -{"NavigationList":[{"Type":0,"Points":[-56,-56,56,-56,56,96,40,96,40,48,-40,48,-40,96,-56,96]}],"Floor":[3,5,0,0,8,3,4,0,0,8,3,3,0,0,8,3,2,0,0,8,3,1,0,0,8,3,0,0,0,8,3,-1,0,0,8,3,-2,0,0,8,3,-3,0,0,8,3,-4,0,0,8,-4,5,0,0,8,-4,4,0,0,8,-4,3,0,0,8,-4,2,0,0,8,-4,1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-4,0,3,3,-5,-3,0,3,3,-5,-2,0,3,3,-5,-1,0,3,3,-5,0,0,3,3,-5,1,0,3,3,-5,2,0,3,3,-5,3,0,3,3,-5,4,0,3,3,-5,5,0,3,3,-5,6,0,11,2,-4,6,0,2,2,-3,6,0,2,2,-2,3,0,1,2,-2,4,0,1,3,-2,5,0,1,3,-2,6,0,13,2,-1,3,0,2,2,0,3,0,2,2,1,3,0,3,2,1,4,0,3,3,1,5,0,3,3,1,6,0,11,2,2,6,0,2,2,3,6,0,2,2,4,-5,0,1,4,4,-4,0,1,3,4,-3,0,1,3,4,-2,0,1,3,4,-1,0,1,3,4,0,0,1,3,4,1,0,1,3,4,2,0,1,3,4,3,0,1,3,4,4,0,1,3,4,5,0,1,3,4,6,0,13,2]} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/outlet/End1/Preview.png b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/outlet/End1/Preview.png index 8e0a47a..6224d08 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/outlet/End1/Preview.png +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/outlet/End1/Preview.png Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/map/WallTransition1.png b/DungeonShooting_Godot/resource/sprite/map/WallTransition1.png new file mode 100644 index 0000000..420ef2c --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/map/WallTransition1.png Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/map/WallTransition1.png.import b/DungeonShooting_Godot/resource/sprite/map/WallTransition1.png.import new file mode 100644 index 0000000..7141f43 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/map/WallTransition1.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ddkx5x25fges7" +path="res://.godot/imported/WallTransition1.png-290006472c94b57424b8ec3bd229ce8b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/map/WallTransition1.png" +dest_files=["res://.godot/imported/WallTransition1.png-290006472c94b57424b8ec3bd229ce8b.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/map/WallTransition2.png b/DungeonShooting_Godot/resource/sprite/map/WallTransition2.png new file mode 100644 index 0000000..f01f30b --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/map/WallTransition2.png Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/map/WallTransition2.png.import b/DungeonShooting_Godot/resource/sprite/map/WallTransition2.png.import new file mode 100644 index 0000000..5f256b8 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/map/WallTransition2.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b751rowqecctj" +path="res://.godot/imported/WallTransition2.png-43446d8d92d11ce7c994737780ed01a3.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/map/WallTransition2.png" +dest_files=["res://.godot/imported/WallTransition2.png-43446d8d92d11ce7c994737780ed01a3.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/map/WallTransition3.png b/DungeonShooting_Godot/resource/sprite/map/WallTransition3.png new file mode 100644 index 0000000..430aba3 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/map/WallTransition3.png Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/map/WallTransition3.png.import b/DungeonShooting_Godot/resource/sprite/map/WallTransition3.png.import new file mode 100644 index 0000000..1bbeb6d --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/map/WallTransition3.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://civvboe078gcc" +path="res://.godot/imported/WallTransition3.png-db21c2408170d6ada2e3c9da5f2912c8.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/map/WallTransition3.png" +dest_files=["res://.godot/imported/WallTransition3.png-db21c2408170d6ada2e3c9da5f2912c8.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/DungeonShooting_Godot/src/framework/map/DungeonGenerator.cs b/DungeonShooting_Godot/src/framework/map/DungeonGenerator.cs index fbec68a..08beefa 100644 --- a/DungeonShooting_Godot/src/framework/map/DungeonGenerator.cs +++ b/DungeonShooting_Godot/src/framework/map/DungeonGenerator.cs @@ -28,11 +28,11 @@ /// boss房间 /// public List BossRoom { get; } = new List(); - + /// /// 随机数对象 /// - public SeedRandom Random { get; } + private SeedRandom _random; //用于标记地图上的坐标是否被占用 private Grid _roomGrid { get; } = new Grid(); @@ -87,9 +87,10 @@ // NoProperDoor, } - public DungeonGenerator(DungeonConfig config) + public DungeonGenerator(DungeonConfig config, SeedRandom seedRandom) { _config = config; + _random = seedRandom; _roomGroup = GameApplication.Instance.RoomConfig[config.GroupName]; //验证该组是否满足生成地牢的条件 @@ -99,9 +100,8 @@ throw new Exception("当前组'" + config.GroupName + "'" + result.ErrorMessage + ", 不能生成地牢!"); } - Random = new SeedRandom(); - GD.Print("创建地牢生成器, 随机种子: " + Random.Seed); - _roomGroup.InitWeight(Random); + GD.Print("创建地牢生成器, 随机种子: " + _random.Seed); + _roomGroup.InitWeight(_random); } /// @@ -198,12 +198,12 @@ } else { - tempPrevRoomInfo = Random.RandomChoose(RoomInfos); + tempPrevRoomInfo = _random.RandomChoose(RoomInfos); } } else { - tempPrevRoomInfo = Random.RandomChoose(RoomInfos); + tempPrevRoomInfo = _random.RandomChoose(RoomInfos); } //生成下一个房间 @@ -228,7 +228,7 @@ else if (nextRoomType == DungeonRoomType.Battle) { chainTryCount = 0; - chainMaxTryCount = Random.RandomRangeInt(1, 3); + chainMaxTryCount = _random.RandomRangeInt(1, 3); } prevRoomInfo = nextRoom; CalcNextRoomType(prevRoomInfo); @@ -292,7 +292,7 @@ DungeonRoomSplit roomSplit; if (_config.HasDesignatedRoom && _config.DesignatedType == roomType) //执行指定了房间 { - roomSplit = Random.RandomChoose(_config.DesignatedRoom); + roomSplit = _random.RandomChoose(_config.DesignatedRoom); } else //没有指定房间 { @@ -333,19 +333,19 @@ } for (; tryCount < maxTryCount; tryCount++) { - var direction = Random.RandomRangeInt(0, 3); + var direction = _random.RandomRangeInt(0, 3); //房间间隔 - var space = Random.RandomRangeInt(_roomMinInterval, _roomMaxInterval); + var space = _random.RandomRangeInt(_roomMinInterval, _roomMaxInterval); //中心偏移 int offset; if (direction == 0 || direction == 2) { - offset = Random.RandomRangeInt(-(int)(prevRoomInfo.Size.X * _roomVerticalMinDispersion), + offset = _random.RandomRangeInt(-(int)(prevRoomInfo.Size.X * _roomVerticalMinDispersion), (int)(prevRoomInfo.Size.X * _roomVerticalMaxDispersion)); } else { - offset = Random.RandomRangeInt(-(int)(prevRoomInfo.Size.Y * _roomHorizontalMinDispersion), + offset = _random.RandomRangeInt(-(int)(prevRoomInfo.Size.Y * _roomHorizontalMinDispersion), (int)(prevRoomInfo.Size.Y * _roomHorizontalMaxDispersion)); } @@ -544,7 +544,7 @@ } } - return Random.RandomChoose(list); + return _random.RandomChoose(list); } /// @@ -563,7 +563,7 @@ nextRoomDoor.ConnectDoor = roomDoor; //先寻找直通门 - if (Random.RandomBoolean()) + if (_random.RandomBoolean()) { //直行通道, 优先横轴 if (TryConnectHorizontalDoor(roomInfo, roomDoor, nextRoomInfo, nextRoomDoor) @@ -603,8 +603,8 @@ while (rangeList.Count > 0) { //找到重叠区域 - var range = Random.RandomChooseAndRemove(rangeList); - var x = Random.RandomRangeInt(range.X, range.Y); + var range = _random.RandomChooseAndRemove(rangeList); + var x = _random.RandomRangeInt(range.X, range.Y); if (roomInfo.GetVerticalStart() < nextRoomInfo.GetVerticalStart()) //room在上, nextRoom在下 { @@ -655,8 +655,8 @@ while (rangeList.Count > 0) { //找到重叠区域 - var range = Random.RandomChooseAndRemove(rangeList); - var y = Random.RandomRangeInt(range.X, range.Y); + var range = _random.RandomChooseAndRemove(rangeList); + var y = _random.RandomRangeInt(range.X, range.Y); if (roomInfo.GetHorizontalStart() < nextRoomInfo.GetHorizontalStart()) //room在左, nextRoom在右 { @@ -702,7 +702,7 @@ { if (roomInfo.GetVerticalStart() > nextRoomInfo.GetVerticalStart()) { - if (Random.RandomBoolean()) //↑ //→ + if (_random.RandomBoolean()) //↑ //→ { if (!TryConnect_NE_Door(roomInfo, nextRoomInfo, roomDoor, nextRoomDoor, ref cross) && !TryConnect_WS_Door(roomInfo, nextRoomInfo, roomDoor, nextRoomDoor, ref cross)) @@ -721,7 +721,7 @@ } else { - if (Random.RandomBoolean()) //↓ //→ + if (_random.RandomBoolean()) //↓ //→ { if (!TryConnect_SE_Door(roomInfo, nextRoomInfo, roomDoor, nextRoomDoor, ref cross) && !TryConnect_WN_Door(roomInfo, nextRoomInfo, roomDoor, nextRoomDoor, ref cross)) @@ -743,7 +743,7 @@ { if (roomInfo.GetVerticalStart() > nextRoomInfo.GetVerticalStart()) //→ //↓ { - if (Random.RandomBoolean()) + if (_random.RandomBoolean()) { if (!TryConnect_ES_Door(roomInfo, nextRoomInfo, roomDoor, nextRoomDoor, ref cross) && !TryConnect_NW_Door(roomInfo, nextRoomInfo, roomDoor, nextRoomDoor, ref cross)) @@ -762,7 +762,7 @@ } else { - if (Random.RandomBoolean()) //→ //↑ + if (_random.RandomBoolean()) //→ //↑ { if (!TryConnect_EN_Door(roomInfo, nextRoomInfo, roomDoor, nextRoomDoor, ref cross) && !TryConnect_SW_Door(roomInfo, nextRoomInfo, roomDoor, nextRoomDoor, ref cross)) diff --git a/DungeonShooting_Godot/src/framework/map/DungeonTileMap.cs b/DungeonShooting_Godot/src/framework/map/DungeonTileMap.cs index 2439326..c35c107 100644 --- a/DungeonShooting_Godot/src/framework/map/DungeonTileMap.cs +++ b/DungeonShooting_Godot/src/framework/map/DungeonTileMap.cs @@ -482,9 +482,9 @@ var rect = _tileRoot.GetUsedRect(); var endX = rect.End.X + 1; var endY = rect.End.Y + 1; - for (int x = rect.Position.X; x <= endX; x++) + for (int x = rect.Position.X - 1; x <= endX; x++) { - for (int y = rect.Position.Y; y <= endY; y++) + for (int y = rect.Position.Y - 1; y <= endY; y++) { if (c++ > 1000) //份帧处理, 不要挤在一帧 { diff --git a/DungeonShooting_Godot/src/framework/map/fog/RoomFogMask.cs b/DungeonShooting_Godot/src/framework/map/fog/RoomFogMask.cs index 82aff05..d78fbfb 100644 --- a/DungeonShooting_Godot/src/framework/map/fog/RoomFogMask.cs +++ b/DungeonShooting_Godot/src/framework/map/fog/RoomFogMask.cs @@ -1,22 +1,93 @@  using Godot; +/// +/// 迷雾遮罩 +/// public partial class RoomFogMask : PointLight2D, IDestroy { + public int Width { get; private set; } + public int Height { get; private set; } + public bool IsDestroyed { get; private set; } private bool _init = false; + + private static Image _leftTransition; + private static Image _rightTransition; + private static Image _topTransition; + private static Image _downTransition; + private static Image _leftTopTransition; + private static Image _rightTopTransition; + private static Image _leftDownTransition; + private static Image _rightDownTransition; + + private static Image _inLeftTopTransition; + private static Image _inRightTopTransition; + private static Image _inLeftDownTransition; + private static Image _inRightDownTransition; + + private static bool _initSprite = false; + + private static void InitSprite() + { + if (_initSprite) + { + return; + } + _initSprite = false; + + var temp = ResourceManager.Load(ResourcePath.resource_sprite_map_WallTransition1_png, false); + _leftTransition = temp.GetImage(); + _rightTransition = temp.GetImage(); + _rightTransition.Rotate180(); + _topTransition = temp.GetImage(); + _topTransition.Rotate90(ClockDirection.Clockwise); + _downTransition = temp.GetImage(); + _downTransition.Rotate90(ClockDirection.Counterclockwise); + + var temp2 = ResourceManager.Load(ResourcePath.resource_sprite_map_WallTransition2_png, false); + _leftDownTransition = temp2.GetImage(); + _leftTopTransition = temp2.GetImage(); + _leftTopTransition.Rotate90(ClockDirection.Clockwise); + _rightDownTransition = temp2.GetImage(); + _rightDownTransition.Rotate90(ClockDirection.Counterclockwise); + _rightTopTransition = temp2.GetImage(); + _rightTopTransition.Rotate180(); + + var temp3 = ResourceManager.Load(ResourcePath.resource_sprite_map_WallTransition3_png, false); + _inLeftDownTransition = temp3.GetImage(); + _inLeftTopTransition = temp3.GetImage(); + _inLeftTopTransition.Rotate90(ClockDirection.Clockwise); + _inRightDownTransition = temp3.GetImage(); + _inRightDownTransition.Rotate90(ClockDirection.Counterclockwise); + _inRightTopTransition = temp3.GetImage(); + _inRightTopTransition.Rotate180(); + } + + /// + /// 初始化贩房间迷雾遮罩 + /// + /// 房间对象 + /// 迷雾所占区域 public void Init(RoomInfo roomInfo, Rect2I rect2) { if (_init) { return; } + InitSprite(); GlobalPosition = rect2.Position + rect2.Size / 2; //创建光纹理 - var img = Image.Create(rect2.Size.X, rect2.Size.Y, false, Image.Format.Rgba8); + Width = rect2.Size.X; + Height = rect2.Size.Y; + var img = Image.Create(Width, Height, false, Image.Format.Rgba8); img.Fill(Colors.White); + + //处理边缘过渡 + HandlerTransition(roomInfo, img); + Texture = ImageTexture.CreateFromImage(img); } @@ -30,4 +101,135 @@ IsDestroyed = true; QueueFree(); } + + private void HandlerTransition(RoomInfo roomInfo, Image image) + { + var tileMap = GameApplication.Instance.World.TileRoot; + var autoConfig = GameApplication.Instance.DungeonManager.AutoTileConfig; + var wallCoord = autoConfig.WALL_BLOCK.AutoTileCoord; + var (x, y) = roomInfo.Position; + var (width, height) = roomInfo.Size; + x -= 1; + y -= 1; + width += 2; + height += 2; + for (int i = 0; i < width; i++) + { + for (int j = 0; j < height; j++) + { + var pos = new Vector2I(i + x, j + y); + //说明是外层墙壁 + if (tileMap.GetCellAtlasCoords(GameConfig.TopMapLayer, pos) == wallCoord) + { + //FillBlock(i, j, image); + var left = IsNotWallCell(tileMap, new Vector2I(pos.X + 1, pos.Y), wallCoord); + var right = IsNotWallCell(tileMap, new Vector2I(pos.X - 1, pos.Y), wallCoord); + var top = IsNotWallCell(tileMap, new Vector2I(pos.X, pos.Y + 1), wallCoord); + var down = IsNotWallCell(tileMap, new Vector2I(pos.X, pos.Y - 1), wallCoord); + var c = 0; + if (left) c++; + if (right) c++; + if (top) c++; + if (down) c++; + //判断方向 + if ((left && right) || (top && down) || c > 2) + { + continue; + } + else if (left && top) //内轮廓左上 + { + FillTransitionImage(i, j, image, _inLeftTopTransition); + } + else if (left && down) //内轮廓左下 + { + FillTransitionImage(i, j, image, _inLeftDownTransition); + } + else if (right && top) //内轮廓右上 + { + FillTransitionImage(i, j, image, _inRightTopTransition); + } + else if (right && down) //内轮廓右下 + { + FillTransitionImage(i, j, image, _inRightDownTransition); + } + else if (left) //左 + { + FillTransitionImage(i, j, image, _leftTransition); + } + else if (right) //右 + { + FillTransitionImage(i, j, image, _rightTransition); + } + else if (top) //上 + { + FillTransitionImage(i, j, image, _topTransition); + } + else if (down) //下 + { + FillTransitionImage(i, j, image, _downTransition); + } + else if (IsNotWallCell(tileMap, new Vector2I(pos.X + 1, pos.Y + 1), wallCoord)) //外轮廓左上 + { + FillTransitionImage(i, j, image, _leftTopTransition); + } + else if (IsNotWallCell(tileMap, new Vector2I(pos.X + 1, pos.Y - 1), wallCoord)) //外轮廓左下 + { + FillTransitionImage(i, j, image, _leftDownTransition); + } + else if (IsNotWallCell(tileMap, new Vector2I(pos.X - 1, pos.Y + 1), wallCoord)) //外轮廓右上 + { + FillTransitionImage(i, j, image, _rightTopTransition); + } + else if (IsNotWallCell(tileMap, new Vector2I(pos.X - 1, pos.Y - 1), wallCoord)) //外轮廓右下 + { + FillTransitionImage(i, j, image, _rightDownTransition); + } + else //全黑 + { + FillBlock(i, j, image); + } + } + } + } + } + + //填充一个16*16像素的区域 + private void FillBlock(int x, int y, Image image) + { + var endX = (x + 1) * GameConfig.TileCellSize; + var endY = (y + 1) * GameConfig.TileCellSize; + for (int i = x * GameConfig.TileCellSize; i < endX; i++) + { + for (int j = y * GameConfig.TileCellSize; j < endY; j++) + { + image.SetPixel(i, j, new Color(1, 1, 1, 0)); + } + } + } + + private void FillTransitionImage(int x, int y, Image image, Image transitionImage) + { + image.BlitRect(transitionImage, + new Rect2I(Vector2I.Zero, 16, 16), + new Vector2I(x * GameConfig.TileCellSize, y * GameConfig.TileCellSize) + ); + } + + //判断是否是墙壁 + private bool IsNotWallCell(TileMap tileMap, Vector2I pos, Vector2I wallCoord) + { + return tileMap.GetCellAtlasCoords(GameConfig.TopMapLayer, pos) != wallCoord && + tileMap.GetCellAtlasCoords(GameConfig.MiddleMapLayer, pos) != wallCoord && + (tileMap.GetCellSourceId(GameConfig.TopMapLayer, pos) != -1 || + tileMap.GetCellSourceId(GameConfig.MiddleMapLayer, pos) != -1); + } + + //判断是否是任意类型的图块 + private bool IsAnyCell(TileMap tileMap, Vector2I pos) + { + return tileMap.GetCellSourceId(GameConfig.FloorMapLayer, pos) != -1 || + tileMap.GetCellSourceId(GameConfig.MiddleMapLayer, pos) != -1 || + tileMap.GetCellSourceId(GameConfig.TopMapLayer, pos) != -1 || + tileMap.GetCellSourceId(GameConfig.AisleFloorMapLayer, pos) != -1; + } } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/GameApplication.cs b/DungeonShooting_Godot/src/game/GameApplication.cs index 01d2434..f66b1d9 100644 --- a/DungeonShooting_Godot/src/game/GameApplication.cs +++ b/DungeonShooting_Godot/src/game/GameApplication.cs @@ -96,11 +96,13 @@ DungeonConfig = new DungeonConfig(); DungeonConfig.GroupName = RoomConfig.FirstOrDefault().Key; - DungeonConfig.RoomCount = 20; + DungeonConfig.RoomCount = 0; } public override void _EnterTree() { + //背景颜色 + RenderingServer.SetDefaultClearColor(new Color(0, 0, 0, 1)); //随机化种子 //GD.Randomize(); //固定帧率 diff --git a/DungeonShooting_Godot/src/game/manager/ResourcePath.cs b/DungeonShooting_Godot/src/game/manager/ResourcePath.cs index e44024d..288ae6c 100644 --- a/DungeonShooting_Godot/src/game/manager/ResourcePath.cs +++ b/DungeonShooting_Godot/src/game/manager/ResourcePath.cs @@ -146,6 +146,9 @@ public const string resource_sprite_effects_weapon_KnifeHit1_png = "res://resource/sprite/effects/weapon/KnifeHit1.png"; public const string resource_sprite_effects_weapon_MeleeAttack1_png = "res://resource/sprite/effects/weapon/MeleeAttack1.png"; public const string resource_sprite_effects_weapon_ShotFire_png = "res://resource/sprite/effects/weapon/ShotFire.png"; + public const string resource_sprite_map_WallTransition1_png = "res://resource/sprite/map/WallTransition1.png"; + public const string resource_sprite_map_WallTransition2_png = "res://resource/sprite/map/WallTransition2.png"; + public const string resource_sprite_map_WallTransition3_png = "res://resource/sprite/map/WallTransition3.png"; public const string resource_sprite_map_map1_16x16dungeoniiwallreconfigv04spritesheet_png = "res://resource/sprite/map/map1/16x16 dungeon ii wall reconfig v04 spritesheet.png"; public const string resource_sprite_map_map1_door1_down_png = "res://resource/sprite/map/map1/door1_down.png"; public const string resource_sprite_map_map1_website_txt = "res://resource/sprite/map/map1/website.txt"; @@ -313,5 +316,6 @@ public const string scene_test_TestOptimizeSprite_tscn = "res://scene/test/TestOptimizeSprite.tscn"; public const string scene_test_TestOutline_tscn = "res://scene/test/TestOutline.tscn"; public const string scene_test_TestReadExcel_tscn = "res://scene/test/TestReadExcel.tscn"; + public const string scene_test_TestRoomFog_tscn = "res://scene/test/TestRoomFog.tscn"; public const string scene_test_TestTileLayer_tscn = "res://scene/test/TestTileLayer.tscn"; } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/room/DungeonManager.cs b/DungeonShooting_Godot/src/game/room/DungeonManager.cs index cd013f9..b4c2840 100644 --- a/DungeonShooting_Godot/src/game/room/DungeonManager.cs +++ b/DungeonShooting_Godot/src/game/room/DungeonManager.cs @@ -43,10 +43,14 @@ /// 当前使用的世界对象 /// public World World { get; private set; } + + /// + /// 自动图块配置 + /// + public AutoTileConfig AutoTileConfig { get; private set; } private UiBase _prevUi; private DungeonTileMap _dungeonTileMap; - private AutoTileConfig _autoTileConfig; private DungeonGenerator _dungeonGenerator; //房间内所有静态导航网格数据 private List _roomStaticNavigationList; @@ -193,15 +197,16 @@ World = GameApplication.Instance.CreateNewWorld(); yield return 0; //生成地牢房间 - _dungeonGenerator = new DungeonGenerator(CurrConfig); + var random = new SeedRandom(1); + _dungeonGenerator = new DungeonGenerator(CurrConfig, random); _dungeonGenerator.Generate(); yield return 0; //填充地牢 - _autoTileConfig = new AutoTileConfig(); + AutoTileConfig = new AutoTileConfig(); _dungeonTileMap = new DungeonTileMap(World.TileRoot); - yield return _dungeonTileMap.AutoFillRoomTile(_autoTileConfig, _dungeonGenerator.StartRoomInfo, _dungeonGenerator.Random); - yield return _dungeonTileMap.AddOutlineTile(_autoTileConfig.WALL_BLOCK); + yield return _dungeonTileMap.AutoFillRoomTile(AutoTileConfig, _dungeonGenerator.StartRoomInfo, random); + yield return _dungeonTileMap.AddOutlineTile(AutoTileConfig.WALL_BLOCK); //生成寻路网格, 这一步操作只生成过道的导航 _dungeonTileMap.GenerateNavigationPolygon(GameConfig.AisleFloorMapLayer); @@ -215,7 +220,6 @@ yield return 0; //门导航区域数据 _roomStaticNavigationList.AddRange(_dungeonTileMap.GetConnectDoorPolygonData()); - yield return 0; //初始化所有房间 yield return _dungeonGenerator.EachRoomCoroutine(InitRoom); @@ -280,7 +284,7 @@ _dungeonGenerator.EachRoom(DisposeRoomInfo); yield return 0; _dungeonTileMap = null; - _autoTileConfig = null; + AutoTileConfig = null; _dungeonGenerator = null; _roomStaticNavigationList.Clear(); _roomStaticNavigationList = null; @@ -429,10 +433,11 @@ roomInfo.RoomFogMask = roomFog; roomFog.Init(roomInfo, new Rect2I( roomInfo.GetWorldPosition() - GameConfig.TileCellSizeVector2I, - (roomInfo.Size + new Vector2I(2, 2)) * GameConfig.TileCellSize)); + (roomInfo.Size + new Vector2I(2, 2)) * GameConfig.TileCellSize) + ); World.FogMaskRoot.AddChild(roomFog); } - + /// /// 玩家第一次进入某个房间回调 /// diff --git a/DungeonShooting_Godot/src/game/ui/mapEditor/tileView/EditorTileMap.cs b/DungeonShooting_Godot/src/game/ui/mapEditor/tileView/EditorTileMap.cs index 9294497..686b15a 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditor/tileView/EditorTileMap.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditor/tileView/EditorTileMap.cs @@ -1,7 +1,5 @@ using System; using System.Collections.Generic; -using System.IO; -using System.Text.Json; using Godot; using Godot.Collections; using UI.MapEditorTools;