mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 10:35:34 +00:00
Added shrouds to rooms
This commit is contained in:
parent
07d49a0b23
commit
f460103239
12 changed files with 104 additions and 32 deletions
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Cirno.Scripts.Activables;
|
||||
using Cirno.Scripts.Components.FSM.Enemy;
|
||||
using Cirno.Scripts.Enums;
|
||||
using Cirno.Scripts.Interactables;
|
||||
|
|
@ -24,8 +25,11 @@ public partial class RogueliteRoom : Node2D
|
|||
|
||||
public Vector2I BottomLeft => GridPosition + new Vector2I(0, RoomResource.Size.Y - 1);
|
||||
|
||||
private Vector2 BaseRoomSize => new Vector2(320, 160);
|
||||
//private Vector2 BaseRoomSize => new Vector2(320, 160);
|
||||
private Vector2 BaseRoomSize => MapTheme.TileSize * MapTheme.RoomSizeInTiles;
|
||||
|
||||
public Vector2 RoomSize => BaseRoomSize * RoomResource.Size;
|
||||
|
||||
public Vector2I RandomBottomExit()
|
||||
{
|
||||
return BottomLeft + new Vector2I(GD.RandRange(0, RoomResource.Size.X - 1), 0);
|
||||
|
|
@ -63,6 +67,7 @@ public partial class RogueliteRoom : Node2D
|
|||
SpawnEnemies();
|
||||
SpawnFeatures();
|
||||
SpawnFixedWeapons();
|
||||
SpawnShroud();
|
||||
//HandleDoors(connectionChecker);
|
||||
//AddDebugLabel();
|
||||
return this;
|
||||
|
|
@ -441,4 +446,16 @@ public partial class RogueliteRoom : Node2D
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void SpawnShroud()
|
||||
{
|
||||
if (!RoomResource.StartShrouded) return;
|
||||
|
||||
var shroud = this.CreateChild<BlackCover>(MapTheme.ShroudPrefab);
|
||||
|
||||
shroud.Position = new Vector2(RoomSize.X / 2, RoomSize.Y / 2);
|
||||
shroud.Scale = RoomSize;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -121,6 +121,9 @@ public partial class RogueliteRoomManager : Node2D
|
|||
|
||||
var shuffledOffshoots = offshoots.Shuffle().ToList();
|
||||
|
||||
// var offshootsQueue = new Queue<RoomType>();
|
||||
// offshootsQueue.EnqueueRange(shuffledOffshoots);
|
||||
|
||||
int currentOffshoot = 0;
|
||||
|
||||
RogueliteRoom lastRoom = spawnedBeginRoom;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue