moving further through forge godot-available resources and interfaces
This commit is contained in:
@@ -29,6 +29,8 @@
|
||||
[ext_resource type="AudioStream" uid="uid://clfggn87oeg1s" path="res://scenes/player_controller/audio/InteractiveSFX.tres" id="9_jb43f"]
|
||||
[ext_resource type="Resource" uid="uid://bebstkm608wxx" path="res://inputs/base_mode/aim_pressed.tres" id="9_nob5r"]
|
||||
[ext_resource type="Resource" uid="uid://bdit2jy5gbpts" path="res://inputs/base_mode/jump.tres" id="10_4u7i3"]
|
||||
[ext_resource type="Script" uid="uid://cxihb42t2mfqi" path="res://addons/forge/nodes/ForgeAttributeSet.cs" id="10_pw5r7"]
|
||||
[ext_resource type="Script" uid="uid://ccovd5i0wr3kk" path="res://addons/forge/editor/attributes/AttributeValues.cs" id="11_2rkt1"]
|
||||
[ext_resource type="Resource" uid="uid://b5gx3q8nvu72e" path="res://inputs/base_mode/hit.tres" id="11_cresl"]
|
||||
[ext_resource type="PackedScene" uid="uid://0ysqmqphq6mq" path="res://scenes/player_controller/components/head/head_system.tscn" id="11_rxwoh"]
|
||||
[ext_resource type="Resource" uid="uid://d2r0ur8k3cuu3" path="res://inputs/base_mode/dash.tres" id="12_34snm"]
|
||||
@@ -71,6 +73,28 @@ script = ExtResource("4_abfq8")
|
||||
StartingHealth = 10.0
|
||||
metadata/_custom_type_script = "uid://baiapod3csndf"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_u8yay"]
|
||||
script = ExtResource("11_2rkt1")
|
||||
Default = 100
|
||||
Max = 100
|
||||
|
||||
[sub_resource type="Resource" id="Resource_uqalc"]
|
||||
script = ExtResource("11_2rkt1")
|
||||
Default = 100
|
||||
Max = 100
|
||||
|
||||
[sub_resource type="Resource" id="Resource_cn5a8"]
|
||||
script = ExtResource("11_2rkt1")
|
||||
Default = 1
|
||||
Min = 1
|
||||
Max = 100
|
||||
|
||||
[sub_resource type="Resource" id="Resource_b0xmb"]
|
||||
script = ExtResource("11_2rkt1")
|
||||
Default = 1
|
||||
Min = 1
|
||||
Max = 100
|
||||
|
||||
[sub_resource type="CapsuleMesh" id="CapsuleMesh_xc2g5"]
|
||||
height = 1.7
|
||||
|
||||
@@ -172,6 +196,17 @@ MinimumWallRunHorizontalSpeed = 8.0
|
||||
WallRunAltitudeLossSpeed = 8.0
|
||||
WallRunSpeedThreshold = 1.0
|
||||
|
||||
[node name="PlayerAttributeSet" type="Node" parent="." unique_id=421846088]
|
||||
script = ExtResource("10_pw5r7")
|
||||
AttributeSetClass = "PlayerAttributeSet"
|
||||
InitialAttributeValues = Dictionary[String, ExtResource("11_2rkt1")]({
|
||||
"Health": SubResource("Resource_u8yay"),
|
||||
"Mana": SubResource("Resource_uqalc"),
|
||||
"Speed": SubResource("Resource_cn5a8"),
|
||||
"Strength": SubResource("Resource_b0xmb")
|
||||
})
|
||||
metadata/_custom_type_script = "uid://cxihb42t2mfqi"
|
||||
|
||||
[node name="CHealth" parent="." unique_id=1244478698 instance=ExtResource("3_q7bng")]
|
||||
RHealth = ExtResource("4_m8gvy")
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Gamesmiths.Forge.Abilities;
|
||||
using Gamesmiths.Forge.Attributes;
|
||||
using Gamesmiths.Forge.Core;
|
||||
using Gamesmiths.Forge.Effects;
|
||||
using Gamesmiths.Forge.Effects.Calculator;
|
||||
@@ -10,6 +11,8 @@ using Gamesmiths.Forge.Effects.Magnitudes;
|
||||
using Gamesmiths.Forge.Effects.Periodic;
|
||||
using Gamesmiths.Forge.Events;
|
||||
using Gamesmiths.Forge.Godot.Core;
|
||||
using Gamesmiths.Forge.Godot.Nodes;
|
||||
using Gamesmiths.Forge.Godot.Resources;
|
||||
using Gamesmiths.Forge.Tags;
|
||||
using Godot;
|
||||
using GodotStateCharts;
|
||||
@@ -47,6 +50,10 @@ public partial class WeaponSystem : RigidBody3D, IDamageDealer, IForgeEntity
|
||||
[Signal]
|
||||
public delegate void WeaponRetrievedEventHandler();
|
||||
|
||||
|
||||
[Export]
|
||||
public ForgeTagContainer BaseTags { get; set; } = new();
|
||||
|
||||
[Export]
|
||||
public RDamage RDamage { get; set; }
|
||||
[Export(PropertyHint.Range, "0,100,1,or_greater")]
|
||||
@@ -147,14 +154,22 @@ public partial class WeaponSystem : RigidBody3D, IDamageDealer, IForgeEntity
|
||||
|
||||
WeaponFlyingAbilityTag = Tag.RequestTag(tagsManager,"abilities.weapon.flying");
|
||||
|
||||
var baseTags = new TagContainer(
|
||||
tagsManager,
|
||||
[
|
||||
Tag.RequestTag(tagsManager, "weapon"),
|
||||
]);
|
||||
List<AttributeSet> attributeSetList = [];
|
||||
foreach (Node node in GetChildren())
|
||||
{
|
||||
if (node is ForgeAttributeSet attributeSetNode)
|
||||
{
|
||||
AttributeSet? attributeSet = attributeSetNode.GetAttributeSet();
|
||||
|
||||
if (attributeSet is not null)
|
||||
{
|
||||
attributeSetList.Add(attributeSet);
|
||||
}
|
||||
}
|
||||
}
|
||||
Attributes = new EntityAttributes([.. attributeSetList]);
|
||||
|
||||
Attributes = new EntityAttributes(new WeaponAttributeSet());
|
||||
Tags = new EntityTags(baseTags);
|
||||
Tags = new(BaseTags.GetTagContainer());
|
||||
EffectsManager = new EffectsManager(this, cuesManager);
|
||||
Abilities = new(this);
|
||||
Events = new();
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
|
||||
[ext_resource type="Script" uid="uid://iii3wfto4t5b" path="res://scenes/player_controller/components/weapon/WeaponSystem.cs" id="1_csqwk"]
|
||||
[ext_resource type="Script" uid="uid://jitubgv6judn" path="res://scenes/components/damage/RDamage.cs" id="2_m0v1h"]
|
||||
[ext_resource type="Script" uid="uid://cxihb42t2mfqi" path="res://addons/forge/nodes/ForgeAttributeSet.cs" id="3_3xjpi"]
|
||||
[ext_resource type="Script" uid="uid://couw105c3bde4" path="res://addons/godot_state_charts/state_chart.gd" id="3_5owyf"]
|
||||
[ext_resource type="ArrayMesh" uid="uid://cho5fixitrbds" path="res://assets/meshes/swords/resources/sword23.tres" id="3_svc06"]
|
||||
[ext_resource type="Script" uid="uid://ccovd5i0wr3kk" path="res://addons/forge/editor/attributes/AttributeValues.cs" id="4_q6xv7"]
|
||||
[ext_resource type="Script" uid="uid://jk2jm1g6q853" path="res://addons/godot_state_charts/compound_state.gd" id="4_svc06"]
|
||||
[ext_resource type="Script" uid="uid://cytafq8i1y8qm" path="res://addons/godot_state_charts/atomic_state.gd" id="5_m0v1h"]
|
||||
[ext_resource type="Script" uid="uid://cf1nsco3w0mf6" path="res://addons/godot_state_charts/transition.gd" id="6_jpdh0"]
|
||||
@@ -13,6 +15,12 @@ script = ExtResource("2_m0v1h")
|
||||
DamageDealt = 2.0
|
||||
metadata/_custom_type_script = "uid://jitubgv6judn"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_pgbtr"]
|
||||
script = ExtResource("4_q6xv7")
|
||||
Default = 1
|
||||
Min = 1
|
||||
Max = 100
|
||||
|
||||
[sub_resource type="CylinderShape3D" id="CylinderShape3D_avini"]
|
||||
height = 1.0
|
||||
radius = 0.1
|
||||
@@ -50,6 +58,14 @@ max_contacts_reported = 1
|
||||
script = ExtResource("1_csqwk")
|
||||
RDamage = SubResource("Resource_jpdh0")
|
||||
|
||||
[node name="WeaponAttributeSet" type="Node" parent="." unique_id=14845649]
|
||||
script = ExtResource("3_3xjpi")
|
||||
AttributeSetClass = "WeaponAttributeSet"
|
||||
InitialAttributeValues = Dictionary[String, ExtResource("4_q6xv7")]({
|
||||
"Level": SubResource("Resource_pgbtr")
|
||||
})
|
||||
metadata/_custom_type_script = "uid://cxihb42t2mfqi"
|
||||
|
||||
[node name="WeaponFlyingTick" type="Timer" parent="." unique_id=656309486]
|
||||
wait_time = 0.2
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Gamesmiths.Forge.Abilities;
|
||||
using Gamesmiths.Forge.Attributes;
|
||||
using Gamesmiths.Forge.Core;
|
||||
using Gamesmiths.Forge.Effects;
|
||||
using Gamesmiths.Forge.Effects.Calculator;
|
||||
@@ -11,6 +12,8 @@ using Gamesmiths.Forge.Effects.Modifiers;
|
||||
using Gamesmiths.Forge.Effects.Periodic;
|
||||
using Gamesmiths.Forge.Events;
|
||||
using Gamesmiths.Forge.Godot.Core;
|
||||
using Gamesmiths.Forge.Godot.Nodes;
|
||||
using Gamesmiths.Forge.Godot.Resources;
|
||||
using Gamesmiths.Forge.Godot.Resources.Abilities;
|
||||
using Gamesmiths.Forge.Tags;
|
||||
|
||||
@@ -109,6 +112,8 @@ public partial class PlayerController : CharacterBody3D,
|
||||
// Forge stuff
|
||||
[ExportCategory("Forge")]
|
||||
[ExportGroup("General")]
|
||||
[Export]
|
||||
public ForgeTagContainer BaseTags { get; set; } = new();
|
||||
[Export] public REmpoweredAction EmpoweredAction = null!;
|
||||
[Export] public RManaRegen ManaRegen = null!;
|
||||
|
||||
@@ -444,14 +449,22 @@ public partial class PlayerController : CharacterBody3D,
|
||||
// Forge stuff
|
||||
var tagsManager = ForgeManagers.Instance.TagsManager;
|
||||
var cuesManager = ForgeManagers.Instance.CuesManager;
|
||||
var baseTags = new TagContainer(
|
||||
tagsManager,
|
||||
[
|
||||
Tag.RequestTag(tagsManager, "character.player")
|
||||
]);
|
||||
|
||||
List<AttributeSet> attributeSetList = [];
|
||||
foreach (Node node in GetChildren())
|
||||
{
|
||||
if (node is ForgeAttributeSet attributeSetNode)
|
||||
{
|
||||
AttributeSet? attributeSet = attributeSetNode.GetAttributeSet();
|
||||
|
||||
Attributes = new EntityAttributes(new PlayerAttributeSet());
|
||||
Tags = new EntityTags(baseTags);
|
||||
if (attributeSet is not null)
|
||||
{
|
||||
attributeSetList.Add(attributeSet);
|
||||
}
|
||||
}
|
||||
}
|
||||
Attributes = new EntityAttributes([.. attributeSetList]);
|
||||
Tags = new(BaseTags.GetTagContainer());
|
||||
EffectsManager = new EffectsManager(this, cuesManager);
|
||||
Abilities = new(this);
|
||||
Events = new();
|
||||
@@ -467,11 +480,6 @@ public partial class PlayerController : CharacterBody3D,
|
||||
var manaRegenEffect = new Effect(ManaRegen.ManaRegen(tagsManager), new EffectOwnership(this, this));
|
||||
_manaRegenEffectHandle = EffectsManager.ApplyEffect(manaRegenEffect);
|
||||
|
||||
var health = Attributes["PlayerAttributeSet.Health"].CurrentValue; // 100
|
||||
var mana = Attributes["PlayerAttributeSet.Mana"].CurrentValue; // 100
|
||||
var strength = Attributes["PlayerAttributeSet.Strength"].CurrentValue; // 10
|
||||
var speed = Attributes["PlayerAttributeSet.Speed"].CurrentValue; // 5
|
||||
|
||||
// DashIndicator = GetNode<TextureRect>("%DashIndicator");
|
||||
PowerCooldownIndicator = GetNode<ColorRect>("%DashCooldownIndicator");
|
||||
PowerCooldownIndicator.Visible = false;
|
||||
|
||||
Reference in New Issue
Block a user