mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-16 02:13:46 +00:00
Locked Doors
This commit is contained in:
parent
e62b539a1e
commit
e25da0fe16
20 changed files with 318 additions and 61 deletions
24
Scripts/Interactables/RogueliteDoorLock.cs
Normal file
24
Scripts/Interactables/RogueliteDoorLock.cs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
using Cirno.Scripts.Controllers;
|
||||
|
||||
namespace Cirno.Scripts.Interactables;
|
||||
|
||||
public partial class RogueliteDoorLock : Switch
|
||||
{
|
||||
public RoomConnection Connection { get; set; }
|
||||
|
||||
public override bool Activate(ActivationType activationType = ActivationType.Toggle)
|
||||
{
|
||||
base.Activate(activationType);
|
||||
|
||||
if (!MeetsRequirements()) return false;
|
||||
|
||||
Connection.FromDoor.Activate(activationType);
|
||||
Connection.ToDoor.Activate(activationType);
|
||||
|
||||
InventoryManager.Instance.RemoveItem("GRAY_KEY", 1);
|
||||
|
||||
this.QueueFree();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue