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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user