mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 10:55:35 +00:00
29 lines
No EOL
722 B
C#
29 lines
No EOL
722 B
C#
using System.Linq;
|
|
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);
|
|
|
|
foreach (var requirement in Requirements)
|
|
{
|
|
InventoryManager.Instance.RemoveItem(requirement.ItemKey, 1);
|
|
}
|
|
|
|
|
|
this.QueueFree();
|
|
|
|
return true;
|
|
}
|
|
} |