Chests and Loot Drops

This commit is contained in:
Marco 2025-04-25 18:33:20 +02:00
commit a2a18c69fc
20 changed files with 242 additions and 58 deletions

View file

@ -1,5 +1,6 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AArray_00601_002Ecs_002Fl_003AC_0021_003FUsers_003FMaddo_003FAppData_003FLocal_003FJetBrains_003FShared_003FvAny_003FDecompilerCache_003Fdecompiler_003F4fd22cd129a84c16b5d8004b467c426f518800_003F67_003F90d26b57_003FArray_00601_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AArray_00601_002Ecs_002Fl_003AC_0021_003FUsers_003FMaddo_003FAppData_003FLocal_003FJetBrains_003FShared_003FvAny_003FDecompilerCache_003Fdecompiler_003F69e3acf0074a4ef8afaea275d4055b96522800_003Fa3_003Fb99d585e_003FArray_00601_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AArray_00601_002Ecs_002Fl_003AC_0021_003FUsers_003FMaddo_003FAppData_003FLocal_003FJetBrains_003FShared_003FvAny_003FDecompilerCache_003Fdecompiler_003Fb9315b94b9124600ad99083b1bc65e44584a00_003Ff6_003F4c30a43e_003FArray_00601_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ABullet_005FScriptMethods_002Egenerated_002Ecs_002Fl_003AC_0021_003FUsers_003FMaddo_003FAppData_003FLocal_003FJetBrains_003FShared_003FvAny_003FSourcesCache_003Fed43dad990dc631ddea2fdab39f95a2741569684_003FBullet_005FScriptMethods_002Egenerated_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ACanvasItem_002Ecs_002Fl_003AC_0021_003FUsers_003FMaddo_003FAppData_003FLocal_003FJetBrains_003FShared_003FvAny_003FSourcesCache_003Fe43c43ee5cdcf2c7c8ddb9366f75a76a3c61c77bf45ceac78721c269f3c360_003FCanvasItem_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>

View file

