Remove in-progress work that isn't working well
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://bn4gslp2gk8ds"]
|
||||
[gd_scene load_steps=6 format=3 uid="uid://bn4gslp2gk8ds"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/SimpleDungeons/DungeonRoom3D.gd" id="1_y0rqi"]
|
||||
[ext_resource type="PackedScene" uid="uid://ckaw6wjmi0fom" path="res://src/map/dungeon/door/Door.tscn" id="2_vpnlr"]
|
||||
@@ -10,12 +10,12 @@ albedo_color = Color(1, 1, 0, 1)
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_qay2n"]
|
||||
albedo_color = Color(1, 1, 0, 1)
|
||||
|
||||
[sub_resource type="PlaneMesh" id="PlaneMesh_7myha"]
|
||||
size = Vector2(10, 10)
|
||||
|
||||
[node name="Corridor" type="Node3D"]
|
||||
script = ExtResource("1_y0rqi")
|
||||
|
||||
[node name="RemoveUnusedDoors" type="Node" parent="."]
|
||||
script = ExtResource("3_8i1ij")
|
||||
|
||||
[node name="CSGBox3D" type="CSGBox3D" parent="."]
|
||||
use_collision = true
|
||||
size = Vector3(10, 10, 10)
|
||||
@@ -28,20 +28,16 @@ material = SubResource("StandardMaterial3D_qay2n")
|
||||
|
||||
[node name="DOOR?4" parent="CSGBox3D" instance=ExtResource("2_vpnlr")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -2.58627, 5)
|
||||
size = Vector3(4, 4, 1)
|
||||
|
||||
[node name="DOOR?5" parent="CSGBox3D" instance=ExtResource("2_vpnlr")]
|
||||
transform = Transform3D(-0.0899894, 0, 0.995943, 0, 1, 0, -0.995943, 0, -0.0899894, -4.7076, -2.586, 0)
|
||||
size = Vector3(4, 4, 1)
|
||||
|
||||
[node name="DOOR?6" parent="CSGBox3D" instance=ExtResource("2_vpnlr")]
|
||||
transform = Transform3D(-0.0899894, 0, 0.995943, 0, 1, 0, -0.995943, 0, -0.0899894, 4.73741, -2.586, 0)
|
||||
size = Vector3(4, 4, 1)
|
||||
|
||||
[node name="DOOR?2" parent="CSGBox3D" instance=ExtResource("2_vpnlr")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -2.58627, -5)
|
||||
|
||||
[node name="RemoveUnusedDoors" type="Node" parent="."]
|
||||
script = ExtResource("3_8i1ij")
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -4.56974, 0)
|
||||
layers = 2
|
||||
mesh = SubResource("PlaneMesh_7myha")
|
||||
size = Vector3(4, 4, 1)
|
||||
|
||||
@@ -25,8 +25,12 @@ public partial class DungeonRoom : Node3D, IDungeonRoom, IProvide<DungeonRoomLog
|
||||
|
||||
[Node] public Node3D ItemSpawnPoints { get; set; } = default!;
|
||||
|
||||
[Node] public Node3D EnemySpawnPoints { get; set; } = default!;
|
||||
|
||||
[Node] public ItemDatabase ItemDatabase { get; set; } = default!;
|
||||
|
||||
[Node] public EnemyDatabase EnemyDatabase { get; set; } = default!;
|
||||
|
||||
public DungeonRoomLogic.IBinding DungeonRoomBinding { get; set; } = default!;
|
||||
|
||||
public void Setup()
|
||||
@@ -34,10 +38,11 @@ public partial class DungeonRoom : Node3D, IDungeonRoom, IProvide<DungeonRoomLog
|
||||
DungeonRoomLogic = new DungeonRoomLogic();
|
||||
DungeonRoomLogic.Set(this as IDungeonRoom);
|
||||
DungeonRoomLogic.Set(GameRepo);
|
||||
PopulateRoom();
|
||||
SpawnItems();
|
||||
SpawnEnemies();
|
||||
}
|
||||
|
||||
private void PopulateRoom()
|
||||
private void SpawnItems()
|
||||
{
|
||||
var itemSpawnPoints = ItemSpawnPoints.GetChildren();
|
||||
var rng = new RandomNumberGenerator();
|
||||
@@ -58,6 +63,26 @@ public partial class DungeonRoom : Node3D, IDungeonRoom, IProvide<DungeonRoomLog
|
||||
}
|
||||
}
|
||||
|
||||
private void SpawnEnemies()
|
||||
{
|
||||
var rng = new RandomNumberGenerator();
|
||||
rng.Randomize();
|
||||
var enemySpawnPoints = EnemySpawnPoints.GetChildren();
|
||||
var numberOfEnemiesToSpawn = rng.RandiRange(1, enemySpawnPoints.Count);
|
||||
|
||||
foreach (Marker3D spawnPoint in enemySpawnPoints)
|
||||
{
|
||||
if (numberOfEnemiesToSpawn <= 0)
|
||||
break;
|
||||
numberOfEnemiesToSpawn--;
|
||||
|
||||
var enemy = EnemyDatabase.EnemyList[rng.RandWeighted(EnemyDatabase.SpawnRate)];
|
||||
var instantiatedEnemy = enemy.Instantiate<Enemy>();
|
||||
instantiatedEnemy.Position = spawnPoint.Position;
|
||||
AddChild(instantiatedEnemy);
|
||||
}
|
||||
}
|
||||
|
||||
public void OnResolved()
|
||||
{
|
||||
DungeonRoomBinding = DungeonRoomLogic.Bind();
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
[gd_scene load_steps=10 format=3 uid="uid://dhpwwqow1ahrc"]
|
||||
[gd_scene load_steps=13 format=3 uid="uid://dhpwwqow1ahrc"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/SimpleDungeons/DungeonRoom3D.gd" id="1_0tfda"]
|
||||
[ext_resource type="Script" path="res://src/map/dungeon/rooms/DungeonRoom.cs" id="1_ti7ur"]
|
||||
[ext_resource type="PackedScene" uid="uid://ckaw6wjmi0fom" path="res://src/map/dungeon/door/Door.tscn" id="2_mdawx"]
|
||||
[ext_resource type="PackedScene" uid="uid://twrj4wixcbu7" path="res://src/items/ItemDatabase.tscn" id="4_2mnb7"]
|
||||
[ext_resource type="PackedScene" uid="uid://dbvr8ewajja6a" path="res://src/enemy/EnemyDatabase.tscn" id="5_owpbq"]
|
||||
[ext_resource type="PackedScene" uid="uid://dcgj5i52i76gj" path="res://src/enemy/enemy_types/FloatingEnemy.tscn" id="5_urvkv"]
|
||||
[ext_resource type="PackedScene" uid="uid://u1vmmakcoplh" path="res://src/enemy/enemy_types/Capricorn/Capricorn.tscn" id="6_hp0mx"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_nin6j"]
|
||||
albedo_color = Color(1, 0, 0.0784314, 1)
|
||||
@@ -23,9 +26,6 @@ size = Vector2(10, 10)
|
||||
[node name="DungeonRoom3D" type="Node3D"]
|
||||
script = ExtResource("1_0tfda")
|
||||
|
||||
[node name="DungeonRoom" type="Node3D" parent="."]
|
||||
script = ExtResource("1_ti7ur")
|
||||
|
||||
[node name="CSGBox3D" type="CSGBox3D" parent="."]
|
||||
use_collision = true
|
||||
size = Vector3(10, 10, 10)
|
||||
@@ -38,13 +38,18 @@ size = Vector3(9, 9, 9)
|
||||
material = SubResource("StandardMaterial3D_5j6ws")
|
||||
|
||||
[node name="DOOR" parent="CSGBox3D" instance=ExtResource("2_mdawx")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -2.54039, 4.74571)
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.563568, -2.54039, 4.74571)
|
||||
size = Vector3(4, 4, 1)
|
||||
material = SubResource("StandardMaterial3D_it7n4")
|
||||
|
||||
[node name="DOOR2" parent="CSGBox3D" instance=ExtResource("2_mdawx")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -2.58282, -4.73548)
|
||||
size = Vector3(4, 4, 1)
|
||||
material = SubResource("StandardMaterial3D_05l2p")
|
||||
|
||||
[node name="DungeonRoom" type="Node3D" parent="."]
|
||||
script = ExtResource("1_ti7ur")
|
||||
|
||||
[node name="PlayerSpawn" type="Marker3D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -4.23461, 0)
|
||||
@@ -61,5 +66,16 @@ unique_name_in_owner = true
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.54295, -4.48909, -2.92704)
|
||||
gizmo_extents = 1.0
|
||||
|
||||
[node name="EnemySpawnPoints" type="Node3D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
|
||||
[node name="EnemySpawn1" type="Marker3D" parent="EnemySpawnPoints"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.053, -3.59858, 0)
|
||||
|
||||
[node name="ItemDatabase" parent="." instance=ExtResource("4_2mnb7")]
|
||||
unique_name_in_owner = true
|
||||
|
||||
[node name="EnemyDatabase" parent="." instance=ExtResource("5_owpbq")]
|
||||
unique_name_in_owner = true
|
||||
EnemyList = Array[PackedScene]([ExtResource("5_urvkv"), ExtResource("6_hp0mx")])
|
||||
SpawnRate = PackedFloat32Array(0.1, 0.9)
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
[gd_scene load_steps=10 format=3 uid="uid://bbwgmqy3evhh2"]
|
||||
[gd_scene load_steps=11 format=3 uid="uid://bbwgmqy3evhh2"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/SimpleDungeons/DungeonRoom3D.gd" id="1_o02dd"]
|
||||
[ext_resource type="Script" path="res://src/map/dungeon/rooms/DungeonRoom.cs" id="2_jrlll"]
|
||||
[ext_resource type="PackedScene" uid="uid://twrj4wixcbu7" path="res://src/items/ItemDatabase.tscn" id="4_c51bx"]
|
||||
[ext_resource type="PackedScene" uid="uid://ckaw6wjmi0fom" path="res://src/map/dungeon/door/Door.tscn" id="4_nh0nj"]
|
||||
[ext_resource type="PackedScene" uid="uid://dbvr8ewajja6a" path="res://src/enemy/EnemyDatabase.tscn" id="5_fabiq"]
|
||||
|
||||
[sub_resource type="PlaneMesh" id="PlaneMesh_j8q3j"]
|
||||
size = Vector2(50, 10)
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_b8kax"]
|
||||
albedo_color = Color(0.0470588, 0, 1, 1)
|
||||
@@ -17,9 +21,6 @@ albedo_color = Color(0.0470588, 0, 1, 1)
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ham86"]
|
||||
albedo_color = Color(0.0470588, 0, 1, 1)
|
||||
|
||||
[sub_resource type="PlaneMesh" id="PlaneMesh_j8q3j"]
|
||||
size = Vector2(50, 10)
|
||||
|
||||
[node name="DungeonRoom3D" type="Node3D"]
|
||||
script = ExtResource("1_o02dd")
|
||||
size_in_voxels = Vector3i(5, 1, 1)
|
||||
@@ -27,26 +28,6 @@ size_in_voxels = Vector3i(5, 1, 1)
|
||||
[node name="DungeonRoom" type="Node3D" parent="."]
|
||||
script = ExtResource("2_jrlll")
|
||||
|
||||
[node name="CSGBox3D" type="CSGBox3D" parent="."]
|
||||
use_collision = true
|
||||
size = Vector3(50, 10, 10)
|
||||
material = SubResource("StandardMaterial3D_b8kax")
|
||||
|
||||
[node name="CSGBox3D2" type="CSGBox3D" parent="CSGBox3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0493774, 0, 0)
|
||||
operation = 2
|
||||
use_collision = true
|
||||
size = Vector3(49, 9, 9)
|
||||
material = SubResource("StandardMaterial3D_1h648")
|
||||
|
||||
[node name="DOOR" parent="CSGBox3D" instance=ExtResource("4_nh0nj")]
|
||||
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 25, -2.5, 0)
|
||||
material = SubResource("StandardMaterial3D_u3mvg")
|
||||
|
||||
[node name="DOOR2" parent="CSGBox3D" instance=ExtResource("4_nh0nj")]
|
||||
transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -24.578, -2.5, 0)
|
||||
material = SubResource("StandardMaterial3D_ham86")
|
||||
|
||||
[node name="PlayerSpawn" type="Marker3D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -4.23461, 0)
|
||||
@@ -71,6 +52,10 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -16.3726, -4.48909, 2.87214)
|
||||
gizmo_extents = 1.0
|
||||
|
||||
[node name="EnemySpawnPoints" type="Node3D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
|
||||
[node name="EnemySpawn1" type="Marker3D" parent="EnemySpawnPoints"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.833, -3.72961, 0)
|
||||
|
||||
[node name="Minimap Texture" type="MeshInstance3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -4.50433, 0)
|
||||
@@ -79,3 +64,28 @@ mesh = SubResource("PlaneMesh_j8q3j")
|
||||
|
||||
[node name="ItemDatabase" parent="." instance=ExtResource("4_c51bx")]
|
||||
unique_name_in_owner = true
|
||||
|
||||
[node name="EnemyDatabase" parent="." instance=ExtResource("5_fabiq")]
|
||||
unique_name_in_owner = true
|
||||
|
||||
[node name="CSGBox3D" type="CSGBox3D" parent="."]
|
||||
use_collision = true
|
||||
size = Vector3(50, 10, 10)
|
||||
material = SubResource("StandardMaterial3D_b8kax")
|
||||
|
||||
[node name="CSGBox3D2" type="CSGBox3D" parent="CSGBox3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0493774, 0, 0)
|
||||
operation = 2
|
||||
use_collision = true
|
||||
size = Vector3(49, 9, 9)
|
||||
material = SubResource("StandardMaterial3D_1h648")
|
||||
|
||||
[node name="DOOR" parent="CSGBox3D" instance=ExtResource("4_nh0nj")]
|
||||
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 25, -2.5, 0)
|
||||
size = Vector3(4, 4, 1)
|
||||
material = SubResource("StandardMaterial3D_u3mvg")
|
||||
|
||||
[node name="DOOR2" parent="CSGBox3D" instance=ExtResource("4_nh0nj")]
|
||||
transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -24.578, -2.5, 0)
|
||||
size = Vector3(4, 4, 1)
|
||||
material = SubResource("StandardMaterial3D_ham86")
|
||||
|
||||
Reference in New Issue
Block a user