Add weapon database and equipment component resources with associated services

This commit is contained in:
2025-10-29 01:26:45 +01:00
parent 87169b17ae
commit 626f81cd85
16 changed files with 245 additions and 11 deletions

View File

@@ -18,10 +18,12 @@ namespace CryptonymThunder.Code.Factories;
public class ComponentFactory public class ComponentFactory
{ {
private readonly Dictionary<Type, Func<Resource, IComponent>> _factories = new(); private readonly Dictionary<Type, Func<Resource, IComponent>> _factories = new();
private readonly EffectFactory _effectFactory = new(); private readonly EffectFactory _effectFactory;
public ComponentFactory() public ComponentFactory(EffectFactory effectFactory)
{ {
_effectFactory = effectFactory;
Register<AttributeComponentResource>(CreateAttributeComponent); Register<AttributeComponentResource>(CreateAttributeComponent);
Register<WeaponComponentResource>(CreateWeaponComponent); Register<WeaponComponentResource>(CreateWeaponComponent);
Register<ProjectileComponentResource>(CreateProjectileComponent); Register<ProjectileComponentResource>(CreateProjectileComponent);
@@ -33,6 +35,7 @@ public class ComponentFactory
Register<CharacterStateComponentResource>(_ => new CharacterStateComponent()); Register<CharacterStateComponentResource>(_ => new CharacterStateComponent());
Register<InventoryComponentResource>(_ => new InventoryComponent()); Register<InventoryComponentResource>(_ => new InventoryComponent());
Register<PickupComponentResource>(CreatePickupComponent); Register<PickupComponentResource>(CreatePickupComponent);
Register<EquipmentComponentResource>(_ => new EquipmentComponent());
} }
public IComponent Create(Resource resource) public IComponent Create(Resource resource)

View File

@@ -12,6 +12,7 @@ using GameCore.Events;
using GameCore.Input; using GameCore.Input;
using GameCore.Inventory; using GameCore.Inventory;
using GameCore.Movement; using GameCore.Movement;
using GameCore.Player;
using Godot; using Godot;
namespace CryptonymThunder.Code.Presenters; namespace CryptonymThunder.Code.Presenters;
@@ -20,6 +21,7 @@ namespace CryptonymThunder.Code.Presenters;
public partial class GamePresenter : Node public partial class GamePresenter : Node
{ {
[Export] private ArchetypeDatabase ArchetypesDatabase { get; set; } [Export] private ArchetypeDatabase ArchetypesDatabase { get; set; }
[Export] private WeaponDatabase WeaponDatabase { get; set; }
[Export] private EntityArchetype PlayerArchetype { get; set; } [Export] private EntityArchetype PlayerArchetype { get; set; }
[Export] private SimulationConfigResource SimulationConfig { get; set; } [Export] private SimulationConfigResource SimulationConfig { get; set; }
@@ -46,7 +48,11 @@ public partial class GamePresenter : Node
_world = new World(_inputService, _worldQuery, simConfig); _world = new World(_inputService, _worldQuery, simConfig);
_presenterFactory = new PresenterFactory(_world, new ComponentFactory(), _presenterRegistry, this); var effectFactory = new EffectFactory();
var componentFactory = new ComponentFactory(effectFactory);
var weaponDataService = new GodotWeaponDataService(WeaponDatabase, effectFactory);
_presenterFactory = new PresenterFactory(_world, componentFactory, _presenterRegistry, this);
_world.RegisterSystem(new PlayerInputSystem()); _world.RegisterSystem(new PlayerInputSystem());
_world.RegisterSystem(new RotationSystem()); _world.RegisterSystem(new RotationSystem());
@@ -58,6 +64,9 @@ public partial class GamePresenter : Node
_world.RegisterSystem(new PickupSystem()); _world.RegisterSystem(new PickupSystem());
_world.RegisterSystem(new InventorySystem(_world)); _world.RegisterSystem(new InventorySystem(_world));
_world.RegisterSystem(new ItemAcquisitionSystem(_world)); _world.RegisterSystem(new ItemAcquisitionSystem(_world));
_world.RegisterSystem(new WeaponAcquisitionSystem(_world));
_world.RegisterSystem(new WeaponSwapSystem());
_world.RegisterSystem(new EquipmentSystem(_world, weaponDataService));
_world.RegisterSystem(new WeaponSystem()); _world.RegisterSystem(new WeaponSystem());
_world.RegisterSystem(new ProjectileSystem()); _world.RegisterSystem(new ProjectileSystem());
@@ -69,6 +78,15 @@ public partial class GamePresenter : Node
_world.Subscribe<EntityDiedEvent>(OnEntityDied); _world.Subscribe<EntityDiedEvent>(OnEntityDied);
_world.Subscribe<SpawnEntityEvent>(OnSpawnEntity); _world.Subscribe<SpawnEntityEvent>(OnSpawnEntity);
_world.Subscribe<EquipWeaponEvent>(OnWeaponEquipped);
_world.Subscribe<WeaponFiredEvent>(e =>
{
GD.Print($"Weapon fired by Entity ID: {e.Owner.Id}");
});
_world.Subscribe<WeaponFireFailedEvent>(e =>
{
GD.Print($"Weapon fire failed!");
});
RegisterAllSceneEntities(); RegisterAllSceneEntities();
@@ -77,6 +95,11 @@ public partial class GamePresenter : Node
_presenterComponents.Add(playerData.Entity.Id, playerData.Components); _presenterComponents.Add(playerData.Entity.Id, playerData.Components);
} }
private void OnWeaponEquipped(EquipWeaponEvent e)
{
GD.Print($"Weapon equipped: {e.NewWeaponItemId} for Entity ID: {e.Owner.Id}");
}
public override void _Input(InputEvent @event) public override void _Input(InputEvent @event)
{ {
_inputService?.HandleInputEvent(@event); _inputService?.HandleInputEvent(@event);

View File

@@ -0,0 +1,9 @@
using Godot;
namespace CryptonymThunder.Code.Resources;
[GlobalClass]
public partial class EquipmentComponentResource : Resource
{
[Export] public Godot.Collections.Array<string> StartingWeapons { get; set; } = [];
}

View File

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

View File

@@ -0,0 +1,10 @@
using Godot;
using Godot.Collections;
namespace CryptonymThunder.Code.Resources;
[GlobalClass]
public partial class WeaponDatabase : Resource
{
[Export] public Dictionary<string, WeaponResource> WeaponData { get; set; } = new();
}

View File

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

View File

@@ -14,6 +14,8 @@ public class GodotInputService : IInputService
public bool IsJumping { get; private set; } public bool IsJumping { get; private set; }
public GameCoreMath MoveDirection { get; private set; } public GameCoreMath MoveDirection { get; private set; }
public GameCoreMath LookDirection { get; private set; } public GameCoreMath LookDirection { get; private set; }
public bool IsSwapWeaponNext { get; private set; }
public bool IsSwapWeaponPrevious { get; private set; }
public void HandleInputEvent(InputEvent e) public void HandleInputEvent(InputEvent e)
{ {
@@ -38,10 +40,15 @@ public class GodotInputService : IInputService
IsJumping = Input.IsActionJustPressed("jump"); IsJumping = Input.IsActionJustPressed("jump");
IsFiring = Input.IsActionPressed("fire"); IsFiring = Input.IsActionPressed("fire");
IsInteracting = Input.IsActionPressed("interact"); IsInteracting = Input.IsActionPressed("interact");
IsSwapWeaponNext = Input.IsActionJustPressed("swap_weapon_next");
IsSwapWeaponPrevious = Input.IsActionJustPressed("swap_weapon_previous");
} }
public void LateUpdate() public void LateUpdate()
{ {
LookDirection = GameCoreMath.Zero; LookDirection = GameCoreMath.Zero;
IsSwapWeaponNext = false;
IsSwapWeaponPrevious = false;
} }
} }

View File

@@ -0,0 +1,55 @@
using System.Linq;
using CryptonymThunder.Code.Factories;
using CryptonymThunder.Code.Resources;
using GameCore.Combat;
using GameCore.Combat.Interfaces;
using Godot;
namespace CryptonymThunder.Code.Services;
public class GodotWeaponDataService : IWeaponDataService
{
private readonly WeaponDatabase _database;
private readonly EffectFactory _effectFactory;
public GodotWeaponDataService(WeaponDatabase database, EffectFactory effectFactory)
{
_database = database;
_effectFactory = effectFactory;
}
public WeaponData GetWeaponData(string weaponId)
{
if (!_database.WeaponData.TryGetValue(weaponId, out var weaponResource))
{
GD.PrintErr($"Weapon ID not found in database: {weaponId}");
return null;
}
var fireCosts = weaponResource.FireCosts
.Select(_effectFactory.Create)
.OfType<ICostEffect>()
.ToList();
var onFireEffects = weaponResource.OnFireEffects
.Select(_effectFactory.Create)
.ToList();
var onHitEffects = weaponResource.OnHitEffects
.Select(_effectFactory.Create)
.ToList();
return new WeaponData(
weaponResource.FireRate,
fireCosts,
onFireEffects,
onHitEffects
);
}
public bool TryGetWeaponData(string weaponId, out WeaponData weaponData)
{
weaponData = GetWeaponData(weaponId);
return weaponData != null;
}
}

View File

@@ -0,0 +1 @@
uid://4jlk57176ic5

34
Objects/knife_pickup.tscn Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,4 +1,4 @@
[gd_resource type="Resource" script_class="EntityArchetype" load_steps=22 format=3 uid="uid://biev6ri5s8kyf"] [gd_resource type="Resource" script_class="EntityArchetype" load_steps=23 format=3 uid="uid://biev6ri5s8kyf"]
[ext_resource type="Script" uid="uid://dc7wq2ij5kwj5" path="res://Code/Resources/AttributeComponentResource.cs" id="1_0drlr"] [ext_resource type="Script" uid="uid://dc7wq2ij5kwj5" path="res://Code/Resources/AttributeComponentResource.cs" id="1_0drlr"]
[ext_resource type="Script" uid="uid://y4cbuh2wxigy" path="res://Code/Resources/InputStateComponentResource.cs" id="2_7o5r3"] [ext_resource type="Script" uid="uid://y4cbuh2wxigy" path="res://Code/Resources/InputStateComponentResource.cs" id="2_7o5r3"]
@@ -8,10 +8,10 @@
[ext_resource type="Script" uid="uid://blm62f85g7icn" path="res://Code/Resources/RotationComponentResource.cs" id="6_8u8a8"] [ext_resource type="Script" uid="uid://blm62f85g7icn" path="res://Code/Resources/RotationComponentResource.cs" id="6_8u8a8"]
[ext_resource type="Script" uid="uid://cdpbn8eiypfbd" path="res://Code/Resources/CharacterStateComponentResource.cs" id="7_m2ull"] [ext_resource type="Script" uid="uid://cdpbn8eiypfbd" path="res://Code/Resources/CharacterStateComponentResource.cs" id="7_m2ull"]
[ext_resource type="PackedScene" uid="uid://c576jiewfs5gj" path="res://Objects/player.tscn" id="8_0q1v5"] [ext_resource type="PackedScene" uid="uid://c576jiewfs5gj" path="res://Objects/player.tscn" id="8_0q1v5"]
[ext_resource type="Resource" uid="uid://tj3ojc3bl7d8" path="res://Resources/Weapons/basic_pistol.tres" id="8_l66rq"]
[ext_resource type="Script" uid="uid://bp7mufswr41w6" path="res://Code/Resources/WeaponComponentResource.cs" id="9_efscl"] [ext_resource type="Script" uid="uid://bp7mufswr41w6" path="res://Code/Resources/WeaponComponentResource.cs" id="9_efscl"]
[ext_resource type="Script" uid="uid://coe688e2jkyjq" path="res://Code/Resources/EntityArchetype.cs" id="9_uue6s"] [ext_resource type="Script" uid="uid://coe688e2jkyjq" path="res://Code/Resources/EntityArchetype.cs" id="9_uue6s"]
[ext_resource type="Script" uid="uid://dhcbayl5iwvf3" path="res://Code/Resources/InventoryComponentResource.cs" id="10_efscl"] [ext_resource type="Script" uid="uid://dhcbayl5iwvf3" path="res://Code/Resources/InventoryComponentResource.cs" id="10_efscl"]
[ext_resource type="Script" uid="uid://d0osn7rv6mqa0" path="res://Code/Resources/EquipmentComponentResource.cs" id="11_55dod"]
[sub_resource type="Resource" id="Resource_d0bjv"] [sub_resource type="Resource" id="Resource_d0bjv"]
script = ExtResource("1_0drlr") script = ExtResource("1_0drlr")
@@ -51,15 +51,19 @@ metadata/_custom_type_script = "uid://cdpbn8eiypfbd"
[sub_resource type="Resource" id="Resource_55dod"] [sub_resource type="Resource" id="Resource_55dod"]
script = ExtResource("9_efscl") script = ExtResource("9_efscl")
WeaponData = ExtResource("8_l66rq")
metadata/_custom_type_script = "uid://bp7mufswr41w6" metadata/_custom_type_script = "uid://bp7mufswr41w6"
[sub_resource type="Resource" id="Resource_8u8a8"] [sub_resource type="Resource" id="Resource_8u8a8"]
script = ExtResource("10_efscl") script = ExtResource("10_efscl")
metadata/_custom_type_script = "uid://dhcbayl5iwvf3" metadata/_custom_type_script = "uid://dhcbayl5iwvf3"
[sub_resource type="Resource" id="Resource_m2ull"]
script = ExtResource("11_55dod")
StartingWeapons = Array[String]([])
metadata/_custom_type_script = "uid://d0osn7rv6mqa0"
[resource] [resource]
script = ExtResource("9_uue6s") script = ExtResource("9_uue6s")
Scene = ExtResource("8_0q1v5") Scene = ExtResource("8_0q1v5")
ComponentResources = Array[Resource]([SubResource("Resource_d0bjv"), SubResource("Resource_l855d"), SubResource("Resource_00aki"), SubResource("Resource_5qvjo"), SubResource("Resource_g7kif"), SubResource("Resource_xqdar"), SubResource("Resource_xnm3i"), SubResource("Resource_55dod"), SubResource("Resource_8u8a8")]) ComponentResources = Array[Resource]([SubResource("Resource_d0bjv"), SubResource("Resource_l855d"), SubResource("Resource_00aki"), SubResource("Resource_5qvjo"), SubResource("Resource_g7kif"), SubResource("Resource_xqdar"), SubResource("Resource_xnm3i"), SubResource("Resource_55dod"), SubResource("Resource_8u8a8"), SubResource("Resource_m2ull")])
metadata/_custom_type_script = "uid://coe688e2jkyjq" metadata/_custom_type_script = "uid://coe688e2jkyjq"

View File

@@ -16,7 +16,7 @@ metadata/_custom_type_script = "uid://btv24gsw1p850"
[resource] [resource]
script = ExtResource("1_qbj27") script = ExtResource("1_qbj27")
FireRate = 1.5 FireRate = 50.0
FireCosts = Array[Object]([]) FireCosts = Array[Object]([])
OnFireEffects = Array[Object]([SubResource("Resource_iyx0n")]) OnFireEffects = Array[Object]([SubResource("Resource_iyx0n")])
OnHitEffects = Array[Object]([SubResource("Resource_oy2bd")]) OnHitEffects = Array[Object]([SubResource("Resource_oy2bd")])

View File

@@ -0,0 +1,14 @@
[gd_resource type="Resource" script_class="WeaponDatabase" load_steps=5 format=3 uid="uid://xlqhsfy0v634"]
[ext_resource type="Script" uid="uid://hf0iut8o8do3" path="res://Code/Resources/WeaponResource.cs" id="1_l68x5"]
[ext_resource type="Script" uid="uid://n4m7jn4mysrt" path="res://Code/Resources/WeaponDatabase.cs" id="2_2j706"]
[ext_resource type="Resource" uid="uid://tj3ojc3bl7d8" path="res://Resources/Weapons/basic_pistol.tres" id="2_osidf"]
[ext_resource type="Resource" uid="uid://5c7x5piv7m7w" path="res://Resources/Weapons/knife.tres" id="3_pouh4"]
[resource]
script = ExtResource("2_2j706")
WeaponData = Dictionary[String, ExtResource("1_l68x5")]({
"weapon_knife": ExtResource("3_pouh4"),
"weapon_pistol": ExtResource("2_osidf")
})
metadata/_custom_type_script = "uid://n4m7jn4mysrt"

View File

@@ -1,14 +1,17 @@
[gd_scene load_steps=22 format=4 uid="uid://bkvgcsb8d3v7p"] [gd_scene load_steps=25 format=4 uid="uid://bkvgcsb8d3v7p"]
[ext_resource type="Script" uid="uid://cfpm5p102f65x" path="res://Code/Presenters/GamePresenter.cs" id="1_qvgq0"] [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"] [ext_resource type="Resource" uid="uid://biev6ri5s8kyf" path="res://Resources/Entities/player.tres" id="2_alii3"]
[ext_resource type="Resource" uid="uid://cr4nf1g4w3xye" path="res://Resources/entity_database.tres" id="2_hy2kt"] [ext_resource type="Resource" uid="uid://cr4nf1g4w3xye" path="res://Resources/entity_database.tres" id="2_hy2kt"]
[ext_resource type="Resource" uid="uid://xlqhsfy0v634" path="res://Resources/weapon_database.tres" id="3_xqdar"]
[ext_resource type="Script" uid="uid://cb7vaw6xqjs1i" path="res://Code/Presenters/EntityPresenter.cs" id="5_d0bjv"] [ext_resource type="Script" uid="uid://cb7vaw6xqjs1i" path="res://Code/Presenters/EntityPresenter.cs" id="5_d0bjv"]
[ext_resource type="Script" uid="uid://b6x8llipvutqs" path="res://Code/Presenters/SceneEntity.cs" id="5_f1ejf"] [ext_resource type="Script" uid="uid://b6x8llipvutqs" path="res://Code/Presenters/SceneEntity.cs" id="5_f1ejf"]
[ext_resource type="Script" uid="uid://dc7wq2ij5kwj5" path="res://Code/Resources/AttributeComponentResource.cs" id="6_d0bjv"] [ext_resource type="Script" uid="uid://dc7wq2ij5kwj5" path="res://Code/Resources/AttributeComponentResource.cs" id="6_d0bjv"]
[ext_resource type="PackedScene" uid="uid://wafx73yokhg4" path="res://Objects/pistol_ammo.tscn" id="8_rr1si"] [ext_resource type="PackedScene" uid="uid://wafx73yokhg4" path="res://Objects/pistol_ammo.tscn" id="8_rr1si"]
[ext_resource type="PackedScene" uid="uid://ceo2sg2077t4c" path="res://Objects/health_pack.tscn" id="9_xqdar"] [ext_resource type="PackedScene" uid="uid://ceo2sg2077t4c" path="res://Objects/health_pack.tscn" id="9_xqdar"]
[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="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"]
[sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_ucfah"] [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) 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)
@@ -116,6 +119,7 @@ shadow_enabled = true
[node name="GamePresenter" type="Node" parent="."] [node name="GamePresenter" type="Node" parent="."]
script = ExtResource("1_qvgq0") script = ExtResource("1_qvgq0")
ArchetypesDatabase = ExtResource("2_hy2kt") ArchetypesDatabase = ExtResource("2_hy2kt")
WeaponDatabase = ExtResource("3_xqdar")
PlayerArchetype = ExtResource("2_alii3") PlayerArchetype = ExtResource("2_alii3")
SimulationConfig = SubResource("Resource_f4pnd") SimulationConfig = SubResource("Resource_f4pnd")
metadata/_custom_type_script = "uid://cfpm5p102f65x" metadata/_custom_type_script = "uid://cfpm5p102f65x"
@@ -152,6 +156,22 @@ script = ExtResource("5_f1ejf")
ComponentResources = Array[Resource]([SubResource("Resource_27os8")]) ComponentResources = Array[Resource]([SubResource("Resource_27os8")])
metadata/_custom_type_script = "uid://b6x8llipvutqs" metadata/_custom_type_script = "uid://b6x8llipvutqs"
[node name="Enemy7" type="StaticBody3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.1185906, 0.11570263, 1.5766177)
script = ExtResource("5_d0bjv")
[node name="CollisionShape3D" type="CollisionShape3D" parent="Enemy7"]
shape = SubResource("BoxShape3D_hy2kt")
[node name="MeshInstance3D" type="MeshInstance3D" parent="Enemy7"]
mesh = SubResource("BoxMesh_p4c8d")
surface_material_override/0 = SubResource("StandardMaterial3D_f1ejf")
[node name="SceneEntity" type="Node" parent="Enemy7" groups=["SceneEntities"]]
script = ExtResource("5_f1ejf")
ComponentResources = Array[Resource]([SubResource("Resource_27os8")])
metadata/_custom_type_script = "uid://b6x8llipvutqs"
[node name="Enemy3" type="StaticBody3D" parent="."] [node name="Enemy3" type="StaticBody3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.4516838, 0, -6.099209) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.4516838, 0, -6.099209)
script = ExtResource("5_d0bjv") script = ExtResource("5_d0bjv")
@@ -221,3 +241,9 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.5896075, -0.81455386, -3.99
[node name="HealthPack" parent="." instance=ExtResource("9_xqdar")] [node name="HealthPack" parent="." instance=ExtResource("9_xqdar")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.4061804, -0.56455374, 4.434821) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.4061804, -0.56455374, 4.434821)
[node name="Knife" parent="." instance=ExtResource("11_l855d")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.7087288, -0.8145535, 4.6141477)
[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)

View File

@@ -69,7 +69,7 @@ jump={
} }
interact={ interact={
"deadzone": 0.2, "deadzone": 0.2,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":69,"key_label":0,"unicode":101,"location":0,"echo":false,"script":null) "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":70,"key_label":0,"unicode":102,"location":0,"echo":false,"script":null)
] ]
} }
fire={ fire={
@@ -77,3 +77,15 @@ fire={
"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":1,"position":Vector2(584, 16),"global_position":Vector2(593, 64),"factor":1.0,"button_index":1,"canceled":false,"pressed":true,"double_click":false,"script":null) "events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":1,"position":Vector2(584, 16),"global_position":Vector2(593, 64),"factor":1.0,"button_index":1,"canceled":false,"pressed":true,"double_click":false,"script":null)
] ]
} }
swap_weapon_next={
"deadzone": 0.2,
"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":8,"position":Vector2(550, 24),"global_position":Vector2(559, 72),"factor":1.0,"button_index":4,"canceled":false,"pressed":true,"double_click":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":69,"key_label":0,"unicode":101,"location":0,"echo":false,"script":null)
]
}
swap_weapon_previous={
"deadzone": 0.2,
"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":16,"position":Vector2(226, 8),"global_position":Vector2(235, 56),"factor":1.0,"button_index":5,"canceled":false,"pressed":true,"double_click":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":81,"key_label":0,"unicode":113,"location":0,"echo":false,"script":null)
]
}