Add door interaction system with requirements and HUD integration
This commit is contained in:
@@ -7,6 +7,7 @@ using GameCore.Combat;
|
||||
using GameCore.Combat.Interfaces;
|
||||
using GameCore.ECS.Interfaces;
|
||||
using GameCore.Input;
|
||||
using GameCore.Interaction;
|
||||
using GameCore.Inventory;
|
||||
using GameCore.Movement;
|
||||
using GameCore.Physics;
|
||||
@@ -19,10 +20,12 @@ public class ComponentFactory
|
||||
{
|
||||
private readonly Dictionary<Type, Func<Resource, IComponent>> _factories = new();
|
||||
private readonly EffectFactory _effectFactory;
|
||||
private readonly InteractionRequirementFactory _requirementFactory;
|
||||
|
||||
public ComponentFactory(EffectFactory effectFactory)
|
||||
public ComponentFactory(EffectFactory effectFactory, InteractionRequirementFactory requirementFactory)
|
||||
{
|
||||
_effectFactory = effectFactory;
|
||||
_requirementFactory = requirementFactory;
|
||||
|
||||
Register<AttributeComponentResource>(CreateAttributeComponent);
|
||||
Register<WeaponComponentResource>(CreateWeaponComponent);
|
||||
@@ -36,6 +39,7 @@ public class ComponentFactory
|
||||
Register<InventoryComponentResource>(_ => new InventoryComponent());
|
||||
Register<PickupComponentResource>(CreatePickupComponent);
|
||||
Register<EquipmentComponentResource>(_ => new EquipmentComponent());
|
||||
Register<DoorComponentResource>(CreateDoorComponent);
|
||||
}
|
||||
|
||||
public IComponent Create(Resource resource)
|
||||
@@ -104,4 +108,25 @@ public class ComponentFactory
|
||||
OnAcquireEffects = onAcquireEffects,
|
||||
};
|
||||
}
|
||||
|
||||
private DoorComponent CreateDoorComponent(DoorComponentResource resource)
|
||||
{
|
||||
var component = new DoorComponent
|
||||
{
|
||||
CurrentState = resource.InitialState,
|
||||
IsOneTimeUnlock = resource.IsOneTimeUnlock,
|
||||
OpenSpeed = resource.OpenSpeed,
|
||||
};
|
||||
|
||||
foreach (var reqResource in resource.Requirements)
|
||||
{
|
||||
var requirement = _requirementFactory.Create(reqResource);
|
||||
if (requirement != null)
|
||||
{
|
||||
component.Requirements.Add(requirement);
|
||||
}
|
||||
}
|
||||
|
||||
return component;
|
||||
}
|
||||
}
|
||||
19
Code/Factories/InteractionRequirementFactory.cs
Normal file
19
Code/Factories/InteractionRequirementFactory.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using CryptonymThunder.Code.Resources;
|
||||
using GameCore.Interaction;
|
||||
using GameCore.Interaction.Interfaces;
|
||||
|
||||
namespace CryptonymThunder.Code.Factories;
|
||||
|
||||
public class InteractionRequirementFactory
|
||||
{
|
||||
public IInteractionRequirement Create(InteractionRequirementResource resource)
|
||||
{
|
||||
return resource switch
|
||||
{
|
||||
RequiresItemRequirementResource itemReq => new RequiresItemRequirement(itemReq.ItemId, itemReq.Quantity, itemReq.ConsumeItem),
|
||||
RequiresAttributeRequirementResource attrReq => new RequiresAttributeRequirement(attrReq.Attribute, attrReq.RequiredValue, attrReq.Comparison),
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(resource), $"Requirement type {resource.GetType().Name} not recognized")
|
||||
};
|
||||
}
|
||||
}
|
||||
1
Code/Factories/InteractionRequirementFactory.cs.uid
Normal file
1
Code/Factories/InteractionRequirementFactory.cs.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cdgsevqxru4oe
|
||||
54
Code/Presenters/DoorPresenter.cs
Normal file
54
Code/Presenters/DoorPresenter.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using GameCore.ECS;
|
||||
using GameCore.ECS.Interfaces;
|
||||
using GameCore.Interaction;
|
||||
using Godot;
|
||||
|
||||
namespace CryptonymThunder.Code.Presenters;
|
||||
|
||||
[GlobalClass]
|
||||
public partial class DoorPresenter : AnimatableBody3D, IEntityPresenter, IPresenterComponent
|
||||
{
|
||||
[Export] private AnimationPlayer _animationPlayer;
|
||||
[Export] private string _openAnimationName = "Open";
|
||||
|
||||
private DoorComponent _doorComponent;
|
||||
private Animation _openAnimation;
|
||||
|
||||
public Entity CoreEntity { get; set; }
|
||||
|
||||
public void Initialize(Entity coreEntity, World world)
|
||||
{
|
||||
CoreEntity = coreEntity;
|
||||
_doorComponent = world.GetComponent<DoorComponent>(CoreEntity);
|
||||
|
||||
if (_animationPlayer == null)
|
||||
{
|
||||
world.Logger.Error($"DoorPresenter '{Name}' is missing an AnimationPlayer!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_animationPlayer.HasAnimation(_openAnimationName))
|
||||
{
|
||||
world.Logger.Error($"DoorPresenter '{Name}' AnimationPlayer is missing animation: '{_openAnimationName}'");
|
||||
return;
|
||||
}
|
||||
|
||||
_openAnimation = _animationPlayer.GetAnimation(_openAnimationName);
|
||||
_animationPlayer.Play(_openAnimationName);
|
||||
_animationPlayer.Pause();
|
||||
SyncToPresentation(0f);
|
||||
}
|
||||
|
||||
public void SyncToPresentation(float delta)
|
||||
{
|
||||
if (_doorComponent == null || _openAnimation == null) return;
|
||||
|
||||
var targetTime = _doorComponent.OpenProgress * _openAnimation.Length;
|
||||
|
||||
_animationPlayer.Seek(targetTime, true);
|
||||
}
|
||||
|
||||
public void SyncToCore(float delta)
|
||||
{
|
||||
}
|
||||
}
|
||||
1
Code/Presenters/DoorPresenter.cs.uid
Normal file
1
Code/Presenters/DoorPresenter.cs.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bxqite0b1di2b
|
||||
@@ -11,6 +11,7 @@ using GameCore.ECS;
|
||||
using GameCore.ECS.Interfaces;
|
||||
using GameCore.Events;
|
||||
using GameCore.Input;
|
||||
using GameCore.Interaction;
|
||||
using GameCore.Inventory;
|
||||
using GameCore.Logging;
|
||||
using GameCore.Logging.Interfaces;
|
||||
@@ -27,6 +28,7 @@ public partial class GamePresenter : Node
|
||||
[Export] private WeaponDatabase WeaponDatabase { get; set; }
|
||||
[Export] private EntityArchetype PlayerArchetype { get; set; }
|
||||
[Export] private SimulationConfigResource SimulationConfig { get; set; }
|
||||
[Export(PropertyHint.Range, "1.0, 10.0, 0.1")] private float InteractionRange { get; set; } = 3.0f;
|
||||
|
||||
private World _world;
|
||||
private PresenterRegistry _presenterRegistry;
|
||||
@@ -61,7 +63,8 @@ public partial class GamePresenter : Node
|
||||
_world = new World(_inputService, _worldQuery, simConfig, _logger);
|
||||
|
||||
var effectFactory = new EffectFactory();
|
||||
var componentFactory = new ComponentFactory(effectFactory);
|
||||
var requirementFactory = new InteractionRequirementFactory();
|
||||
var componentFactory = new ComponentFactory(effectFactory, requirementFactory);
|
||||
var weaponDataService = new GodotWeaponDataService(WeaponDatabase, effectFactory);
|
||||
|
||||
_presenterFactory = new PresenterFactory(_world, componentFactory, _presenterRegistry, this);
|
||||
@@ -80,10 +83,14 @@ public partial class GamePresenter : Node
|
||||
_world.RegisterSystem(new WeaponSwapSystem());
|
||||
_world.RegisterSystem(new EquipmentSystem(_world, weaponDataService));
|
||||
|
||||
_world.RegisterSystem(new InteractionSystem(InteractionRange));
|
||||
_world.RegisterSystem(new DoorSystem());
|
||||
|
||||
_world.RegisterSystem(new WeaponSystem());
|
||||
_world.RegisterSystem(new ProjectileSystem());
|
||||
_world.RegisterSystem(new ProjectileInitializationSystem(_world));
|
||||
|
||||
|
||||
_world.RegisterSystem(new HealingSystem(_world));
|
||||
_world.RegisterSystem(new DamageSystem(_world));
|
||||
_world.RegisterSystem(new ProjectileCleanupSystem());
|
||||
|
||||
@@ -5,6 +5,7 @@ using GameCore.Combat.Effects;
|
||||
using GameCore.ECS;
|
||||
using GameCore.ECS.Interfaces;
|
||||
using GameCore.Events;
|
||||
using GameCore.Interaction;
|
||||
using GameCore.Inventory;
|
||||
using GameCore.Player;
|
||||
using Godot;
|
||||
@@ -23,6 +24,7 @@ public partial class HudPresenterComponent : Control, IPresenterComponent
|
||||
[Export] private Label _healthLabel;
|
||||
[Export] private Label _ammoLabel;
|
||||
[Export] private Label _weaponLabel;
|
||||
[Export] private Label _interactLabel;
|
||||
|
||||
private string _currentAmmoId;
|
||||
|
||||
@@ -45,6 +47,11 @@ public partial class HudPresenterComponent : Control, IPresenterComponent
|
||||
_world.Subscribe<EntityHealedEvent>(OnEntityHealed);
|
||||
_world.Subscribe<InventoryItemChangedEvent>(OnInventoryChanged);
|
||||
_world.Subscribe<WeaponEquippedEvent>(OnWeaponEquipped);
|
||||
|
||||
if (_interactLabel != null)
|
||||
{
|
||||
_interactLabel.Visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnWeaponEquipped(WeaponEquippedEvent e)
|
||||
@@ -113,6 +120,34 @@ public partial class HudPresenterComponent : Control, IPresenterComponent
|
||||
|
||||
public void SyncToPresentation(float delta)
|
||||
{
|
||||
if (_interactLabel != null)
|
||||
{
|
||||
var lookingAt = _world.GetComponent<IsLookingAtInteractableComponent>(_playerEntity);
|
||||
if (lookingAt != null)
|
||||
{
|
||||
var door = _world.GetComponent<DoorComponent>(lookingAt.Target);
|
||||
if (door != null)
|
||||
{
|
||||
var interactKey = "F";
|
||||
_interactLabel.Text = door.CurrentState switch
|
||||
{
|
||||
DoorComponent.DoorState.Locked => $"[{interactKey}] Interact (Locked)",
|
||||
DoorComponent.DoorState.Closed => $"[{interactKey}] Open Door",
|
||||
DoorComponent.DoorState.Open => $"[{interactKey}] Close Door",
|
||||
_ => ""
|
||||
};
|
||||
_interactLabel.Visible = !string.IsNullOrEmpty(_interactLabel.Text);
|
||||
}
|
||||
else
|
||||
{
|
||||
_interactLabel.Visible = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_interactLabel.Visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void SyncToCore(float delta)
|
||||
|
||||
15
Code/Resources/DoorComponentResource.cs
Normal file
15
Code/Resources/DoorComponentResource.cs
Normal 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; } = [];
|
||||
}
|
||||
1
Code/Resources/DoorComponentResource.cs.uid
Normal file
1
Code/Resources/DoorComponentResource.cs.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://ymtyxkea76mv
|
||||
9
Code/Resources/InteractionRequirementResource.cs
Normal file
9
Code/Resources/InteractionRequirementResource.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using Godot;
|
||||
|
||||
namespace CryptonymThunder.Code.Resources;
|
||||
|
||||
[GlobalClass]
|
||||
public partial class InteractionRequirementResource : Resource
|
||||
{
|
||||
|
||||
}
|
||||
1
Code/Resources/InteractionRequirementResource.cs.uid
Normal file
1
Code/Resources/InteractionRequirementResource.cs.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dtqh3dwx7xc5u
|
||||
13
Code/Resources/RequiresAttributeRequirementResource.cs
Normal file
13
Code/Resources/RequiresAttributeRequirementResource.cs
Normal 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;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://d07gx65gcsvb
|
||||
11
Code/Resources/RequiresItemRequirementResource.cs
Normal file
11
Code/Resources/RequiresItemRequirementResource.cs
Normal 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;
|
||||
}
|
||||
1
Code/Resources/RequiresItemRequirementResource.cs.uid
Normal file
1
Code/Resources/RequiresItemRequirementResource.cs.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dnyfoaprv6bhw
|
||||
@@ -39,7 +39,7 @@ public class GodotInputService : IInputService
|
||||
|
||||
IsJumping = Input.IsActionJustPressed("jump");
|
||||
IsFiring = Input.IsActionPressed("fire");
|
||||
IsInteracting = Input.IsActionPressed("interact");
|
||||
IsInteracting = Input.IsActionJustPressed("interact");
|
||||
IsSwapWeaponNext = Input.IsActionJustPressed("swap_weapon_next");
|
||||
IsSwapWeaponPrevious = Input.IsActionJustPressed("swap_weapon_previous");
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
[ext_resource type="Script" uid="uid://c6nouigv5wsu1" path="res://Code/Presenters/HudPresenterComponent.cs" id="1_yd76s"]
|
||||
|
||||
[node name="PlayerHUD" type="Control" node_paths=PackedStringArray("_healthLabel", "_ammoLabel", "_weaponLabel")]
|
||||
[node name="PlayerHUD" type="Control" node_paths=PackedStringArray("_healthLabel", "_ammoLabel", "_weaponLabel", "_interactLabel")]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
@@ -13,6 +13,7 @@ script = ExtResource("1_yd76s")
|
||||
_healthLabel = NodePath("MarginContainer/HBoxContainer/HealthLabel")
|
||||
_ammoLabel = NodePath("MarginContainer/HBoxContainer/AmmoLabel")
|
||||
_weaponLabel = NodePath("MarginContainer/HBoxContainer/WeaponLabel")
|
||||
_interactLabel = NodePath("MarginContainer/Interact")
|
||||
metadata/_custom_type_script = "uid://c6nouigv5wsu1"
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||
@@ -44,3 +45,9 @@ uppercase = true
|
||||
layout_mode = 2
|
||||
text = "gun"
|
||||
uppercase = true
|
||||
|
||||
[node name="Interact" type="Label" parent="MarginContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
text = "INTERACT"
|
||||
uppercase = true
|
||||
|
||||
35
Objects/green_card_pickup.tscn
Normal file
35
Objects/green_card_pickup.tscn
Normal file
@@ -0,0 +1,35 @@
|
||||
[gd_scene load_steps=8 format=3 uid="uid://cww3lcsxldnt3"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://ck82xby5qe680" path="res://Code/Presenters/PickupPresenter.cs" id="1_6m8gq"]
|
||||
[ext_resource type="Script" uid="uid://b6x8llipvutqs" path="res://Code/Presenters/SceneEntity.cs" id="2_m5j0n"]
|
||||
[ext_resource type="Script" uid="uid://cg8upylcrj8le" path="res://Code/Resources/PickupComponentResource.cs" id="3_1xw6x"]
|
||||
|
||||
[sub_resource type="BoxMesh" id="BoxMesh_6m8gq"]
|
||||
size = Vector3(0.4, 0.4, 0.3)
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_6m8gq"]
|
||||
albedo_color = Color(0, 1, 0, 1)
|
||||
|
||||
[sub_resource type="ConvexPolygonShape3D" id="ConvexPolygonShape3D_m5j0n"]
|
||||
points = PackedVector3Array(-0.19894178, -0.19894178, -0.14999999, 0.19999999, 0.19999999, 0.14920634, 0.19999999, -0.19999999, 0.14920634, -0.19999999, 0.19999999, 0.14920634, 0.19894178, 0.19894178, -0.14999999, -0.19999999, -0.19999999, 0.14920634, 0.19894178, -0.19894178, -0.14999999, -0.19894178, 0.19894178, -0.14999999)
|
||||
|
||||
[sub_resource type="Resource" id="Resource_7g0sf"]
|
||||
script = ExtResource("3_1xw6x")
|
||||
ItemId = "item_key_green"
|
||||
OnAcquireEffects = null
|
||||
metadata/_custom_type_script = "uid://cg8upylcrj8le"
|
||||
|
||||
[node name="Green Card Pickup" type="Area3D"]
|
||||
script = ExtResource("1_6m8gq")
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
||||
mesh = SubResource("BoxMesh_6m8gq")
|
||||
surface_material_override/0 = SubResource("StandardMaterial3D_6m8gq")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
shape = SubResource("ConvexPolygonShape3D_m5j0n")
|
||||
|
||||
[node name="SceneEntity" type="Node" parent="." groups=["SceneEntities"]]
|
||||
script = ExtResource("2_m5j0n")
|
||||
ComponentResources = Array[Resource]([SubResource("Resource_7g0sf")])
|
||||
metadata/_custom_type_script = "uid://b6x8llipvutqs"
|
||||
84
Objects/green_door.tscn
Normal file
84
Objects/green_door.tscn
Normal file
@@ -0,0 +1,84 @@
|
||||
[gd_scene load_steps=13 format=3 uid="uid://b1d2gc8goj6gx"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bxqite0b1di2b" path="res://Code/Presenters/DoorPresenter.cs" id="1_0k8gl"]
|
||||
[ext_resource type="Script" uid="uid://b6x8llipvutqs" path="res://Code/Presenters/SceneEntity.cs" id="2_l5dry"]
|
||||
[ext_resource type="Script" uid="uid://dnyfoaprv6bhw" path="res://Code/Resources/RequiresItemRequirementResource.cs" id="3_3dbp0"]
|
||||
[ext_resource type="Script" uid="uid://ymtyxkea76mv" path="res://Code/Resources/DoorComponentResource.cs" id="4_g4ryb"]
|
||||
|
||||
[sub_resource type="BoxMesh" id="BoxMesh_u2oqr"]
|
||||
size = Vector3(1, 2, 0.3)
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_l4yuh"]
|
||||
albedo_color = Color(0.14891627, 0.744422, 0, 1)
|
||||
|
||||
[sub_resource type="ConvexPolygonShape3D" id="ConvexPolygonShape3D_l5dry"]
|
||||
points = PackedVector3Array(-0.5, -1, -0.15, -0.5, -1, 0.15, -0.5, 1, -0.15, 0.5, -1, -0.15, 0.5, -1, 0.15, -0.5, 1, 0.15, 0.5, 1, -0.15, 0.5, 1, 0.15)
|
||||
|
||||
[sub_resource type="Animation" id="Animation_rv1pd"]
|
||||
resource_name = "open"
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath(".:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 1),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector3(0, 0, 0), Vector3(0, 3, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_me0pg"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath(".:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector3(0, 0, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_dgrt5"]
|
||||
_data = {
|
||||
&"RESET": SubResource("Animation_me0pg"),
|
||||
&"open": SubResource("Animation_rv1pd")
|
||||
}
|
||||
|
||||
[sub_resource type="Resource" id="Resource_g2hal"]
|
||||
script = ExtResource("3_3dbp0")
|
||||
metadata/_custom_type_script = "uid://dnyfoaprv6bhw"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_fyehb"]
|
||||
script = ExtResource("4_g4ryb")
|
||||
InitialState = 0
|
||||
Requirements = Array[Object]([SubResource("Resource_g2hal")])
|
||||
metadata/_custom_type_script = "uid://ymtyxkea76mv"
|
||||
|
||||
[node name="GreenDoor" type="AnimatableBody3D" node_paths=PackedStringArray("_animationPlayer")]
|
||||
script = ExtResource("1_0k8gl")
|
||||
_animationPlayer = NodePath("AnimationPlayer")
|
||||
_openAnimationName = "open"
|
||||
metadata/_custom_type_script = "uid://bxqite0b1di2b"
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
||||
mesh = SubResource("BoxMesh_u2oqr")
|
||||
surface_material_override/0 = SubResource("StandardMaterial3D_l4yuh")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
shape = SubResource("ConvexPolygonShape3D_l5dry")
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
libraries = {
|
||||
&"": SubResource("AnimationLibrary_dgrt5")
|
||||
}
|
||||
|
||||
[node name="SceneEntity" type="Node" parent="." groups=["SceneEntities"]]
|
||||
script = ExtResource("2_l5dry")
|
||||
ComponentResources = Array[Resource]([SubResource("Resource_fyehb")])
|
||||
metadata/_custom_type_script = "uid://b6x8llipvutqs"
|
||||
@@ -1,8 +1,8 @@
|
||||
[gd_resource type="Resource" script_class="WeaponResource" load_steps=8 format=3 uid="uid://tj3ojc3bl7d8"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cht6trljihvle" path="res://Code/Resources/Effects/FireProjectileEffectResource.cs" id="1_p2b4p"]
|
||||
[ext_resource type="Script" uid="uid://hf0iut8o8do3" path="res://Code/Resources/WeaponResource.cs" id="1_qn35l"]
|
||||
[ext_resource type="Script" uid="uid://b6argm77cho2t" path="res://Code/Resources/Effects/ConsumeAmmoCostResource.cs" id="1_yt3rn"]
|
||||
[ext_resource type="Script" uid="uid://chc0d0rjcbl65" path="res://Code/Resources/Effects/HitscanEffectResource.cs" id="2_1h0aq"]
|
||||
[ext_resource type="Script" uid="uid://btv24gsw1p850" path="res://Code/Resources/Effects/DamageEffectResource.cs" id="2_yt3rn"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_1h0aq"]
|
||||
@@ -10,13 +10,9 @@ script = ExtResource("1_yt3rn")
|
||||
AmmoId = "basic_bullet"
|
||||
metadata/_custom_type_script = "uid://b6argm77cho2t"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_yt3rn"]
|
||||
script = ExtResource("1_p2b4p")
|
||||
ProjectileArchetypeId = "basic_bullet"
|
||||
Count = 3
|
||||
SpreadAngle = 5.7
|
||||
ProjectileSpeed = 10.0
|
||||
metadata/_custom_type_script = "uid://cht6trljihvle"
|
||||
[sub_resource type="Resource" id="Resource_i15wf"]
|
||||
script = ExtResource("2_1h0aq")
|
||||
metadata/_custom_type_script = "uid://chc0d0rjcbl65"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_wqp4f"]
|
||||
script = ExtResource("2_yt3rn")
|
||||
@@ -26,6 +22,6 @@ metadata/_custom_type_script = "uid://btv24gsw1p850"
|
||||
script = ExtResource("1_qn35l")
|
||||
FireRate = 10.0
|
||||
FireCosts = Array[Object]([SubResource("Resource_1h0aq")])
|
||||
OnFireEffects = Array[Object]([SubResource("Resource_yt3rn")])
|
||||
OnFireEffects = Array[Object]([SubResource("Resource_i15wf")])
|
||||
OnHitEffects = Array[Object]([SubResource("Resource_wqp4f")])
|
||||
metadata/_custom_type_script = "uid://hf0iut8o8do3"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=25 format=4 uid="uid://bkvgcsb8d3v7p"]
|
||||
[gd_scene load_steps=27 format=4 uid="uid://bkvgcsb8d3v7p"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cfpm5p102f65x" path="res://Code/Presenters/GamePresenter.cs" id="1_qvgq0"]
|
||||
[ext_resource type="Resource" uid="uid://biev6ri5s8kyf" path="res://Resources/Entities/player.tres" id="2_alii3"]
|
||||
@@ -12,6 +12,8 @@
|
||||
[ext_resource type="PackedScene" uid="uid://bqdgw5gimh5ug" path="res://Objects/knife_pickup.tscn" id="11_l855d"]
|
||||
[ext_resource type="Script" uid="uid://uearpvfk21ym" path="res://Code/Resources/SimulationConfigResource.cs" id="11_xnm3i"]
|
||||
[ext_resource type="PackedScene" uid="uid://bfnu4py7n2sv5" path="res://Objects/pistol_pickup.tscn" id="12_00aki"]
|
||||
[ext_resource type="PackedScene" uid="uid://b1d2gc8goj6gx" path="res://Objects/green_door.tscn" id="13_00aki"]
|
||||
[ext_resource type="PackedScene" uid="uid://cww3lcsxldnt3" path="res://Objects/green_card_pickup.tscn" id="14_5qvjo"]
|
||||
|
||||
[sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_ucfah"]
|
||||
data = PackedVector3Array(-4.282257, -0.5, 4.977783, -4.282257, -0.5, -4.977783, -4.282257, 0.5, -4.977783, 4.282257, -0.5, -4.977783, -4.282257, -0.5, -4.977783, -4.282257, -0.5, 4.977783, -4.282257, 0.5, -4.977783, -4.282257, -0.5, -4.977783, 4.282257, -0.5, -4.977783, -4.282257, 0.5, -4.977783, -4.282257, 0.5, 4.977783, -4.282257, -0.5, 4.977783, -4.282257, -0.5, 4.977783, -4.282257, 0.5, 4.977783, 4.282257, 0.5, 4.977783, 4.282257, 0.5, 4.977783, -4.282257, 0.5, 4.977783, -4.282257, 0.5, -4.977783, -4.282257, -0.5, 4.977783, 4.282257, -0.5, 4.977783, 4.282257, -0.5, -4.977783, 4.282257, 0.5, 4.977783, 4.282257, -0.5, 4.977783, -4.282257, -0.5, 4.977783, 4.282257, -0.5, -4.977783, 4.282257, -0.5, 4.977783, 4.282257, 0.5, 4.977783, 4.282257, -0.5, -4.977783, 4.282257, 0.5, -4.977783, -4.282257, 0.5, -4.977783, -4.282257, 0.5, -4.977783, 4.282257, 0.5, -4.977783, 4.282257, 0.5, 4.977783, 4.282257, 0.5, 4.977783, 4.282257, 0.5, -4.977783, 4.282257, -0.5, -4.977783)
|
||||
@@ -247,3 +249,8 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.7087288, -0.8145535, 4.614
|
||||
|
||||
[node name="Pistol" parent="." instance=ExtResource("12_00aki")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.122588, -0.81455374, 1.582226)
|
||||
|
||||
[node name="GreenDoor" parent="." instance=ExtResource("13_00aki")]
|
||||
|
||||
[node name="Green Card Pickup" parent="." instance=ExtResource("14_5qvjo")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.2713692, -0.86455375, 3.3032908)
|
||||
|
||||
Reference in New Issue
Block a user