From 7a62f6a8cdf3c34ca0eb9f7568488d6bf3da4e7b Mon Sep 17 00:00:00 2001 From: Marco Date: Mon, 28 Apr 2025 12:22:00 +0200 Subject: [PATCH] Fixed enemy spawns --- Resources/RogueliteMaps/Factory_Theme.tres | 12 ++--- Scenes/Maps/Roguelike.tscn | 1 + Scenes/Maps/RogueliteMaps/1x1_1.tscn | 22 ++++++--- Scenes/Maps/RogueliteMaps/1x2_1.tscn | 37 +++++++++++--- Scenes/Maps/RogueliteMaps/RGTestRoom1.tscn | 19 +++++--- Scenes/Maps/RogueliteMaps/Rg2.tscn | 30 +++++++----- Scenes/Maps/RogueliteMaps/RgBig.tscn | 43 ++++++++++++----- Scenes/Maps/RogueliteMaps/RgBig2.tscn | 7 +-- .../Maps/RogueliteMaps/RgHorizontal1x1.tscn | 33 ++++++++++--- Scenes/Maps/RogueliteMaps/RgLarge.tscn | 8 +--- Scenes/Maps/RogueliteMaps/RgLong.tscn | 8 +--- Scenes/Maps/RogueliteMaps/RgLongAcidWalk.tscn | 22 ++++++--- Scenes/Maps/RogueliteMaps/RgLongx3.tscn | 8 +--- Scenes/Maps/RogueliteMaps/SecretRoom1.tscn | 8 +--- Scenes/test.tscn | 29 +++++------ Scripts/Actors/RogueliteEnemySpawner.cs | 48 +++++++++++++++++-- Scripts/AlarmManager.cs | 6 +++ Scripts/Components/FSM/Enemy/EnemyFSMProxy.cs | 5 ++ Scripts/Controllers/RogueliteRoom.cs | 48 +++++++++++-------- 19 files changed, 255 insertions(+), 139 deletions(-) diff --git a/Resources/RogueliteMaps/Factory_Theme.tres b/Resources/RogueliteMaps/Factory_Theme.tres index 5bb912de..98eff4bb 100644 --- a/Resources/RogueliteMaps/Factory_Theme.tres +++ b/Resources/RogueliteMaps/Factory_Theme.tres @@ -1,4 +1,4 @@ -[gd_resource type="Resource" script_class="RogueliteMapTheme" load_steps=55 format=3 uid="uid://cw6868vuvuynh"] +[gd_resource type="Resource" script_class="RogueliteMapTheme" load_steps=49 format=3 uid="uid://cw6868vuvuynh"] [ext_resource type="Script" uid="uid://bwtif3if3ea0u" path="res://Scripts/Resources/RogueliteMapTheme.cs" id="1_2rtdw"] [ext_resource type="Resource" uid="uid://cltxhkrqp055v" path="res://Resources/Items/Money_Pickup.tres" id="1_ae3bb"] @@ -25,12 +25,8 @@ [ext_resource type="Resource" uid="uid://cgac12krx7vbf" path="res://Resources/RogueliteMaps/Boss1.tres" id="8_pmfuo"] [ext_resource type="Resource" uid="uid://bv0mr43vcfrdh" path="res://Resources/RogueliteMaps/BigMap.tres" id="9_0lwa1"] [ext_resource type="Resource" uid="uid://clr1gln7nxa1o" path="res://Resources/Items/Power_Pickup.tres" id="9_to7mi"] -[ext_resource type="Resource" uid="uid://ryfk7g1wqypk" path="res://Resources/RogueliteMaps/TestRGMapLong.tres" id="10_03ih2"] [ext_resource type="Resource" uid="uid://ct1fa2huvy34n" path="res://Resources/Items/Ammo1.tres" id="10_w335g"] [ext_resource type="Script" uid="uid://rgx0g5iqksnn" path="res://Scripts/Resources/Loot/LootTable.cs" id="11_eegnh"] -[ext_resource type="Resource" uid="uid://cjtcksew0qy6d" path="res://Resources/RogueliteMaps/TestRGMapLarge.tres" id="11_modrh"] -[ext_resource type="Resource" uid="uid://cmgiqsmujujss" path="res://Resources/RogueliteMaps/TestMapLongX3.tres" id="12_exyjy"] -[ext_resource type="Resource" uid="uid://n6nb5yco60gi" path="res://Resources/RogueliteMaps/BigLarge.tres" id="13_2j670"] [ext_resource type="Resource" uid="uid://do11fodskgasi" path="res://Resources/RogueliteMaps/RGTestRoom1.tres" id="14_rjphh"] [ext_resource type="Resource" uid="uid://cur433g6oevmd" path="res://Resources/RogueliteMaps/RGLongAcidWalk.tres" id="15_2gg5d"] [ext_resource type="Resource" uid="uid://cc53bb6th33hi" path="res://Resources/RogueliteMaps/RGHorizontal1x1.tres" id="16_402ix"] @@ -38,8 +34,6 @@ [ext_resource type="Resource" uid="uid://cwtma7mxged8a" path="res://Resources/RogueliteMaps/ShopRoom1.tres" id="18_gh41q"] [ext_resource type="Resource" uid="uid://crqgvauqarfaq" path="res://Resources/RogueliteMaps/TreasureRoom1.tres" id="19_bn1n6"] [ext_resource type="Resource" uid="uid://bo4efv7rwowuh" path="res://Resources/RogueliteMaps/SecretRoom1.tres" id="20_0on7r"] -[ext_resource type="Resource" uid="uid://cb7gk278lmicd" path="res://Resources/RogueliteMaps/Lab2x1_1.tres" id="21_m2nxl"] -[ext_resource type="Resource" uid="uid://char0yv78vtty" path="res://Resources/RogueliteMaps/BigTest2.tres" id="22_ae3bb"] [ext_resource type="Resource" uid="uid://bxvv82vno8ub1" path="res://Resources/RogueliteMaps/1x1_1.tres" id="23_p3lfl"] [ext_resource type="Resource" uid="uid://d01146n5uo0gd" path="res://Resources/RogueliteMaps/1x2_1.tres" id="24_tsgja"] [ext_resource type="PackedScene" uid="uid://cl7s06sk106uo" path="res://Scenes/Props/VendingMachine.tscn" id="30_exyjy"] @@ -86,11 +80,11 @@ VendingMachinePrefab = ExtResource("30_exyjy") KeyCardsPrefabs = Array[PackedScene]([ExtResource("5_0lwa1"), ExtResource("6_03ih2"), ExtResource("7_modrh"), ExtResource("8_exyjy")]) ShroudPrefab = ExtResource("43_3kwn2") PointItemResource = ExtResource("5_ga54h") -ChestChance = 5.0 +ChestChance = 15.0 EnemyDropChance = 10.0 ChestLootTable = SubResource("Resource_nnvxo") ShopLootTable = SubResource("Resource_11cll") EnemiesLootTable = SubResource("Resource_tsgja") WeaponsLootTable = SubResource("Resource_eegnh") -Rooms = Array[Object]([ExtResource("5_sludw"), ExtResource("6_b3pjl"), ExtResource("7_nil27"), ExtResource("8_pmfuo"), ExtResource("9_0lwa1"), ExtResource("10_03ih2"), ExtResource("11_modrh"), ExtResource("12_exyjy"), ExtResource("13_2j670"), ExtResource("14_rjphh"), ExtResource("15_2gg5d"), ExtResource("16_402ix"), ExtResource("17_52l5g"), ExtResource("18_gh41q"), ExtResource("19_bn1n6"), ExtResource("20_0on7r"), ExtResource("23_p3lfl"), ExtResource("24_tsgja"), ExtResource("21_m2nxl"), ExtResource("22_ae3bb")]) +Rooms = Array[Object]([ExtResource("5_sludw"), ExtResource("6_b3pjl"), ExtResource("7_nil27"), ExtResource("8_pmfuo"), ExtResource("9_0lwa1"), ExtResource("14_rjphh"), ExtResource("15_2gg5d"), ExtResource("16_402ix"), ExtResource("17_52l5g"), ExtResource("18_gh41q"), ExtResource("19_bn1n6"), ExtResource("20_0on7r"), ExtResource("23_p3lfl"), ExtResource("24_tsgja")]) metadata/_custom_type_script = "uid://bwtif3if3ea0u" diff --git a/Scenes/Maps/Roguelike.tscn b/Scenes/Maps/Roguelike.tscn index 816f6887..d07a7234 100644 --- a/Scenes/Maps/Roguelike.tscn +++ b/Scenes/Maps/Roguelike.tscn @@ -32,6 +32,7 @@ MaxBranchLength = 2 MaxKeys = 2 MaxSecrets = 1 MaxTreasures = 1 +Seed = 1 [node name="CameraController" type="Camera2D" parent="."] process_mode = 1 diff --git a/Scenes/Maps/RogueliteMaps/1x1_1.tscn b/Scenes/Maps/RogueliteMaps/1x1_1.tscn index 27ed47e9..5687c7c0 100644 --- a/Scenes/Maps/RogueliteMaps/1x1_1.tscn +++ b/Scenes/Maps/RogueliteMaps/1x1_1.tscn @@ -1,8 +1,10 @@ -[gd_scene load_steps=7 format=4 uid="uid://b1d8s1dyvlpea"] +[gd_scene load_steps=9 format=4 uid="uid://b1d8s1dyvlpea"] [ext_resource type="Script" uid="uid://b2j00riayxkit" path="res://Scripts/Controllers/RogueliteRoom.cs" id="1_gia43"] [ext_resource type="Resource" uid="uid://bxvv82vno8ub1" path="res://Resources/RogueliteMaps/1x1_1.tres" id="2_gia43"] [ext_resource type="TileSet" uid="uid://6k28roiljylj" path="res://Tilesets/factory_tileset.tres" id="5_dhet3"] +[ext_resource type="Script" uid="uid://8umfjejbkcsm" path="res://Scripts/Actors/RogueliteEnemySpawner.cs" id="5_wqvtg"] +[ext_resource type="Resource" uid="uid://cocl3qontm3be" path="res://Resources/Enemies/Base_Fairy.tres" id="6_gia43"] [ext_resource type="Script" uid="uid://krean0uywtms" path="res://Scripts/TilemapAvoidance.cs" id="6_wp2g7"] [sub_resource type="NavigationPolygon" id="NavigationPolygon_rlq0q"] @@ -47,14 +49,20 @@ metadata/_edit_lock_ = true [node name="EnemySpawners" type="Node2D" parent="."] -[node name="RogueliteEnemySpawner" type="Marker2D" parent="EnemySpawners"] -position = Vector2(64, 129) +[node name="RogueliteEnemySpawner4" type="Marker2D" parent="EnemySpawners"] +position = Vector2(91, 63) +script = ExtResource("5_wqvtg") +Enemy = ExtResource("6_gia43") -[node name="RogueliteEnemySpawner2" type="Marker2D" parent="EnemySpawners"] -position = Vector2(193, 81) +[node name="RogueliteEnemySpawner5" type="Marker2D" parent="EnemySpawners"] +position = Vector2(235, 127) +script = ExtResource("5_wqvtg") +Enemy = ExtResource("6_gia43") -[node name="RogueliteEnemySpawner3" type="Marker2D" parent="EnemySpawners"] -position = Vector2(242, 131) +[node name="RogueliteEnemySpawner6" type="Marker2D" parent="EnemySpawners"] +position = Vector2(117, 130) +script = ExtResource("5_wqvtg") +Enemy = ExtResource("6_gia43") [node name="NavigationRegion2D" type="NavigationRegion2D" parent="."] visible = false diff --git a/Scenes/Maps/RogueliteMaps/1x2_1.tscn b/Scenes/Maps/RogueliteMaps/1x2_1.tscn index 9b7c54ff..dde5cad8 100644 --- a/Scenes/Maps/RogueliteMaps/1x2_1.tscn +++ b/Scenes/Maps/RogueliteMaps/1x2_1.tscn @@ -1,8 +1,10 @@ -[gd_scene load_steps=7 format=4 uid="uid://c4hcrag27aavo"] +[gd_scene load_steps=9 format=4 uid="uid://c4hcrag27aavo"] [ext_resource type="Script" uid="uid://b2j00riayxkit" path="res://Scripts/Controllers/RogueliteRoom.cs" id="1_ay5qo"] [ext_resource type="Resource" uid="uid://d01146n5uo0gd" path="res://Resources/RogueliteMaps/1x2_1.tres" id="2_ay5qo"] +[ext_resource type="Script" uid="uid://8umfjejbkcsm" path="res://Scripts/Actors/RogueliteEnemySpawner.cs" id="5_b8xyw"] [ext_resource type="TileSet" uid="uid://6k28roiljylj" path="res://Tilesets/factory_tileset.tres" id="5_eqg76"] +[ext_resource type="Resource" uid="uid://cocl3qontm3be" path="res://Resources/Enemies/Base_Fairy.tres" id="6_ay5qo"] [ext_resource type="Script" uid="uid://krean0uywtms" path="res://Scripts/TilemapAvoidance.cs" id="6_upxxh"] [sub_resource type="NavigationPolygon" id="NavigationPolygon_rlq0q"] @@ -47,14 +49,35 @@ metadata/_edit_lock_ = true [node name="EnemySpawners" type="Node2D" parent="."] -[node name="RogueliteEnemySpawner" type="Marker2D" parent="EnemySpawners"] -position = Vector2(57, 82) +[node name="RogueliteEnemySpawner4" type="Marker2D" parent="EnemySpawners"] +position = Vector2(96, 103) +script = ExtResource("5_b8xyw") +Enemy = ExtResource("6_ay5qo") -[node name="RogueliteEnemySpawner2" type="Marker2D" parent="EnemySpawners"] -position = Vector2(126, 248) +[node name="RogueliteEnemySpawner5" type="Marker2D" parent="EnemySpawners"] +position = Vector2(96, 103) +script = ExtResource("5_b8xyw") +Enemy = ExtResource("6_ay5qo") -[node name="RogueliteEnemySpawner3" type="Marker2D" parent="EnemySpawners"] -position = Vector2(263, 227) +[node name="RogueliteEnemySpawner4" type="Marker2D" parent="EnemySpawners/RogueliteEnemySpawner5"] +position = Vector2(177.755, 12.2908) +script = ExtResource("5_b8xyw") +Enemy = ExtResource("6_ay5qo") + +[node name="RogueliteEnemySpawner5" type="Marker2D" parent="EnemySpawners/RogueliteEnemySpawner5"] +position = Vector2(-38, 110) +script = ExtResource("5_b8xyw") +Enemy = ExtResource("6_ay5qo") + +[node name="RogueliteEnemySpawner6" type="Marker2D" parent="EnemySpawners/RogueliteEnemySpawner5"] +position = Vector2(77.5222, 89.8643) +script = ExtResource("5_b8xyw") +Enemy = ExtResource("6_ay5qo") + +[node name="RogueliteEnemySpawner7" type="Marker2D" parent="EnemySpawners/RogueliteEnemySpawner5"] +position = Vector2(50.8646, 141.847) +script = ExtResource("5_b8xyw") +Enemy = ExtResource("6_ay5qo") [node name="NavigationRegion2D" type="NavigationRegion2D" parent="."] visible = false diff --git a/Scenes/Maps/RogueliteMaps/RGTestRoom1.tscn b/Scenes/Maps/RogueliteMaps/RGTestRoom1.tscn index cd524aea..48987565 100644 --- a/Scenes/Maps/RogueliteMaps/RGTestRoom1.tscn +++ b/Scenes/Maps/RogueliteMaps/RGTestRoom1.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=11 format=4 uid="uid://7svoss2nbksv"] +[gd_scene load_steps=13 format=4 uid="uid://7svoss2nbksv"] [ext_resource type="Script" uid="uid://b2j00riayxkit" path="res://Scripts/Controllers/RogueliteRoom.cs" id="1_ntv3p"] [ext_resource type="Resource" uid="uid://do11fodskgasi" path="res://Resources/RogueliteMaps/RGTestRoom1.tres" id="2_ntv3p"] @@ -7,6 +7,8 @@ [ext_resource type="Script" uid="uid://krean0uywtms" path="res://Scripts/TilemapAvoidance.cs" id="6_tcpmo"] [ext_resource type="PackedScene" uid="uid://crph24e6e0v0q" path="res://Scenes/Interactable/Control_Pad.tscn" id="7_fyclk"] [ext_resource type="PackedScene" uid="uid://cjsnhyl0nqbau" path="res://Scenes/Props/ICCTv.tscn" id="8_7u0ti"] +[ext_resource type="Script" uid="uid://8umfjejbkcsm" path="res://Scripts/Actors/RogueliteEnemySpawner.cs" id="9_wb0b4"] +[ext_resource type="Resource" uid="uid://qbo6avc7x64b" path="res://Resources/Enemies/Fairy_Guard.tres" id="10_76t1d"] [ext_resource type="PackedScene" uid="uid://cqrkisw6jg24w" path="res://Scenes/Props/MainFrame1.tscn" id="10_wb0b4"] [sub_resource type="NavigationPolygon" id="NavigationPolygon_rlq0q"] @@ -69,16 +71,19 @@ Target = NodePath("../HorizontalDoor") [node name="EnemySpawners" type="Node2D" parent="."] [node name="RogueliteEnemySpawner" type="Marker2D" parent="EnemySpawners"] -position = Vector2(57, 67) +position = Vector2(145, 158) +script = ExtResource("9_wb0b4") +Enemy = ExtResource("10_76t1d") [node name="RogueliteEnemySpawner2" type="Marker2D" parent="EnemySpawners"] -position = Vector2(92.0586, 148.547) +position = Vector2(268.316, 100.913) +script = ExtResource("9_wb0b4") +Enemy = ExtResource("10_76t1d") [node name="RogueliteEnemySpawner3" type="Marker2D" parent="EnemySpawners"] -position = Vector2(108.853, 272.771) - -[node name="RogueliteEnemySpawner4" type="Marker2D" parent="EnemySpawners"] -position = Vector2(270.664, 114.692) +position = Vector2(49.2999, 84.7852) +script = ExtResource("9_wb0b4") +Enemy = ExtResource("10_76t1d") [node name="NavigationRegion2D" type="NavigationRegion2D" parent="."] visible = false diff --git a/Scenes/Maps/RogueliteMaps/Rg2.tscn b/Scenes/Maps/RogueliteMaps/Rg2.tscn index 825ab736..93e81465 100644 --- a/Scenes/Maps/RogueliteMaps/Rg2.tscn +++ b/Scenes/Maps/RogueliteMaps/Rg2.tscn @@ -1,9 +1,12 @@ -[gd_scene load_steps=7 format=4 uid="uid://dcxrdhq1yw5c7"] +[gd_scene load_steps=10 format=4 uid="uid://dcxrdhq1yw5c7"] [ext_resource type="Script" uid="uid://b2j00riayxkit" path="res://Scripts/Controllers/RogueliteRoom.cs" id="1_cak6m"] [ext_resource type="Resource" uid="uid://ly8l7asedjpx" path="res://Resources/RogueliteMaps/TestRGMap2.tres" id="2_cak6m"] [ext_resource type="TileSet" uid="uid://6k28roiljylj" path="res://Tilesets/factory_tileset.tres" id="3_f7qjl"] [ext_resource type="Script" uid="uid://krean0uywtms" path="res://Scripts/TilemapAvoidance.cs" id="4_wtdf1"] +[ext_resource type="Script" uid="uid://8umfjejbkcsm" path="res://Scripts/Actors/RogueliteEnemySpawner.cs" id="5_f7qjl"] +[ext_resource type="Resource" uid="uid://qbo6avc7x64b" path="res://Resources/Enemies/Fairy_Guard.tres" id="6_wtdf1"] +[ext_resource type="Resource" uid="uid://cocl3qontm3be" path="res://Resources/Enemies/Base_Fairy.tres" id="7_wtdf1"] [sub_resource type="NavigationPolygon" id="NavigationPolygon_f7qjl"] vertices = PackedVector2Array(186, 122, 186, 58, 294, 58, 294, 134, 166, 134, 134, 122, 166, 150, 154, 150, 154, 134, 26, 134, 26, 58, 134, 58, 166, 54, 154, 54, 154, 10, 166, 10) @@ -38,7 +41,7 @@ navigation_enabled = false metadata/_edit_lock_ = true [node name="Props" type="TileMapLayer" parent="Tilemaps" groups=["Solid"]] -tile_map_data = PackedByteArray("AAAJAAUAAAAJAAwAAAAJAAYAAAAJAA0AAAAKAAUAAAAKAAwAAAAKAAYAAAAKAA0AAAAAAAMAAAAKAAwAAAAAAAQAAAAKAA0AAAAIAAEAAAAKAAwAAAAIAAIAAAAKAA0AAAALAAEAAAAJAAwAAAALAAIAAAAJAA0AAAATAAMAAAAJAAwAAAATAAQAAAAJAA0AAAA=") +tile_map_data = PackedByteArray("AAAJAAUAAAAJAAwAAAAJAAYAAAAJAA0AAAAKAAUAAAAKAAwAAAAKAAYAAAAKAA0AAAAAAAMAAAAKAAwAAAAAAAQAAAAKAA0AAAAIAAEAAAAKAAwAAAAIAAIAAAAKAA0AAAALAAEAAAAJAAwAAAALAAIAAAAJAA0AAAATAAMAAAAJAAwAAAATAAQAAAAJAA0AAAABAAMAAAAGAAAAAAACAAMAAAAHAAAAAAARAAMAAAAGAAAAAAASAAMAAAAHAAAAAAADAAMAAAAGAAAAAAAEAAMAAAAHAAAAAAAFAAMAAQAAAAAADgAGAAMAAQAAAAAADgABAAgAAQAAAAAADgABAAcAAQAAAAAADgASAAgAAQAAAAAADgALAAUAAQAAAAAAEgALAAYAAQAAAAAAEgA=") tile_set = ExtResource("3_f7qjl") navigation_enabled = false metadata/_edit_lock_ = true @@ -58,9 +61,11 @@ position = Vector2(233, 63) position = Vector2(266, 122) [node name="NavigationRegion2D" type="NavigationRegion2D" parent="."] +visible = false navigation_polygon = SubResource("NavigationPolygon_f7qjl") [node name="PlayerEnterDetector" type="Area2D" parent="."] +visible = false collision_layer = 0 collision_mask = 2 @@ -70,16 +75,19 @@ shape = SubResource("RectangleShape2D_wtdf1") [node name="Features" type="Node2D" parent="."] -[node name="Marker2D" type="Marker2D" parent="Features"] -position = Vector2(293, 56) +[node name="RogueliteEnemySpawner" type="Marker2D" parent="Features"] +position = Vector2(109, 81) +script = ExtResource("5_f7qjl") +Enemy = ExtResource("6_wtdf1") -[node name="Marker2D2" type="Marker2D" parent="Features"] -position = Vector2(25, 135) +[node name="RogueliteEnemySpawner2" type="Marker2D" parent="Features"] +position = Vector2(241.083, 101.736) +script = ExtResource("5_f7qjl") +Enemy = ExtResource("6_wtdf1") -[node name="Marker2D3" type="Marker2D" parent="Features"] -position = Vector2(24.4554, 57.8303) - -[node name="Marker2D4" type="Marker2D" parent="Features"] -position = Vector2(292, 134) +[node name="RogueliteEnemySpawner3" type="Marker2D" parent="Features"] +position = Vector2(75.6301, 120.022) +script = ExtResource("5_f7qjl") +Enemy = ExtResource("7_wtdf1") [connection signal="area_entered" from="PlayerEnterDetector" to="." method="OnRoomEntered"] diff --git a/Scenes/Maps/RogueliteMaps/RgBig.tscn b/Scenes/Maps/RogueliteMaps/RgBig.tscn index 62165f38..9f670d3a 100644 --- a/Scenes/Maps/RogueliteMaps/RgBig.tscn +++ b/Scenes/Maps/RogueliteMaps/RgBig.tscn @@ -1,15 +1,19 @@ -[gd_scene load_steps=9 format=4 uid="uid://dngwjgs5bhnx7"] +[gd_scene load_steps=13 format=4 uid="uid://dngwjgs5bhnx7"] [ext_resource type="Script" uid="uid://b2j00riayxkit" path="res://Scripts/Controllers/RogueliteRoom.cs" id="1_xsqjb"] [ext_resource type="Resource" uid="uid://bv0mr43vcfrdh" path="res://Resources/RogueliteMaps/BigMap.tres" id="2_xsqjb"] [ext_resource type="TileSet" uid="uid://6k28roiljylj" path="res://Tilesets/factory_tileset.tres" id="4_tyndx"] [ext_resource type="Script" uid="uid://krean0uywtms" path="res://Scripts/TilemapAvoidance.cs" id="5_lrgk6"] [ext_resource type="PackedScene" uid="uid://dcbcyp1qogcl0" path="res://Scenes/Props/BigTankHorizontal.tscn" id="6_cgxuy"] +[ext_resource type="Script" uid="uid://8umfjejbkcsm" path="res://Scripts/Actors/RogueliteEnemySpawner.cs" id="7_cgxuy"] +[ext_resource type="PackedScene" uid="uid://c27co22bjym3c" path="res://Scenes/Actors/Camera.tscn" id="7_lrgk6"] +[ext_resource type="Resource" uid="uid://qbo6avc7x64b" path="res://Resources/Enemies/Fairy_Guard.tres" id="8_lrgk6"] [ext_resource type="PackedScene" uid="uid://b0k2grrc8xp1l" path="res://Scenes/Props/BigTank.tscn" id="8_tyndx"] +[ext_resource type="Resource" uid="uid://cqfyuurvqb8m6" path="res://Resources/Enemies/Base_Fairy_Special.tres" id="9_tyndx"] [sub_resource type="NavigationPolygon" id="NavigationPolygon_lrgk6"] -vertices = PackedVector2Array(486, 58, 614, 58, 614, 294, 486, 294, 378, 211, 378, 155, 166, 58, 179, 58, 179, 77, 254, 77, 254, 58, 474, 58, 376, 107, 324, 107, 474, 10, 486, 10, 376, 155, 324, 163, 326, 163, 326, 211, 314, 211, 314, 107, 262, 107, 486, 310, 474, 310, 474, 294, 246, 294, 246, 265, 262, 211, 200, 265, 200, 294, 166, 294, 154, 58, 166, 310, 154, 310, 154, 294, 26, 294, 26, 58, 154, 10, 166, 10) -polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3, 4, 5), PackedInt32Array(6, 7, 8), PackedInt32Array(9, 10, 11, 12, 13), PackedInt32Array(11, 14, 15, 0), PackedInt32Array(12, 11, 0, 5, 16), PackedInt32Array(17, 18, 19, 20), PackedInt32Array(17, 20, 21, 13), PackedInt32Array(9, 13, 21), PackedInt32Array(9, 21, 22), PackedInt32Array(3, 23, 24, 25), PackedInt32Array(4, 3, 25), PackedInt32Array(19, 4, 25, 26, 27), PackedInt32Array(20, 19, 27), PackedInt32Array(28, 20, 27, 29), PackedInt32Array(29, 30, 31, 32, 6, 8), PackedInt32Array(31, 33, 34, 35), PackedInt32Array(35, 36, 37, 32), PackedInt32Array(31, 35, 32), PackedInt32Array(32, 38, 39, 6), PackedInt32Array(29, 8, 9, 22, 28)]) +vertices = PackedVector2Array(246, 265, 248, 212, 326, 211, 378, 211, 358, 230, 313, 262, 248, 278, 314, 211, 262, 211, 520, 244, 534, 234, 614, 234, 614, 262, 550, 262, 520, 198, 534, 134, 248, 166, 262, 107, 166, 58, 179, 58, 179, 77, 168, 102, 249, 77, 249, 88, 202, 118, 168, 118, 294, 88, 294, 90, 330, 90, 330, 88, 360, 88, 360, 84, 374, 84, 374, 107, 326, 107, 314, 107, 426, 230, 378, 138, 442, 138, 457, 182, 457, 232, 442, 58, 474, 58, 518, 122, 504, 182, 474, 10, 486, 10, 486, 58, 518, 58, 570, 122, 570, 90, 614, 90, 585, 118, 614, 118, 585, 134, 504, 198, 472, 232, 472, 244, 550, 294, 486, 294, 486, 310, 474, 310, 474, 294, 426, 294, 358, 262, 313, 278, 248, 294, 246, 294, 168, 260, 200, 265, 200, 294, 166, 294, 154, 282, 154, 260, 166, 310, 154, 310, 154, 294, 56, 262, 26, 262, 26, 186, 42, 186, 42, 102, 26, 102, 26, 58, 57, 58, 57, 88, 86, 88, 86, 102, 54, 102, 54, 186, 86, 186, 86, 234, 88, 234, 88, 260, 56, 294, 102, 260, 102, 282, 168, 244, 184, 244, 184, 234, 202, 234, 138, 102, 138, 58, 154, 58, 154, 10, 166, 10, 216, 166, 216, 212) +polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3, 4, 5, 6), PackedInt32Array(7, 2, 1), PackedInt32Array(8, 7, 1), PackedInt32Array(9, 10, 11, 12, 13), PackedInt32Array(10, 9, 14, 15), PackedInt32Array(8, 1, 16, 17), PackedInt32Array(18, 19, 20, 21), PackedInt32Array(21, 20, 22, 23, 24, 25), PackedInt32Array(23, 26, 27, 17, 24), PackedInt32Array(28, 29, 30), PackedInt32Array(30, 31, 32, 33), PackedInt32Array(30, 33, 34, 28), PackedInt32Array(27, 28, 34, 35), PackedInt32Array(34, 2, 7, 35), PackedInt32Array(27, 35, 17), PackedInt32Array(36, 3, 37, 38, 39, 40), PackedInt32Array(39, 38, 41, 42, 43, 44), PackedInt32Array(42, 45, 46, 47), PackedInt32Array(47, 48, 43), PackedInt32Array(49, 50, 51, 52), PackedInt32Array(51, 53, 52), PackedInt32Array(49, 52, 54, 15), PackedInt32Array(43, 49, 15), PackedInt32Array(15, 14, 55, 44, 43), PackedInt32Array(40, 56, 57), PackedInt32Array(9, 13, 58, 59, 57), PackedInt32Array(59, 60, 61, 62), PackedInt32Array(57, 59, 62), PackedInt32Array(57, 62, 63, 36, 40), PackedInt32Array(4, 64, 5), PackedInt32Array(5, 65, 6), PackedInt32Array(6, 66, 67, 0), PackedInt32Array(68, 69, 70, 71, 72, 73), PackedInt32Array(71, 74, 75, 76), PackedInt32Array(77, 78, 79, 80), PackedInt32Array(81, 82, 83, 84, 85), PackedInt32Array(85, 86, 87, 88), PackedInt32Array(81, 85, 88), PackedInt32Array(80, 81, 88, 89), PackedInt32Array(77, 80, 89), PackedInt32Array(77, 89, 90, 91), PackedInt32Array(77, 91, 92, 93, 94), PackedInt32Array(93, 95, 96, 94), PackedInt32Array(68, 97, 98, 69), PackedInt32Array(69, 98, 99, 100, 0), PackedInt32Array(21, 101, 102, 103), PackedInt32Array(103, 104, 105, 18), PackedInt32Array(21, 103, 18), PackedInt32Array(24, 17, 16, 106), PackedInt32Array(100, 24, 106, 107), PackedInt32Array(76, 94, 96, 72), PackedInt32Array(71, 76, 72), PackedInt32Array(0, 100, 107, 1), PackedInt32Array(36, 4, 3), PackedInt32Array(43, 42, 47)]) outlines = Array[PackedVector2Array]([PackedVector2Array(32, 42, 30, 31, 62, 27, 61, 38)]) parsed_collision_mask = 353 source_geometry_mode = 1 @@ -69,6 +73,9 @@ position = Vector2(288, 184) [node name="BigTank4" parent="Tilemaps/Actors" instance=ExtResource("8_tyndx")] position = Vector2(352, 184) +[node name="Camera" parent="Tilemaps/Actors" instance=ExtResource("7_lrgk6")] +position = Vector2(311, 60) + [node name="Features" type="Node2D" parent="."] [node name="ReturnTeleporter" type="Marker2D" parent="Features"] @@ -82,20 +89,30 @@ position = Vector2(88, 57) [node name="EnemySpawners" type="Node2D" parent="."] -[node name="RogueliteEnemySpawner" type="Marker2D" parent="EnemySpawners"] -position = Vector2(214, 106) +[node name="RogueliteEnemySpawner6" type="Marker2D" parent="EnemySpawners"] +position = Vector2(246, 114) +script = ExtResource("7_cgxuy") +Enemy = ExtResource("8_lrgk6") -[node name="RogueliteEnemySpawner2" type="Marker2D" parent="EnemySpawners"] -position = Vector2(69, 238) +[node name="RogueliteEnemySpawner7" type="Marker2D" parent="EnemySpawners"] +position = Vector2(408, 158) +script = ExtResource("7_cgxuy") +Enemy = ExtResource("8_lrgk6") -[node name="RogueliteEnemySpawner3" type="Marker2D" parent="EnemySpawners"] -position = Vector2(485, 149) +[node name="RogueliteEnemySpawner8" type="Marker2D" parent="EnemySpawners"] +position = Vector2(79.6165, 191.795) +script = ExtResource("7_cgxuy") +Enemy = ExtResource("8_lrgk6") -[node name="RogueliteEnemySpawner4" type="Marker2D" parent="EnemySpawners"] -position = Vector2(449, 268) +[node name="RogueliteEnemySpawner9" type="Marker2D" parent="EnemySpawners"] +position = Vector2(284, 221.998) +script = ExtResource("7_cgxuy") +Enemy = ExtResource("8_lrgk6") -[node name="RogueliteEnemySpawner5" type="Marker2D" parent="EnemySpawners"] -position = Vector2(290, 254) +[node name="RogueliteEnemySpawner10" type="Marker2D" parent="EnemySpawners"] +position = Vector2(444.985, 243.404) +script = ExtResource("7_cgxuy") +Enemy = ExtResource("9_tyndx") [node name="NavigationRegion2D" type="NavigationRegion2D" parent="."] visible = false diff --git a/Scenes/Maps/RogueliteMaps/RgBig2.tscn b/Scenes/Maps/RogueliteMaps/RgBig2.tscn index 8683dc16..d44d6377 100644 --- a/Scenes/Maps/RogueliteMaps/RgBig2.tscn +++ b/Scenes/Maps/RogueliteMaps/RgBig2.tscn @@ -1,9 +1,7 @@ -[gd_scene load_steps=11 format=4 uid="uid://cglddtyl6o4fn"] +[gd_scene load_steps=9 format=4 uid="uid://cglddtyl6o4fn"] [ext_resource type="Script" uid="uid://b2j00riayxkit" path="res://Scripts/Controllers/RogueliteRoom.cs" id="1_7v35i"] [ext_resource type="Resource" uid="uid://char0yv78vtty" path="res://Resources/RogueliteMaps/BigTest2.tres" id="2_7v35i"] -[ext_resource type="PackedScene" uid="uid://l84on3kv2s52" path="res://Scenes/Door_Horizontal.tscn" id="3_iv5kp"] -[ext_resource type="PackedScene" uid="uid://bc64lr3vlwchq" path="res://Scenes/Door_Vertical.tscn" id="4_7v35i"] [ext_resource type="PackedScene" uid="uid://b0k2grrc8xp1l" path="res://Scenes/Props/BigTank.tscn" id="4_fj3qi"] [ext_resource type="TileSet" uid="uid://6k28roiljylj" path="res://Tilesets/factory_tileset.tres" id="5_0x325"] [ext_resource type="Script" uid="uid://krean0uywtms" path="res://Scripts/TilemapAvoidance.cs" id="6_ed0jw"] @@ -23,9 +21,6 @@ size = Vector2(588, 243) process_mode = 1 script = ExtResource("1_7v35i") RoomResource = ExtResource("2_7v35i") -DoorPrefab = ExtResource("3_iv5kp") -VerticalDoorPrefab = ExtResource("4_7v35i") -WallPrefab = ExtResource("4_fj3qi") metadata/test_scene = "res://Scenes/Maps/Roguelike.tscn" [node name="Tilemaps" type="Node2D" parent="." groups=["navigation_polygon_source_geometry_group"]] diff --git a/Scenes/Maps/RogueliteMaps/RgHorizontal1x1.tscn b/Scenes/Maps/RogueliteMaps/RgHorizontal1x1.tscn index 4b5be43c..cb30f1e4 100644 --- a/Scenes/Maps/RogueliteMaps/RgHorizontal1x1.tscn +++ b/Scenes/Maps/RogueliteMaps/RgHorizontal1x1.tscn @@ -1,9 +1,12 @@ -[gd_scene load_steps=7 format=4 uid="uid://pym646ug0ha6"] +[gd_scene load_steps=10 format=4 uid="uid://pym646ug0ha6"] [ext_resource type="Script" uid="uid://b2j00riayxkit" path="res://Scripts/Controllers/RogueliteRoom.cs" id="1_y5eok"] [ext_resource type="Resource" uid="uid://cc53bb6th33hi" path="res://Resources/RogueliteMaps/RGHorizontal1x1.tres" id="2_y5eok"] [ext_resource type="TileSet" uid="uid://6k28roiljylj" path="res://Tilesets/factory_tileset.tres" id="5_0c8ec"] +[ext_resource type="Script" uid="uid://8umfjejbkcsm" path="res://Scripts/Actors/RogueliteEnemySpawner.cs" id="5_y5eok"] [ext_resource type="Script" uid="uid://krean0uywtms" path="res://Scripts/TilemapAvoidance.cs" id="6_e2cwd"] +[ext_resource type="Resource" uid="uid://qbo6avc7x64b" path="res://Resources/Enemies/Fairy_Guard.tres" id="6_lcbol"] +[ext_resource type="Resource" uid="uid://cocl3qontm3be" path="res://Resources/Enemies/Base_Fairy.tres" id="7_kf55v"] [sub_resource type="NavigationPolygon" id="NavigationPolygon_rlq0q"] vertices = PackedVector2Array(166, 58, 294, 58, 294, 134, 166, 134, 166, 150, 154, 150, 154, 134, 154, 58, 26, 134, 26, 58, 166, 10, 154, 10) @@ -47,14 +50,30 @@ metadata/_edit_lock_ = true [node name="EnemySpawners" type="Node2D" parent="."] -[node name="RogueliteEnemySpawner" type="Marker2D" parent="EnemySpawners"] -position = Vector2(57, 67) +[node name="RogueliteEnemySpawner4" type="Marker2D" parent="EnemySpawners"] +position = Vector2(109, 81) +script = ExtResource("5_y5eok") +Enemy = ExtResource("6_lcbol") -[node name="RogueliteEnemySpawner2" type="Marker2D" parent="EnemySpawners"] -position = Vector2(88, 126) +[node name="RogueliteEnemySpawner5" type="Marker2D" parent="EnemySpawners"] +position = Vector2(153, 127) +script = ExtResource("5_y5eok") +Enemy = ExtResource("6_lcbol") -[node name="RogueliteEnemySpawner3" type="Marker2D" parent="EnemySpawners"] -position = Vector2(266, 122) +[node name="RogueliteEnemySpawner6" type="Marker2D" parent="EnemySpawners"] +position = Vector2(172.798, 74.3138) +script = ExtResource("5_y5eok") +Enemy = ExtResource("7_kf55v") + +[node name="RogueliteEnemySpawner7" type="Marker2D" parent="EnemySpawners"] +position = Vector2(199.927, 99.9863) +script = ExtResource("5_y5eok") +Enemy = ExtResource("7_kf55v") + +[node name="RogueliteEnemySpawner8" type="Marker2D" parent="EnemySpawners"] +position = Vector2(82.4885, 130.393) +script = ExtResource("5_y5eok") +Enemy = ExtResource("7_kf55v") [node name="NavigationRegion2D" type="NavigationRegion2D" parent="."] visible = false diff --git a/Scenes/Maps/RogueliteMaps/RgLarge.tscn b/Scenes/Maps/RogueliteMaps/RgLarge.tscn index 40b944ff..b43ac6df 100644 --- a/Scenes/Maps/RogueliteMaps/RgLarge.tscn +++ b/Scenes/Maps/RogueliteMaps/RgLarge.tscn @@ -1,10 +1,7 @@ -[gd_scene load_steps=10 format=4 uid="uid://c36nvk7cw3emg"] +[gd_scene load_steps=7 format=4 uid="uid://c36nvk7cw3emg"] [ext_resource type="Script" uid="uid://b2j00riayxkit" path="res://Scripts/Controllers/RogueliteRoom.cs" id="1_5bd7y"] [ext_resource type="Resource" uid="uid://cjtcksew0qy6d" path="res://Resources/RogueliteMaps/TestRGMapLarge.tres" id="2_5bd7y"] -[ext_resource type="PackedScene" uid="uid://l84on3kv2s52" path="res://Scenes/Door_Horizontal.tscn" id="3_4pnhf"] -[ext_resource type="PackedScene" uid="uid://b0k2grrc8xp1l" path="res://Scenes/Props/BigTank.tscn" id="4_1w61p"] -[ext_resource type="PackedScene" uid="uid://bc64lr3vlwchq" path="res://Scenes/Door_Vertical.tscn" id="4_5bd7y"] [ext_resource type="TileSet" uid="uid://6k28roiljylj" path="res://Tilesets/factory_tileset.tres" id="5_2mndj"] [ext_resource type="Script" uid="uid://krean0uywtms" path="res://Scripts/TilemapAvoidance.cs" id="6_1dlui"] @@ -22,9 +19,6 @@ size = Vector2(909, 85) process_mode = 1 script = ExtResource("1_5bd7y") RoomResource = ExtResource("2_5bd7y") -DoorPrefab = ExtResource("3_4pnhf") -VerticalDoorPrefab = ExtResource("4_5bd7y") -WallPrefab = ExtResource("4_1w61p") [node name="Tilemaps" type="Node2D" parent="." groups=["navigation_polygon_source_geometry_group"]] diff --git a/Scenes/Maps/RogueliteMaps/RgLong.tscn b/Scenes/Maps/RogueliteMaps/RgLong.tscn index ae19d106..a8888606 100644 --- a/Scenes/Maps/RogueliteMaps/RgLong.tscn +++ b/Scenes/Maps/RogueliteMaps/RgLong.tscn @@ -1,10 +1,7 @@ -[gd_scene load_steps=10 format=4 uid="uid://hmu4dw62c10t"] +[gd_scene load_steps=7 format=4 uid="uid://hmu4dw62c10t"] [ext_resource type="Script" uid="uid://b2j00riayxkit" path="res://Scripts/Controllers/RogueliteRoom.cs" id="1_4lag8"] [ext_resource type="Resource" uid="uid://ryfk7g1wqypk" path="res://Resources/RogueliteMaps/TestRGMapLong.tres" id="2_4lag8"] -[ext_resource type="PackedScene" uid="uid://l84on3kv2s52" path="res://Scenes/Door_Horizontal.tscn" id="3_112g0"] -[ext_resource type="PackedScene" uid="uid://bc64lr3vlwchq" path="res://Scenes/Door_Vertical.tscn" id="4_4lag8"] -[ext_resource type="PackedScene" uid="uid://b0k2grrc8xp1l" path="res://Scenes/Props/BigTank.tscn" id="4_wcv20"] [ext_resource type="TileSet" uid="uid://6k28roiljylj" path="res://Tilesets/factory_tileset.tres" id="5_upf1e"] [ext_resource type="Script" uid="uid://krean0uywtms" path="res://Scripts/TilemapAvoidance.cs" id="6_kwstq"] @@ -22,9 +19,6 @@ size = Vector2(272, 247) process_mode = 1 script = ExtResource("1_4lag8") RoomResource = ExtResource("2_4lag8") -DoorPrefab = ExtResource("3_112g0") -VerticalDoorPrefab = ExtResource("4_4lag8") -WallPrefab = ExtResource("4_wcv20") [node name="Tilemaps" type="Node2D" parent="." groups=["navigation_polygon_source_geometry_group"]] diff --git a/Scenes/Maps/RogueliteMaps/RgLongAcidWalk.tscn b/Scenes/Maps/RogueliteMaps/RgLongAcidWalk.tscn index 7e33aa37..57e90acf 100644 --- a/Scenes/Maps/RogueliteMaps/RgLongAcidWalk.tscn +++ b/Scenes/Maps/RogueliteMaps/RgLongAcidWalk.tscn @@ -1,8 +1,10 @@ -[gd_scene load_steps=7 format=4 uid="uid://q3pvpdqv57p3"] +[gd_scene load_steps=9 format=4 uid="uid://q3pvpdqv57p3"] [ext_resource type="Script" uid="uid://b2j00riayxkit" path="res://Scripts/Controllers/RogueliteRoom.cs" id="1_5fsd2"] [ext_resource type="Resource" uid="uid://cur433g6oevmd" path="res://Resources/RogueliteMaps/RGLongAcidWalk.tres" id="2_5fsd2"] [ext_resource type="TileSet" uid="uid://6k28roiljylj" path="res://Tilesets/factory_tileset.tres" id="5_d4ptm"] +[ext_resource type="Script" uid="uid://8umfjejbkcsm" path="res://Scripts/Actors/RogueliteEnemySpawner.cs" id="5_owqsv"] +[ext_resource type="Resource" uid="uid://qbo6avc7x64b" path="res://Resources/Enemies/Fairy_Guard.tres" id="6_5fsd2"] [ext_resource type="Script" uid="uid://krean0uywtms" path="res://Scripts/TilemapAvoidance.cs" id="6_56c74"] [sub_resource type="NavigationPolygon" id="NavigationPolygon_rlq0q"] @@ -53,14 +55,20 @@ metadata/_edit_lock_ = true [node name="EnemySpawners" type="Node2D" parent="."] -[node name="RogueliteEnemySpawner" type="Marker2D" parent="EnemySpawners"] -position = Vector2(165, 397) +[node name="RogueliteEnemySpawner4" type="Marker2D" parent="EnemySpawners"] +position = Vector2(159, 178) +script = ExtResource("5_owqsv") +Enemy = ExtResource("6_5fsd2") -[node name="RogueliteEnemySpawner2" type="Marker2D" parent="EnemySpawners"] -position = Vector2(99, 235) +[node name="RogueliteEnemySpawner5" type="Marker2D" parent="EnemySpawners"] +position = Vector2(245, 246) +script = ExtResource("5_owqsv") +Enemy = ExtResource("6_5fsd2") -[node name="RogueliteEnemySpawner3" type="Marker2D" parent="EnemySpawners"] -position = Vector2(243, 306) +[node name="RogueliteEnemySpawner6" type="Marker2D" parent="EnemySpawners"] +position = Vector2(149, 396) +script = ExtResource("5_owqsv") +Enemy = ExtResource("6_5fsd2") [node name="NavigationRegion2D" type="NavigationRegion2D" parent="."] visible = false diff --git a/Scenes/Maps/RogueliteMaps/RgLongx3.tscn b/Scenes/Maps/RogueliteMaps/RgLongx3.tscn index 68679a92..d66c50f1 100644 --- a/Scenes/Maps/RogueliteMaps/RgLongx3.tscn +++ b/Scenes/Maps/RogueliteMaps/RgLongx3.tscn @@ -1,10 +1,7 @@ -[gd_scene load_steps=10 format=4 uid="uid://ss7hm1utnvn1"] +[gd_scene load_steps=7 format=4 uid="uid://ss7hm1utnvn1"] [ext_resource type="Script" uid="uid://b2j00riayxkit" path="res://Scripts/Controllers/RogueliteRoom.cs" id="1_g0xrw"] [ext_resource type="Resource" uid="uid://cmgiqsmujujss" path="res://Resources/RogueliteMaps/TestMapLongX3.tres" id="2_g0xrw"] -[ext_resource type="PackedScene" uid="uid://l84on3kv2s52" path="res://Scenes/Door_Horizontal.tscn" id="3_5pc34"] -[ext_resource type="PackedScene" uid="uid://bc64lr3vlwchq" path="res://Scenes/Door_Vertical.tscn" id="4_g0xrw"] -[ext_resource type="PackedScene" uid="uid://b0k2grrc8xp1l" path="res://Scenes/Props/BigTank.tscn" id="4_keuv2"] [ext_resource type="TileSet" uid="uid://6k28roiljylj" path="res://Tilesets/factory_tileset.tres" id="5_bsrt7"] [ext_resource type="Script" uid="uid://krean0uywtms" path="res://Scripts/TilemapAvoidance.cs" id="6_mr604"] @@ -22,9 +19,6 @@ size = Vector2(272, 406) process_mode = 1 script = ExtResource("1_g0xrw") RoomResource = ExtResource("2_g0xrw") -DoorPrefab = ExtResource("3_5pc34") -VerticalDoorPrefab = ExtResource("4_g0xrw") -WallPrefab = ExtResource("4_keuv2") [node name="Tilemaps" type="Node2D" parent="." groups=["navigation_polygon_source_geometry_group"]] diff --git a/Scenes/Maps/RogueliteMaps/SecretRoom1.tscn b/Scenes/Maps/RogueliteMaps/SecretRoom1.tscn index 93346da2..ce0a4cbe 100644 --- a/Scenes/Maps/RogueliteMaps/SecretRoom1.tscn +++ b/Scenes/Maps/RogueliteMaps/SecretRoom1.tscn @@ -1,10 +1,7 @@ -[gd_scene load_steps=10 format=4 uid="uid://r2j1wyglsnt5"] +[gd_scene load_steps=7 format=4 uid="uid://r2j1wyglsnt5"] [ext_resource type="Script" uid="uid://b2j00riayxkit" path="res://Scripts/Controllers/RogueliteRoom.cs" id="1_h0a4q"] [ext_resource type="Resource" uid="uid://bo4efv7rwowuh" path="res://Resources/RogueliteMaps/SecretRoom1.tres" id="2_h0a4q"] -[ext_resource type="PackedScene" uid="uid://l84on3kv2s52" path="res://Scenes/Door_Horizontal.tscn" id="3_7u6pf"] -[ext_resource type="PackedScene" uid="uid://bc64lr3vlwchq" path="res://Scenes/Door_Vertical.tscn" id="4_h0a4q"] -[ext_resource type="PackedScene" uid="uid://b0k2grrc8xp1l" path="res://Scenes/Props/BigTank.tscn" id="4_ivf8o"] [ext_resource type="TileSet" uid="uid://6k28roiljylj" path="res://Tilesets/factory_tileset.tres" id="5_4wkxe"] [ext_resource type="Script" uid="uid://krean0uywtms" path="res://Scripts/TilemapAvoidance.cs" id="6_smkbu"] @@ -22,9 +19,6 @@ size = Vector2(272, 85) process_mode = 1 script = ExtResource("1_h0a4q") RoomResource = ExtResource("2_h0a4q") -DoorPrefab = ExtResource("3_7u6pf") -VerticalDoorPrefab = ExtResource("4_h0a4q") -WallPrefab = ExtResource("4_ivf8o") [node name="Tilemaps" type="Node2D" parent="." groups=["navigation_polygon_source_geometry_group"]] diff --git a/Scenes/test.tscn b/Scenes/test.tscn index f5523ca5..9f18ba65 100644 --- a/Scenes/test.tscn +++ b/Scenes/test.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=157 format=4 uid="uid://bv451a8wgty4u"] +[gd_scene load_steps=158 format=4 uid="uid://bv451a8wgty4u"] [ext_resource type="Script" uid="uid://doxmbokehw8ci" path="res://Scripts/GameManager.cs" id="1_8tmoj"] [ext_resource type="PackedScene" uid="uid://c4pr2707hbeph" path="res://Scenes/Actors/fsm_player.tscn" id="2_ksslq"] @@ -53,6 +53,7 @@ [ext_resource type="PackedScene" uid="uid://d0yes7huiyisw" path="res://Scenes/Items/Blue_Keycard.tscn" id="35_rblsn"] [ext_resource type="PackedScene" uid="uid://r25rq6ijgm6m" path="res://Scenes/Items/Green_Keycard.tscn" id="36_f8fh1"] [ext_resource type="PackedScene" uid="uid://dnbtou2fklyvp" path="res://Scenes/Actors/alarm_sign.tscn" id="36_rd6f6"] +[ext_resource type="Script" uid="uid://epnwjptvks3t" path="res://Scripts/Resources/LootItem.cs" id="37_dferh"] [ext_resource type="PackedScene" uid="uid://dsbk2l40er2da" path="res://Scenes/Props/Box_Blue.tscn" id="37_gtga7"] [ext_resource type="PackedScene" uid="uid://c8lgk4wnyi1e6" path="res://Scenes/Actors/HealthStation.tscn" id="38_kuhg5"] [ext_resource type="PackedScene" uid="uid://cl4r3t4c1klv7" path="res://Scenes/Interactable/Switch_Box.tscn" id="38_qnbhd"] @@ -282,7 +283,7 @@ ActivationType = 0 Targets = Array[NodePath]([NodePath("../Rumia")]) WaitForCompletion = true -[sub_resource type="Resource" id="Resource_j86ly"] +[sub_resource type="Resource" id="Resource_y3li7"] resource_local_to_scene = true script = ExtResource("49_0si7g") Target = NodePath(".") @@ -674,7 +675,7 @@ position = Vector2(-1832, -99) [node name="Chest2" parent="Parallax2D/Factory Tilemaps/Debug Room" instance=ExtResource("25_4b2ed")] position = Vector2(-679, -408) -LootTable = [ExtResource("76_dskij"), ExtResource("77_wma5c"), ExtResource("6_khabp"), ExtResource("94_gd7x4"), ExtResource("94_gd7x4"), ExtResource("94_gd7x4"), ExtResource("94_gd7x4"), ExtResource("94_gd7x4"), ExtResource("94_gd7x4"), ExtResource("94_gd7x4"), ExtResource("94_gd7x4"), ExtResource("6_khabp"), ExtResource("6_khabp"), ExtResource("6_khabp"), ExtResource("6_khabp"), ExtResource("6_khabp"), ExtResource("77_wma5c"), ExtResource("77_wma5c"), ExtResource("77_wma5c"), ExtResource("77_wma5c"), ExtResource("76_dskij")] +LootTable = Array[ExtResource("37_dferh")]([ExtResource("76_dskij"), ExtResource("77_wma5c"), ExtResource("6_khabp"), ExtResource("94_gd7x4"), ExtResource("94_gd7x4"), ExtResource("94_gd7x4"), ExtResource("94_gd7x4"), ExtResource("94_gd7x4"), ExtResource("94_gd7x4"), ExtResource("94_gd7x4"), ExtResource("94_gd7x4"), ExtResource("6_khabp"), ExtResource("6_khabp"), ExtResource("6_khabp"), ExtResource("6_khabp"), ExtResource("6_khabp"), ExtResource("77_wma5c"), ExtResource("77_wma5c"), ExtResource("77_wma5c"), ExtResource("77_wma5c"), ExtResource("76_dskij")]) [node name="Valve" parent="Parallax2D/Factory Tilemaps/Debug Room" node_paths=PackedStringArray("Target") instance=ExtResource("48_8usll")] position = Vector2(-666, -545) @@ -859,7 +860,7 @@ position = Vector2(-1488, -544) [node name="Chest" parent="Parallax2D/Factory Tilemaps/LevelProps" instance=ExtResource("25_4b2ed")] position = Vector2(-920, -424) -LootTable = [ExtResource("27_y1lom"), ExtResource("28_u0dff"), ExtResource("29_wb5l5"), ExtResource("30_0d2o6"), ExtResource("5_nqier")] +LootTable = Array[ExtResource("37_dferh")]([ExtResource("27_y1lom"), ExtResource("28_u0dff"), ExtResource("29_wb5l5"), ExtResource("30_0d2o6"), ExtResource("5_nqier")]) [node name="RedKeycard_Switch_2" parent="Parallax2D/Factory Tilemaps/LevelProps" node_paths=PackedStringArray("Target") instance=ExtResource("17_e3v0b")] position = Vector2(-1095, 132) @@ -1121,7 +1122,7 @@ Events = Array[ExtResource("55_j86ly")]([SubResource("Resource_068l7"), SubResou [node name="BossBattleStartScript" parent="Parallax2D/Factory Tilemaps/LevelProps" instance=ExtResource("43_kf3qc")] position = Vector2(-1487, -396) -Events = Array[ExtResource("55_j86ly")]([SubResource("Resource_4f4id"), SubResource("Resource_s2o7m"), SubResource("Resource_b1dht"), SubResource("Resource_xrgpy"), SubResource("Resource_j86ly")]) +Events = Array[ExtResource("55_j86ly")]([SubResource("Resource_4f4id"), SubResource("Resource_s2o7m"), SubResource("Resource_b1dht"), SubResource("Resource_xrgpy"), SubResource("Resource_y3li7")]) [node name="Enemy13" parent="Parallax2D/Factory Tilemaps/LevelProps" instance=ExtResource("47_u1ve6")] position = Vector2(-1657, -788) @@ -1250,7 +1251,7 @@ position = Vector2(-2000, -736) [node name="ControlPad8" parent="Parallax2D/Factory Tilemaps/LevelProps" node_paths=PackedStringArray("Targets") instance=ExtResource("12_hfkf1")] position = Vector2(-2027, -735) Targets = [NodePath("../HorizontalForceField")] -Requirements = [ExtResource("84_ma1ta")] +Requirements = Array[ExtResource("37_dferh")]([ExtResource("84_ma1ta")]) [node name="Ammo6" parent="Parallax2D/Factory Tilemaps/LevelProps" instance=ExtResource("34_17pjh")] position = Vector2(-872, -220) @@ -1314,35 +1315,35 @@ position = Vector2(-1624, -813) [node name="Chest3" parent="Parallax2D/Factory Tilemaps/LevelProps" instance=ExtResource("25_4b2ed")] position = Vector2(-376, 54) -LootTable = [ExtResource("6_khabp"), ExtResource("94_gd7x4"), ExtResource("95_srv0g")] +LootTable = Array[ExtResource("37_dferh")]([ExtResource("6_khabp"), ExtResource("94_gd7x4"), ExtResource("95_srv0g")]) [node name="Chest5" parent="Parallax2D/Factory Tilemaps/LevelProps" instance=ExtResource("25_4b2ed")] position = Vector2(-1048, -139) -LootTable = [ExtResource("6_khabp"), ExtResource("94_gd7x4"), ExtResource("95_srv0g"), ExtResource("4_swym2")] +LootTable = Array[ExtResource("37_dferh")]([ExtResource("6_khabp"), ExtResource("94_gd7x4"), ExtResource("95_srv0g"), ExtResource("4_swym2")]) [node name="Chest6" parent="Parallax2D/Factory Tilemaps/LevelProps" instance=ExtResource("25_4b2ed")] position = Vector2(-2104, -362) -LootTable = [ExtResource("6_khabp"), ExtResource("94_gd7x4"), ExtResource("95_srv0g"), ExtResource("4_swym2")] +LootTable = Array[ExtResource("37_dferh")]([ExtResource("6_khabp"), ExtResource("94_gd7x4"), ExtResource("95_srv0g"), ExtResource("4_swym2")]) [node name="Chest4" parent="Parallax2D/Factory Tilemaps/LevelProps" instance=ExtResource("25_4b2ed")] position = Vector2(-823, 67) -LootTable = [ExtResource("6_khabp"), ExtResource("94_gd7x4"), ExtResource("95_srv0g")] +LootTable = Array[ExtResource("37_dferh")]([ExtResource("6_khabp"), ExtResource("94_gd7x4"), ExtResource("95_srv0g")]) [node name="Chest7" parent="Parallax2D/Factory Tilemaps/LevelProps" instance=ExtResource("25_4b2ed")] position = Vector2(-1417, 326) -LootTable = [ExtResource("6_khabp"), ExtResource("94_gd7x4"), ExtResource("95_srv0g")] +LootTable = Array[ExtResource("37_dferh")]([ExtResource("6_khabp"), ExtResource("94_gd7x4"), ExtResource("95_srv0g")]) [node name="Chest10" parent="Parallax2D/Factory Tilemaps/LevelProps" instance=ExtResource("25_4b2ed")] position = Vector2(-1515, 408) -LootTable = [ExtResource("6_khabp"), ExtResource("94_gd7x4"), ExtResource("95_srv0g")] +LootTable = Array[ExtResource("37_dferh")]([ExtResource("6_khabp"), ExtResource("94_gd7x4"), ExtResource("95_srv0g")]) [node name="Chest8" parent="Parallax2D/Factory Tilemaps/LevelProps" instance=ExtResource("25_4b2ed")] position = Vector2(-1544, 552) -LootTable = [ExtResource("6_khabp"), ExtResource("94_gd7x4"), ExtResource("95_srv0g")] +LootTable = Array[ExtResource("37_dferh")]([ExtResource("6_khabp"), ExtResource("94_gd7x4"), ExtResource("95_srv0g")]) [node name="Chest9" parent="Parallax2D/Factory Tilemaps/LevelProps" instance=ExtResource("25_4b2ed")] position = Vector2(-1384, 231) -LootTable = [ExtResource("6_khabp"), ExtResource("94_gd7x4"), ExtResource("95_srv0g")] +LootTable = Array[ExtResource("37_dferh")]([ExtResource("6_khabp"), ExtResource("94_gd7x4"), ExtResource("95_srv0g")]) [node name="Ammo13" parent="Parallax2D/Factory Tilemaps/LevelProps" instance=ExtResource("34_17pjh")] position = Vector2(-392, 52) diff --git a/Scripts/Actors/RogueliteEnemySpawner.cs b/Scripts/Actors/RogueliteEnemySpawner.cs index 20bc6035..884f8bc4 100644 --- a/Scripts/Actors/RogueliteEnemySpawner.cs +++ b/Scripts/Actors/RogueliteEnemySpawner.cs @@ -1,4 +1,8 @@ -using Cirno.Scripts.Resources; +using System.Linq; +using Cirno.Scripts.Components.FSM.Enemy; +using Cirno.Scripts.Resources; +using Cirno.Scripts.Resources.Loot; +using Cirno.Scripts.Utils; using Godot; namespace Cirno.Scripts.Actors; @@ -22,16 +26,20 @@ public partial class RogueliteEnemySpawner : Marker2D } } + [Export] public int Wave { get; private set; } = 0; + + public bool Spawned { get; private set; } = false; + [ExportToolButton("Update Icon")] public Callable RedrawButton => Callable.From(Redraw); + private EnemyFSMProxy _spawnedEnemy; + public override void _Draw() { if (!Engine.IsEditorHint()) return; if (Enemy is null) return; if (Enemy.IconSprite is null) return; - - DrawTexture(Enemy.IconSprite, - new Vector2(_enemy.IconSprite.GetWidth() / 2f, _enemy.IconSprite.GetHeight() / 2f)); } @@ -39,4 +47,38 @@ public partial class RogueliteEnemySpawner : Marker2D { QueueRedraw(); } + + public EnemyFSMProxy Spawn(RogueliteMapTheme mapTheme) + { + if (Engine.IsEditorHint()) return null; + if (Spawned) return _spawnedEnemy; + + var enemyScene = GD.Load(Enemy.PrefabPath); + _spawnedEnemy = this.CreateSibling(enemyScene); + + _spawnedEnemy.OverrideLoot = true; + _spawnedEnemy.ExtraLoot.Add(new LootDrop() + { + Item = mapTheme.EnemiesLootTable.Items.ToList().Shuffle().First(), + Chance = mapTheme.EnemyDropChance + }); + _spawnedEnemy.ExtraLoot.Add(new LootDrop() + { + Item = mapTheme.PointItemResource, + Chance = 100 + }); + + Spawned = true; + + _spawnedEnemy.Death += SpawnedEnemyOnDeath; + + return _spawnedEnemy; + } + + private void SpawnedEnemyOnDeath(EnemyFSMProxy enemy) + { + _spawnedEnemy.Death -= SpawnedEnemyOnDeath; + _spawnedEnemy = null; + Spawned = false; + } } \ No newline at end of file diff --git a/Scripts/AlarmManager.cs b/Scripts/AlarmManager.cs index 2e78bc8c..749df63a 100644 --- a/Scripts/AlarmManager.cs +++ b/Scripts/AlarmManager.cs @@ -46,6 +46,12 @@ public partial class AlarmManager : Node2D _player?.Play(); } + public void SoundSilentAlarm(Vector2 location) + { + if (IsAlarmOn) return; + EmitSignal(nameof(AlarmEnabled), location); + } + public void DisableAlarm() { IsAlarmOn = false; diff --git a/Scripts/Components/FSM/Enemy/EnemyFSMProxy.cs b/Scripts/Components/FSM/Enemy/EnemyFSMProxy.cs index 6b0e6ffb..51829547 100644 --- a/Scripts/Components/FSM/Enemy/EnemyFSMProxy.cs +++ b/Scripts/Components/FSM/Enemy/EnemyFSMProxy.cs @@ -31,6 +31,11 @@ public partial class EnemyFSMProxy : CharacterBody2D, IActivable { EmitSignalDeath(this); } + + public void RequestAlert(Vector2 destination) + { + //EnemyFSM.SetState(EnemyState.Alert); + } public bool Activate(ActivationType activationType = ActivationType.Toggle) { diff --git a/Scripts/Controllers/RogueliteRoom.cs b/Scripts/Controllers/RogueliteRoom.cs index ac1d619d..710884b4 100644 --- a/Scripts/Controllers/RogueliteRoom.cs +++ b/Scripts/Controllers/RogueliteRoom.cs @@ -1,7 +1,9 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Threading.Tasks; using Cirno.Scripts.Activables; +using Cirno.Scripts.Actors; using Cirno.Scripts.Components.FSM.Enemy; using Cirno.Scripts.Enums; using Cirno.Scripts.Interactables; @@ -61,10 +63,13 @@ public partial class RogueliteRoom : Node2D private List _enemies = []; private Array SpawnableEnemies => RoomResource.SpawnableEnemies; + + private BlackCover _shroud; + private bool _firstEnter = true; public RogueliteRoom Spawn() { - SpawnEnemies(); + //SpawnEnemies(); SpawnFeatures(); SpawnFixedWeapons(); SpawnShroud(); @@ -222,28 +227,13 @@ public partial class RogueliteRoom : Node2D { if (SpawnableEnemies is null || !SpawnableEnemies.Any()) return; - var enemySpawners = this.GetNode("EnemySpawners").GetChildren().Cast(); + var enemySpawnerMarkers = this.GetNode("EnemySpawners").GetChildren(); - foreach (var spawner in enemySpawners) + foreach (var marker in enemySpawnerMarkers) { - var index = GD.RandRange(0, SpawnableEnemies.Count - 1); + if (marker is not RogueliteEnemySpawner spawner) continue; - var e = SpawnableEnemies[index]; - - var enemyScene = GD.Load(e.PrefabPath); - var spawnedEnemy = spawner.CreateChild(enemyScene); - - spawnedEnemy.OverrideLoot = true; - spawnedEnemy.ExtraLoot.Add(new LootDrop() - { - Item = MapTheme.EnemiesLootTable.Items.ToList().Shuffle().First(), - Chance = MapTheme.EnemyDropChance - }); - spawnedEnemy.ExtraLoot.Add(new LootDrop() - { - Item = MapTheme.PointItemResource, - Chance = 100 - }); + var spawnedEnemy = spawner.Spawn(MapTheme); _enemies.Add(spawnedEnemy); @@ -377,6 +367,16 @@ public partial class RogueliteRoom : Node2D { if (area is not InteractionController player) return; + if (_firstEnter) + { + SpawnEnemies(); + _firstEnter = false; + _shroud?.Activate(ActivationType.Disable); + + _ = AlarmTriggerAsync(area.GlobalPosition, 1f); + } + + // This might cause problems later if I delay enemy spawns if (_enemies.Count <= 0) { OpenDoors(); @@ -387,6 +387,12 @@ public partial class RogueliteRoom : Node2D } } + private async Task AlarmTriggerAsync(Vector2 position, float secondsDelay) + { + await Task.Delay((int)(secondsDelay * 1000)); + AlarmManager.Instance.SoundSilentAlarm(position); + } + private void OnRoomExited(Area2D area) { if (area is not InteractionController player) return; @@ -456,6 +462,8 @@ public partial class RogueliteRoom : Node2D shroud.Position = new Vector2(RoomSize.X / 2, RoomSize.Y / 2); shroud.Scale = RoomSize; + _shroud = shroud; + } } \ No newline at end of file