actually calling update effects
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
using Gamesmiths.Forge.Attributes;
|
||||
|
||||
namespace Movementtests.scenes.player_controller.components.weapon;
|
||||
|
||||
public class WeaponAttributeSet : AttributeSet
|
||||
{
|
||||
public EntityAttribute Level { get; }
|
||||
|
||||
public WeaponAttributeSet()
|
||||
{
|
||||
Level = InitializeAttribute(nameof(Level), 1, 1, 10);
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
uid://mvc3bv0p021
|
||||
@@ -43,6 +43,7 @@ public partial class WeaponSystem : RigidBody3D, IDamageDealer, IForgeEntity
|
||||
public ForgeTagContainer BaseTags { get; set; }
|
||||
[Export] public ForgeAbilityData[] WeaponAbilities { get; set; } = Array.Empty<ForgeAbilityData>();
|
||||
[Export] public ForgeAbilityData FlyingTickAbility { get; set; }
|
||||
[Export] public ForgeEffectData[] PermanentEffects { get; set; } = Array.Empty<ForgeEffectData>();
|
||||
|
||||
[Export]
|
||||
public RDamage RDamage { get; set; }
|
||||
@@ -186,6 +187,11 @@ public partial class WeaponSystem : RigidBody3D, IDamageDealer, IForgeEntity
|
||||
EffectsManager.ApplyEffect(new Effect(leftGrantEffect, new EffectOwnership(this, this)));
|
||||
}
|
||||
|
||||
foreach (var effect in PermanentEffects)
|
||||
{
|
||||
EffectsManager.ApplyEffect(new Effect(effect.GetEffectData(), new EffectOwnership(this, this)));
|
||||
}
|
||||
|
||||
BodyEntered += OnThrownWeaponReachesGround;
|
||||
|
||||
InHandState.StateExited += WeaponLeft;
|
||||
@@ -382,9 +388,12 @@ public partial class WeaponSystem : RigidBody3D, IDamageDealer, IForgeEntity
|
||||
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
EffectsManager.UpdateEffects(delta);
|
||||
|
||||
if (!FlyingState.Active) return;
|
||||
|
||||
WeaponMesh.Rotation = new Vector3(WeaponMesh.Rotation.X, WeaponMesh.Rotation.Y + (float) delta * 100, WeaponMesh.Rotation.Z);
|
||||
//GD.Print(Attributes["WeaponAttributeSet.Level"].CurrentValue);
|
||||
//LookAt(GlobalTransform.Origin + LinearVelocity.Normalized(), Vector3.Up, false);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
[gd_resource type="Resource" script_class="ForgeEffectApplicationBehavior" format=3 uid="uid://1tmxayi3nygi"]
|
||||
|
||||
[ext_resource type="Resource" uid="uid://bvidrwyuoos4g" path="res://scenes/player_controller/resources/forge/raise_flying_tick_event_periodically.tres" id="1_hlq5f"]
|
||||
[ext_resource type="Script" uid="uid://cl5hudinl1rex" path="res://forge/abilities/ForgeEffectApplicationBehavior.cs" id="2_f5qgs"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("2_f5qgs")
|
||||
EffectData = ExtResource("1_hlq5f")
|
||||
metadata/_custom_type_script = "uid://cl5hudinl1rex"
|
||||
@@ -0,0 +1,34 @@
|
||||
[gd_resource type="Resource" script_class="ForgeEffectData" format=3 uid="uid://bvidrwyuoos4g"]
|
||||
|
||||
[ext_resource type="Resource" uid="uid://oe2suroa1klj" path="res://scenes/player_controller/resources/forge/raise_flying_tick_event.tres" id="1_cd13a"]
|
||||
[ext_resource type="Script" uid="uid://1hgogislo1l6" path="res://addons/forge/resources/magnitudes/ForgeScalableInt.cs" id="2_yyxtw"]
|
||||
[ext_resource type="Script" uid="uid://cn3b4ya15fg7e" path="res://addons/forge/resources/magnitudes/ForgeScalableFloat.cs" id="3_skmyt"]
|
||||
[ext_resource type="Script" uid="uid://b83hf13nj37k3" path="res://addons/forge/resources/ForgeEffectData.cs" id="4_7ma6b"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_dgkld"]
|
||||
script = ExtResource("2_yyxtw")
|
||||
BaseValue = 1
|
||||
|
||||
[sub_resource type="Resource" id="Resource_1ften"]
|
||||
script = ExtResource("3_skmyt")
|
||||
BaseValue = 0.2
|
||||
metadata/_custom_type_script = "uid://cn3b4ya15fg7e"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_l278c"]
|
||||
script = ExtResource("2_yyxtw")
|
||||
BaseValue = 1
|
||||
|
||||
[resource]
|
||||
script = ExtResource("4_7ma6b")
|
||||
Name = "Call Flying Tick Event Periodically"
|
||||
Modifiers = []
|
||||
Components = []
|
||||
Executions = Array[Object]([ExtResource("1_cd13a")])
|
||||
DurationType = 1
|
||||
HasPeriodicApplication = true
|
||||
Period = SubResource("Resource_1ften")
|
||||
ExecuteOnApplication = true
|
||||
StackLimit = SubResource("Resource_l278c")
|
||||
InitialStack = SubResource("Resource_dgkld")
|
||||
Cues = []
|
||||
metadata/_custom_type_script = "uid://b83hf13nj37k3"
|
||||
@@ -1,46 +1,9 @@
|
||||
[gd_resource type="Resource" script_class="ForgeAbilityData" format=3 uid="uid://btnnpqann3ktp"]
|
||||
|
||||
[ext_resource type="Resource" uid="uid://oe2suroa1klj" path="res://scenes/player_controller/resources/forge/raise_flying_tick_event.tres" id="1_pdt6v"]
|
||||
[ext_resource type="Resource" uid="uid://1tmxayi3nygi" path="res://scenes/player_controller/resources/forge/flying tick application ability behavior.tres" id="1_twa0w"]
|
||||
[ext_resource type="Script" uid="uid://dhxfbxh54pyxp" path="res://addons/forge/resources/abilities/ForgeAbilityData.cs" id="1_vh0wp"]
|
||||
[ext_resource type="Script" uid="uid://1hgogislo1l6" path="res://addons/forge/resources/magnitudes/ForgeScalableInt.cs" id="2_xkoyb"]
|
||||
[ext_resource type="Script" uid="uid://cn3b4ya15fg7e" path="res://addons/forge/resources/magnitudes/ForgeScalableFloat.cs" id="3_j2gem"]
|
||||
[ext_resource type="Script" uid="uid://b83hf13nj37k3" path="res://addons/forge/resources/ForgeEffectData.cs" id="4_e2sm2"]
|
||||
[ext_resource type="Script" uid="uid://cl5hudinl1rex" path="res://forge/abilities/ForgeEffectApplicationBehavior.cs" id="5_trglf"]
|
||||
[ext_resource type="Script" uid="uid://dpakv7agvir6y" path="res://addons/forge/resources/ForgeTag.cs" id="6_napws"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_dgkld"]
|
||||
script = ExtResource("2_xkoyb")
|
||||
BaseValue = 1
|
||||
|
||||
[sub_resource type="Resource" id="Resource_1ften"]
|
||||
script = ExtResource("3_j2gem")
|
||||
BaseValue = 0.2
|
||||
metadata/_custom_type_script = "uid://cn3b4ya15fg7e"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_l278c"]
|
||||
script = ExtResource("2_xkoyb")
|
||||
BaseValue = 1
|
||||
|
||||
[sub_resource type="Resource" id="Resource_esyoj"]
|
||||
script = ExtResource("4_e2sm2")
|
||||
Name = "Call Flying Tick Event Periodically"
|
||||
Modifiers = []
|
||||
Components = []
|
||||
Executions = Array[Object]([ExtResource("1_pdt6v")])
|
||||
DurationType = 1
|
||||
HasPeriodicApplication = true
|
||||
Period = SubResource("Resource_1ften")
|
||||
ExecuteOnApplication = true
|
||||
StackLimit = SubResource("Resource_l278c")
|
||||
InitialStack = SubResource("Resource_dgkld")
|
||||
Cues = []
|
||||
metadata/_custom_type_script = "uid://b83hf13nj37k3"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_0xegy"]
|
||||
script = ExtResource("5_trglf")
|
||||
EffectData = SubResource("Resource_esyoj")
|
||||
metadata/_custom_type_script = "uid://cl5hudinl1rex"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_4aw8y"]
|
||||
script = ExtResource("6_napws")
|
||||
Tag = "events.weapon.startedflying"
|
||||
@@ -49,8 +12,9 @@ metadata/_custom_type_script = "uid://dpakv7agvir6y"
|
||||
[resource]
|
||||
script = ExtResource("1_vh0wp")
|
||||
Name = "Weapon Flying Tick"
|
||||
RetriggerInstancedAbility = true
|
||||
CooldownEffects = []
|
||||
AbilityBehavior = SubResource("Resource_0xegy")
|
||||
AbilityBehavior = ExtResource("1_twa0w")
|
||||
TriggerSource = 1
|
||||
TriggerTag = SubResource("Resource_4aw8y")
|
||||
metadata/_custom_type_script = "uid://dhxfbxh54pyxp"
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
using Gamesmiths.Forge.Attributes;
|
||||
|
||||
namespace Movementtests.scenes.player_controller.scripts;
|
||||
|
||||
public class PlayerAttributeSet : AttributeSet
|
||||
{
|
||||
public EntityAttribute Health { get; }
|
||||
public EntityAttribute Mana { get; }
|
||||
public EntityAttribute Strength { get; }
|
||||
public EntityAttribute Speed { get; }
|
||||
|
||||
public PlayerAttributeSet()
|
||||
{
|
||||
Health = InitializeAttribute(nameof(Health), 100, 0, 150);
|
||||
Mana = InitializeAttribute(nameof(Mana), 100, 0, 100);
|
||||
Strength = InitializeAttribute(nameof(Strength), 10, 0, 99);
|
||||
Speed = InitializeAttribute(nameof(Speed), 5, 0, 10);
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
uid://budtqogrwod6w
|
||||
Reference in New Issue
Block a user