@ -1,17 +1,33 @@
[gd_resource type="Resource" script_class="RogueliteMapTheme" load_steps=27 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"]
[ext_resource type="PackedScene" uid="uid://djf0y08ix66fn" path="res://Scenes/Interactable/Chest.tscn" id="1_modrh"]
[ext_resource type="PackedScene" uid="uid://db5dwj6nqo8fn" path="res://Scenes/Interactable/control_pad_gray_keycard.tscn" id="1_w43eq"]
[ext_resource type="Resource" uid="uid://oa8s6xydriib" path="res://Resources/Items/Generic_Keycard.tres" id="2_p3lfl"]
[ext_resource type="PackedScene" uid="uid://l84on3kv2s52" path="res://Scenes/Door_Horizontal.tscn" id="2_y7x1u"]
[ext_resource type="PackedScene" uid="uid://bs6o3htusgyjl" path="res://Scenes/Door_Horizontal_Hidden.tscn" id="3_sdu6a"]
[ext_resource type="Resource" uid="uid://dodwpect0ldjf" path="res://Resources/Items/Heart_Pickup.tres" id="3_tsgja"]
[ext_resource type="PackedScene" uid="uid://mtn26qwp4yqy" path="res://Scenes/Items/Gray_Keycard.tscn" id="4_qjf5s"]
[ext_resource type="Resource" uid="uid://bhbufxodybsw4" path="res://Resources/Items/Shield_Pickup.tres" id="4_qo6vk"]
[ext_resource type="PackedScene" uid="uid://dxs3ks2ucaxl4" path="res://Scenes/Items/Red_Keycard.tscn" id="5_0lwa1"]
[ext_resource type="Resource" uid="uid://dy53gia1tmkah" path="res://Resources/Items/Points_Pickup.tres" id="5_ga54h"]
[ext_resource type="PackedScene" uid="uid://bc64lr3vlwchq" path="res://Scenes/Door_Vertical.tscn" id="5_mt0fe"]
[ext_resource type="Resource" uid="uid://b5x83li01qrav" path="res://Resources/RogueliteMaps/TestRGMap.tres" id="5_sludw"]
[ext_resource type="PackedScene" uid="uid://d0yes7huiyisw" path="res://Scenes/Items/Blue_Keycard.tscn" id="6_03ih2"]
[ext_resource type="Resource" uid="uid://ly8l7asedjpx" path="res://Resources/RogueliteMaps/TestRGMap2.tres" id="6_b3pjl"]
[ext_resource type="Resource" uid="uid://cfod8kephnio6" path="res://Resources/Items/Nuclear_Ammo_Pickup.tres" id="6_cxv74"]
[ext_resource type="Resource" uid="uid://diqm2ju0xakkt" path="res://Resources/Items/Yin_Yang_Ammo.tres" id="7_f7mru"]
[ext_resource type="PackedScene" uid="uid://r25rq6ijgm6m" path="res://Scenes/Items/Green_Keycard.tscn" id="7_modrh"]
[ext_resource type="Resource" uid="uid://dn3ai56rrxfnk" path="res://Resources/RogueliteMaps/Beginner1.tres" id="7_nil27"]
[ext_resource type="Resource" uid="uid://dhbltvgsa3g88" path="res://Resources/Items/Spider_Bomb_Pickup.tres" id="8_3kwn2"]
[ext_resource type="PackedScene" uid="uid://8yggb3ay3hr0" path="res://Scenes/Items/Yellow_Keycard.tscn" id="8_exyjy"]
[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"]
@ -26,6 +42,24 @@
[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"]
[ext_resource type="Resource" uid="uid://bdpbekqhuuq4l" path="res://Resources/Items/Shield_Extend_Pickup.tres" id="41_tsgja"]
[ext_resource type="Resource" uid="uid://ciybnocjfpshh" path="res://Resources/Items/Heart_Extend_Pickup.tres" id="42_qo6vk"]
[sub_resource type="Resource" id="Resource_nnvxo"]
script = ExtResource("11_eegnh")
Items = Array[Object]([ExtResource("1_ae3bb"), ExtResource("2_p3lfl"), ExtResource("3_tsgja"), ExtResource("4_qo6vk"), ExtResource("5_ga54h"), ExtResource("6_cxv74"), ExtResource("7_f7mru"), ExtResource("8_3kwn2"), ExtResource("9_to7mi"), ExtResource("10_w335g")])
metadata/_custom_type_script = "uid://rgx0g5iqksnn"
[sub_resource type="Resource" id="Resource_tsgja"]
script = ExtResource("11_eegnh")
Items = Array[Object]([ExtResource("1_ae3bb"), ExtResource("2_p3lfl"), ExtResource("3_tsgja"), ExtResource("4_qo6vk"), ExtResource("5_ga54h"), ExtResource("6_cxv74"), ExtResource("7_f7mru"), ExtResource("8_3kwn2"), ExtResource("9_to7mi"), ExtResource("10_w335g")])
metadata/_custom_type_script = "uid://rgx0g5iqksnn"
[sub_resource type="Resource" id="Resource_11cll"]
script = ExtResource("11_eegnh")
Items = Array[Object]([ExtResource("9_to7mi"), ExtResource("3_tsgja"), ExtResource("10_w335g"), ExtResource("6_cxv74"), ExtResource("9_to7mi"), ExtResource("5_ga54h"), ExtResource("41_tsgja"), ExtResource("42_qo6vk"), ExtResource("7_f7mru"), ExtResource("4_qo6vk"), ExtResource("2_p3lfl"), ExtResource("8_3kwn2")])
metadata/_custom_type_script = "uid://rgx0g5iqksnn"
[resource]
script = ExtResource("1_2rtdw")
@ -35,5 +69,14 @@ VerticalDoorPrefab = ExtResource("5_mt0fe")
VerticalWallPrefab = ExtResource("5_mt0fe")
DoorLockPrefab = ExtResource("1_w43eq")
KeyCardPrefab = ExtResource("4_qjf5s")
ChestPrefab = ExtResource("1_modrh")
VendingMachinePrefab = ExtResource("30_exyjy")
KeyCardsPrefabs = Array[PackedScene]([ExtResource("5_0lwa1"), ExtResource("6_03ih2"), ExtResource("7_modrh"), ExtResource("8_exyjy")])
PointItemResource = ExtResource("5_ga54h")
ChestChance = 5.0
EnemyDropChance = 10.0
ChestLootTable = SubResource("Resource_nnvxo")
ShopLootTable = SubResource("Resource_11cll")
EnemiesLootTable = SubResource("Resource_tsgja")
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")])
metadata/_custom_type_script = "uid://bwtif3if3ea0u"

View file

@ -32,7 +32,7 @@ MaxBranchLength = 2
MaxKeys = 2
MaxSecrets = 1
MaxTreasures = 1
Seed = 2
Seed = 1
[node name="CameraController" type="Camera2D" parent="."]
process_mode = 1

View file

@ -1,10 +1,7 @@
[gd_scene load_steps=10 format=4 uid="uid://b1d8s1dyvlpea"]
[gd_scene load_steps=7 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="PackedScene" uid="uid://l84on3kv2s52" path="res://Scenes/Door_Horizontal.tscn" id="3_tth3t"]
[ext_resource type="PackedScene" uid="uid://bc64lr3vlwchq" path="res://Scenes/Door_Vertical.tscn" id="4_2fric"]
[ext_resource type="PackedScene" uid="uid://b0k2grrc8xp1l" path="res://Scenes/Props/BigTank.tscn" id="4_bl5tn"]
[ext_resource type="TileSet" uid="uid://6k28roiljylj" path="res://Tilesets/factory_tileset.tres" id="5_dhet3"]
[ext_resource type="Script" uid="uid://krean0uywtms" path="res://Scripts/TilemapAvoidance.cs" id="6_wp2g7"]
@ -22,9 +19,6 @@ size = Vector2(272, 85)
process_mode = 1
script = ExtResource("1_gia43")
RoomResource = ExtResource("2_gia43")
DoorPrefab = ExtResource("3_tth3t")
VerticalDoorPrefab = ExtResource("4_2fric")
WallPrefab = ExtResource("4_bl5tn")
[node name="Tilemaps" type="Node2D" parent="." groups=["navigation_polygon_source_geometry_group"]]
@ -75,4 +69,18 @@ collision_mask = 2
position = Vector2(162, 94.5)
shape = SubResource("RectangleShape2D_rlq0q")
[node name="Features" type="Node2D" parent="."]
[node name="Marker2D" type="Marker2D" parent="Features"]
position = Vector2(71, 55)
[node name="Marker2D2" type="Marker2D" parent="Features"]
position = Vector2(296, 120)
[node name="Marker2D3" type="Marker2D" parent="Features"]
position = Vector2(40, 119)
[node name="Marker2D4" type="Marker2D" parent="Features"]
position = Vector2(248, 56)
[connection signal="area_entered" from="PlayerEnterDetector" to="." method="OnRoomEntered"]

View file

@ -1,10 +1,7 @@
[gd_scene load_steps=10 format=4 uid="uid://c4hcrag27aavo"]
[gd_scene load_steps=7 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="PackedScene" uid="uid://l84on3kv2s52" path="res://Scenes/Door_Horizontal.tscn" id="3_8hj7l"]
[ext_resource type="PackedScene" uid="uid://bc64lr3vlwchq" path="res://Scenes/Door_Vertical.tscn" id="4_ay5qo"]
[ext_resource type="PackedScene" uid="uid://b0k2grrc8xp1l" path="res://Scenes/Props/BigTank.tscn" id="4_wqh27"]
[ext_resource type="TileSet" uid="uid://6k28roiljylj" path="res://Tilesets/factory_tileset.tres" id="5_eqg76"]
[ext_resource type="Script" uid="uid://krean0uywtms" path="res://Scripts/TilemapAvoidance.cs" id="6_upxxh"]
@ -22,9 +19,6 @@ size = Vector2(272, 247)
process_mode = 1
script = ExtResource("1_ay5qo")
RoomResource = ExtResource("2_ay5qo")
DoorPrefab = ExtResource("3_8hj7l")
VerticalDoorPrefab = ExtResource("4_ay5qo")
WallPrefab = ExtResource("4_wqh27")
[node name="Tilemaps" type="Node2D" parent="." groups=["navigation_polygon_source_geometry_group"]]
@ -76,4 +70,18 @@ collision_mask = 2
position = Vector2(162, 175.5)
shape = SubResource("RectangleShape2D_4lag8")
[node name="Features" type="Node2D" parent="."]
[node name="Marker2D" type="Marker2D" parent="Features"]
position = Vector2(73, 198)
[node name="Marker2D2" type="Marker2D" parent="Features"]
position = Vector2(295, 71)
[node name="Marker2D3" type="Marker2D" parent="Features"]
position = Vector2(280, 262)
[node name="Marker2D4" type="Marker2D" parent="Features"]
position = Vector2(70, 54)
[connection signal="area_entered" from="PlayerEnterDetector" to="." method="OnRoomEntered"]

View file

@ -1,10 +1,8 @@
[gd_scene load_steps=13 format=4 uid="uid://7svoss2nbksv"]
[gd_scene load_steps=11 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"]
[ext_resource type="PackedScene" uid="uid://l84on3kv2s52" path="res://Scenes/Door_Horizontal.tscn" id="3_7u0ti"]
[ext_resource type="PackedScene" uid="uid://bc64lr3vlwchq" path="res://Scenes/Door_Vertical.tscn" id="4_76t1d"]
[ext_resource type="PackedScene" uid="uid://b0k2grrc8xp1l" path="res://Scenes/Props/BigTank.tscn" id="4_wb0b4"]
[ext_resource type="TileSet" uid="uid://6k28roiljylj" path="res://Tilesets/factory_tileset.tres" id="5_76t1d"]
[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"]
@ -25,9 +23,6 @@ size = Vector2(272, 247)
process_mode = 1
script = ExtResource("1_ntv3p")
RoomResource = ExtResource("2_ntv3p")
DoorPrefab = ExtResource("3_7u0ti")
VerticalDoorPrefab = ExtResource("4_76t1d")
WallPrefab = ExtResource("4_wb0b4")
[node name="Tilemaps" type="Node2D" parent="." groups=["navigation_polygon_source_geometry_group"]]
@ -99,4 +94,12 @@ collision_mask = 2
position = Vector2(162, 175.5)
shape = SubResource("RectangleShape2D_4lag8")
[node name="Features" type="Node2D" parent="."]
[node name="Marker2D" type="Marker2D" parent="Features"]
position = Vector2(41, 152)
[node name="Marker2D2" type="Marker2D" parent="Features"]
position = Vector2(39, 280)
[connection signal="area_entered" from="PlayerEnterDetector" to="." method="OnRoomEntered"]

View file

@ -1,10 +1,7 @@
[gd_scene load_steps=10 format=4 uid="uid://da7hmajaaiohm"]
[gd_scene load_steps=7 format=4 uid="uid://da7hmajaaiohm"]
[ext_resource type="Script" uid="uid://b2j00riayxkit" path="res://Scripts/Controllers/RogueliteRoom.cs" id="1_dm6kf"]
[ext_resource type="Resource" uid="uid://b5x83li01qrav" path="res://Resources/RogueliteMaps/TestRGMap.tres" id="2_5s4nm"]
[ext_resource type="PackedScene" uid="uid://l84on3kv2s52" path="res://Scenes/Door_Horizontal.tscn" id="3_sid7o"]
[ext_resource type="PackedScene" uid="uid://bc64lr3vlwchq" path="res://Scenes/Door_Vertical.tscn" id="4_kfj8c"]
[ext_resource type="PackedScene" uid="uid://b0k2grrc8xp1l" path="res://Scenes/Props/BigTank.tscn" id="4_rlq0q"]
[ext_resource type="TileSet" uid="uid://6k28roiljylj" path="res://Tilesets/factory_tileset.tres" id="5_q5p8k"]
[ext_resource type="Script" uid="uid://krean0uywtms" path="res://Scripts/TilemapAvoidance.cs" id="6_81nvh"]
@ -22,9 +19,6 @@ size = Vector2(272, 85)
process_mode = 1
script = ExtResource("1_dm6kf")
RoomResource = ExtResource("2_5s4nm")
DoorPrefab = ExtResource("3_sid7o")
VerticalDoorPrefab = ExtResource("4_kfj8c")
WallPrefab = ExtResource("4_rlq0q")
[node name="Tilemaps" type="Node2D" parent="." groups=["navigation_polygon_source_geometry_group"]]
@ -74,4 +68,18 @@ collision_mask = 2
position = Vector2(162, 94.5)
shape = SubResource("RectangleShape2D_rlq0q")
[node name="Features" type="Node2D" parent="."]
[node name="Marker2D" type="Marker2D" parent="Features"]
position = Vector2(293, 56)
[node name="Marker2D2" type="Marker2D" parent="Features"]
position = Vector2(25, 135)
[node name="Marker2D3" type="Marker2D" parent="Features"]
position = Vector2(24.4554, 57.8303)
[node name="Marker2D4" type="Marker2D" parent="Features"]
position = Vector2(292, 134)
[connection signal="area_entered" from="PlayerEnterDetector" to="." method="OnRoomEntered"]

View file

@ -1,11 +1,8 @@
[gd_scene load_steps=10 format=4 uid="uid://dcxrdhq1yw5c7"]
[gd_scene load_steps=7 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="PackedScene" uid="uid://l84on3kv2s52" path="res://Scenes/Door_Horizontal.tscn" id="3_wtdf1"]
[ext_resource type="PackedScene" uid="uid://b0k2grrc8xp1l" path="res://Scenes/Props/BigTank.tscn" id="4_hgeju"]
[ext_resource type="PackedScene" uid="uid://bc64lr3vlwchq" path="res://Scenes/Door_Vertical.tscn" id="4_qe4tn"]
[ext_resource type="Script" uid="uid://krean0uywtms" path="res://Scripts/TilemapAvoidance.cs" id="4_wtdf1"]
[sub_resource type="NavigationPolygon" id="NavigationPolygon_f7qjl"]
@ -22,9 +19,6 @@ size = Vector2(272, 85)
process_mode = 1
script = ExtResource("1_cak6m")
RoomResource = ExtResource("2_cak6m")
DoorPrefab = ExtResource("3_wtdf1")
VerticalDoorPrefab = ExtResource("4_qe4tn")
WallPrefab = ExtResource("4_hgeju")
metadata/test_scene = "res://Scenes/Maps/Roguelike.tscn"
[node name="Tilemaps" type="Node2D" parent="." groups=["navigation_polygon_source_geometry_group"]]
@ -74,4 +68,18 @@ collision_mask = 2
position = Vector2(162, 94.5)
shape = SubResource("RectangleShape2D_wtdf1")
[node name="Features" type="Node2D" parent="."]
[node name="Marker2D" type="Marker2D" parent="Features"]
position = Vector2(293, 56)
[node name="Marker2D2" type="Marker2D" parent="Features"]
position = Vector2(25, 135)
[node name="Marker2D3" type="Marker2D" parent="Features"]
position = Vector2(24.4554, 57.8303)
[node name="Marker2D4" type="Marker2D" parent="Features"]
position = Vector2(292, 134)
[connection signal="area_entered" from="PlayerEnterDetector" to="." method="OnRoomEntered"]

View file

@ -1,10 +1,7 @@
[gd_scene load_steps=10 format=4 uid="uid://bon3ay27r54tw"]
[gd_scene load_steps=7 format=4 uid="uid://bon3ay27r54tw"]
[ext_resource type="Script" uid="uid://b2j00riayxkit" path="res://Scripts/Controllers/RogueliteRoom.cs" id="1_0pyb7"]
[ext_resource type="Resource" uid="uid://cb7gk278lmicd" path="res://Resources/RogueliteMaps/Lab2x1_1.tres" id="2_0pyb7"]
[ext_resource type="PackedScene" uid="uid://l84on3kv2s52" path="res://Scenes/Door_Horizontal.tscn" id="3_8uhw6"]
[ext_resource type="PackedScene" uid="uid://bc64lr3vlwchq" path="res://Scenes/Door_Vertical.tscn" id="4_0pyb7"]
[ext_resource type="PackedScene" uid="uid://b0k2grrc8xp1l" path="res://Scenes/Props/BigTank.tscn" id="4_gq82i"]
[ext_resource type="TileSet" uid="uid://6k28roiljylj" path="res://Tilesets/factory_tileset.tres" id="5_xmtgx"]
[ext_resource type="Script" uid="uid://krean0uywtms" path="res://Scripts/TilemapAvoidance.cs" id="6_k6m50"]
@ -22,9 +19,6 @@ size = Vector2(591, 85)
process_mode = 1
script = ExtResource("1_0pyb7")
RoomResource = ExtResource("2_0pyb7")
DoorPrefab = ExtResource("3_8uhw6")
VerticalDoorPrefab = ExtResource("4_0pyb7")
WallPrefab = ExtResource("4_gq82i")
metadata/test_scene = "res://Scenes/Maps/Roguelike.tscn"
[node name="Tilemaps" type="Node2D" parent="." groups=["navigation_polygon_source_geometry_group"]]
@ -76,4 +70,18 @@ collision_mask = 2
position = Vector2(321.5, 94.5)
shape = SubResource("RectangleShape2D_wtdf1")
[node name="Features" type="Node2D" parent="."]
[node name="Marker2D" type="Marker2D" parent="Features"]
position = Vector2(293, 56)
[node name="Marker2D2" type="Marker2D" parent="Features"]
position = Vector2(25, 135)
[node name="Marker2D3" type="Marker2D" parent="Features"]
position = Vector2(24.4554, 57.8303)
[node name="Marker2D4" type="Marker2D" parent="Features"]
position = Vector2(292, 134)
[connection signal="area_entered" from="PlayerEnterDetector" to="." method="OnRoomEntered"]

View file

@ -61,7 +61,7 @@ position = Vector2(223, 289)
position = Vector2(288, 136)
[node name="BigTank2" parent="Tilemaps/Actors" instance=ExtResource("8_tyndx")]
position = Vector2(350, 136)
position = Vector2(352, 136)
[node name="BigTank3" parent="Tilemaps/Actors" instance=ExtResource("8_tyndx")]
position = Vector2(288, 184)
@ -69,6 +69,17 @@ position = Vector2(288, 184)
[node name="BigTank4" parent="Tilemaps/Actors" instance=ExtResource("8_tyndx")]
position = Vector2(352, 184)
[node name="Features" type="Node2D" parent="."]
[node name="ReturnTeleporter" type="Marker2D" parent="Features"]
position = Vector2(319, 170)
[node name="ChestMark" type="Marker2D" parent="Features"]
position = Vector2(327, 56)
[node name="ChestMark2" type="Marker2D" parent="Features"]
position = Vector2(88, 57)
[node name="EnemySpawners" type="Node2D" parent="."]
[node name="RogueliteEnemySpawner" type="Marker2D" parent="EnemySpawners"]

View file

@ -1,10 +1,7 @@
[gd_scene load_steps=10 format=4 uid="uid://pym646ug0ha6"]
[gd_scene load_steps=7 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="PackedScene" uid="uid://l84on3kv2s52" path="res://Scenes/Door_Horizontal.tscn" id="3_kf55v"]
[ext_resource type="PackedScene" uid="uid://b0k2grrc8xp1l" path="res://Scenes/Props/BigTank.tscn" id="4_rxusd"]
[ext_resource type="PackedScene" uid="uid://bc64lr3vlwchq" path="res://Scenes/Door_Vertical.tscn" id="4_y5eok"]
[ext_resource type="TileSet" uid="uid://6k28roiljylj" path="res://Tilesets/factory_tileset.tres" id="5_0c8ec"]
[ext_resource type="Script" uid="uid://krean0uywtms" path="res://Scripts/TilemapAvoidance.cs" id="6_e2cwd"]
@ -22,9 +19,6 @@ size = Vector2(272, 85)
process_mode = 1
script = ExtResource("1_y5eok")
RoomResource = ExtResource("2_y5eok")
DoorPrefab = ExtResource("3_kf55v")
VerticalDoorPrefab = ExtResource("4_y5eok")
WallPrefab = ExtResource("4_rxusd")
[node name="Tilemaps" type="Node2D" parent="." groups=["navigation_polygon_source_geometry_group"]]
@ -75,4 +69,18 @@ collision_mask = 2
position = Vector2(162, 94.5)
shape = SubResource("RectangleShape2D_rlq0q")
[node name="Features" type="Node2D" parent="."]
[node name="Marker2D" type="Marker2D" parent="Features"]
position = Vector2(24, 55)
[node name="Marker2D2" type="Marker2D" parent="Features"]
position = Vector2(296, 135)
[node name="Marker2D3" type="Marker2D" parent="Features"]
position = Vector2(295, 56)
[node name="Marker2D4" type="Marker2D" parent="Features"]
position = Vector2(25, 136)
[connection signal="area_entered" from="PlayerEnterDetector" to="." method="OnRoomEntered"]

View file

@ -76,4 +76,9 @@ collision_mask = 2
position = Vector2(162, 255)
shape = SubResource("RectangleShape2D_g0xrw")
[node name="Features" type="Node2D" parent="."]
[node name="Marker2D" type="Marker2D" parent="Features"]
position = Vector2(54, 74)
[connection signal="area_entered" from="PlayerEnterDetector" to="." method="OnRoomEntered"]

View file

@ -6,7 +6,7 @@ namespace Cirno.Scripts.Components.FSM.Enemy;
public partial class EnemyDropsProvider : Node2D
{
private RandomNumberGenerator _rng = new();
//private RandomNumberGenerator _rng = new();
[Export] public float DropRadius { get; private set; } = 8f;
@ -23,7 +23,7 @@ public partial class EnemyDropsProvider : Node2D
{
if (loot is { Item: not null })
{
float roll = _rng.RandfRange(0f, 100f); // Generate a number between 0 and 100
float roll = (float)GD.RandRange(0d, 100d); // Generate a number between 0 and 100
if (roll <= loot.Chance) // Compare with drop chance
{
DropItem(loot.Item);

View file

@ -14,6 +14,8 @@ public partial class EnemyFSMProxy : CharacterBody2D, IActivable
[Export] public EnemyResource EnemyResource { get; private set; }
[Export] public Array<LootDrop> ExtraLoot { get; private set; } = [];
[Export] public bool OverrideLoot { get; set; } = false;
[Export]
public AiState StartingAiState { get; private set; }

View file

@ -23,7 +23,7 @@ public partial class EnemyStorageModule : Node2D, IFSMStorage
public float MovementSpeed => Root.EnemyResource.MovementSpeed;
public IEnumerable<LootDrop> LootDrops => Root.EnemyResource.LootDrops.Concat(Root.ExtraLoot);
public IEnumerable<LootDrop> LootDrops => Root.OverrideLoot ? Root.ExtraLoot : Root.EnemyResource.LootDrops.Concat(Root.ExtraLoot);
public AiState AiState { get; set; }

View file

@ -5,7 +5,9 @@ using Cirno.Scripts.Components.FSM.Enemy;
using Cirno.Scripts.Enums;
using Cirno.Scripts.Interactables;
using Cirno.Scripts.Resources;
using Cirno.Scripts.Resources.Loot;
using Cirno.Scripts.Resources.Roguelite;
using Cirno.Scripts.Utils;
using Godot;
using Godot.Collections;
@ -59,8 +61,9 @@ public partial class RogueliteRoom : Node2D
public RogueliteRoom Spawn()
{
SpawnEnemies();
SpawnFeatures();
//HandleDoors(connectionChecker);
AddDebugLabel();
//AddDebugLabel();
return this;
}
@ -226,12 +229,55 @@ public partial class RogueliteRoom : Node2D
var enemyScene = GD.Load<PackedScene>(e.PrefabPath);
var spawnedEnemy = spawner.CreateChild<EnemyFSMProxy>(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
});
_enemies.Add(spawnedEnemy);
spawnedEnemy.Death += SpawnedEnemyOnDeath;
}
}
private void SpawnFeatures()
{
// Get feature markers
// Roll for chances
// Spawn the objects
var markersContainer = this.GetNodeOrNull("Features");
if (markersContainer is null) return;
var markerNodes = markersContainer.GetChildren();
foreach (var markerNode in markerNodes)
{
if (markerNode is not Marker2D marker)
{
continue;
}
double chance = GD.RandRange(0d, 100d);
if (chance <= MapTheme.ChestChance)
{
var chest = marker.CreateChild<Chest>(MapTheme.ChestPrefab);
var loot = MapTheme.ChestLootTable.Items.ToList().Shuffle().First();
chest.LootTable.Add(loot);
}
}
}
private void SpawnedEnemyOnDeath(EnemyFSMProxy enemy)
{
enemy.Death -= SpawnedEnemyOnDeath;

View file

@ -6,8 +6,8 @@ namespace Cirno.Scripts.Resources.Loot;
public partial class LootDrop : Resource
{
[Export]
public LootItem Item { get; private set; }
public LootItem Item { get; set; }
[Export(PropertyHint.None, "suffix:%")]
public float Chance { get; private set; }
public float Chance { get; set; }
}

View file

@ -0,0 +1,10 @@
using Godot;
using Godot.Collections;
namespace Cirno.Scripts.Resources.Loot;
[GlobalClass]
public partial class LootTable : Resource
{
[Export] public Array<LootItem> Items { get; set; }
}

View file

@ -0,0 +1 @@
uid://rgx0g5iqksnn

View file

@ -1,4 +1,5 @@
using Cirno.Scripts.Resources.Roguelite;
using Cirno.Scripts.Resources.Loot;
using Cirno.Scripts.Resources.Roguelite;
using Godot;
using Godot.Collections;
@ -7,12 +8,25 @@ namespace Cirno.Scripts.Resources;
[GlobalClass]
public partial class RogueliteMapTheme : Resource
{
[ExportGroup("Prefabs")]
[Export] public PackedScene HorizontalDoorPrefab { get; set; }
[Export] public PackedScene HorizontalWallPrefab { get; set; }
[Export] public PackedScene VerticalDoorPrefab { get; set; }
[Export] public PackedScene VerticalWallPrefab { get; set; }
[Export] public PackedScene DoorLockPrefab { get; set; }
[Export] public PackedScene KeyCardPrefab { get; set; }
[Export] public PackedScene ChestPrefab { get; set; }
[Export] public PackedScene VendingMachinePrefab { get; set; }
[Export] public Array<PackedScene> KeyCardsPrefabs { get; set; }
[Export] public LootItem PointItemResource { get; set; }
[ExportGroup("Chances")]
[Export] public double ChestChance { get; set; }
[Export] public float EnemyDropChance { get; set; }
[Export] public LootTable ChestLootTable { get; set; }
[Export] public LootTable ShopLootTable { get; set; }
[Export] public LootTable EnemiesLootTable { get; set; }
[ExportCategory("Rooms")]
[Export] public Array<RogueliteRoomResource> Rooms { get; set; }
}