Add door interaction system with requirements and HUD integration

This commit is contained in:
2025-10-30 00:57:28 +01:00
parent 9c0cd3f549
commit 5ae8b6f08c
21 changed files with 337 additions and 14 deletions

View File

@@ -0,0 +1,15 @@
using GameCore.Interaction;
using Godot;
using Godot.Collections;
namespace CryptonymThunder.Code.Resources;
[GlobalClass]
public partial class DoorComponentResource : Resource
{
[Export] public DoorComponent.DoorState InitialState { get; set; } = DoorComponent.DoorState.Closed;
[Export] public bool IsOneTimeUnlock { get; set; } = false;
[Export(PropertyHint.Range, "0.1,10.0,0.1")] public float OpenSpeed { get; set; } = 1.0f;
[ExportGroup("Requirements")] [Export] public Array<InteractionRequirementResource> Requirements { get; set; } = [];
}

View File

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

View File

@@ -0,0 +1,9 @@
using Godot;
namespace CryptonymThunder.Code.Resources;
[GlobalClass]
public partial class InteractionRequirementResource : Resource
{
}

View File

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

View File

@@ -0,0 +1,13 @@
using GameCore.Attributes;
using GameCore.Interaction;
using Godot;
namespace CryptonymThunder.Code.Resources;
[GlobalClass]
public partial class RequiresAttributeRequirementResource : InteractionRequirementResource
{
[Export] public Attribute Attribute { get; set; } = Attribute.Level;
[Export] public float RequiredValue { get; set; } = 1.0f;
[Export] public ComparisonType Comparison { get; set; } = ComparisonType.GreaterOrEqual;
}

View File

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

View File

@@ -0,0 +1,11 @@
using Godot;
namespace CryptonymThunder.Code.Resources;
[GlobalClass]
public partial class RequiresItemRequirementResource : InteractionRequirementResource
{
[Export] public string ItemId { get; set; } = "item_key_green";
[Export(PropertyHint.Range, "1,100,1")] public int Quantity { get; set; } = 1;
[Export] public bool ConsumeItem { get; set; } = true;
}

View File

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