diff --git a/GameServer/Systems/Entity/Component/EntityFightBuffComponent.cs b/GameServer/Systems/Entity/Component/EntityFightBuffComponent.cs new file mode 100644 index 0000000..33ddb91 --- /dev/null +++ b/GameServer/Systems/Entity/Component/EntityFightBuffComponent.cs @@ -0,0 +1,20 @@ +using Protocol; + +namespace GameServer.Systems.Entity.Component; +internal class EntityFightBuffComponent : EntityComponentBase +{ + public List BuffInfoList { get; } = []; + + public override EntityComponentType Type => EntityComponentType.FightBuff; + + public override EntityComponentPb Pb => new() + { + FightBuffComponent = new() + { + FightBuffInfos = + { + BuffInfoList + } + } + }; +} diff --git a/GameServer/Systems/Entity/EntityBase.cs b/GameServer/Systems/Entity/EntityBase.cs index 07b28ae..d6d97ef 100644 --- a/GameServer/Systems/Entity/EntityBase.cs +++ b/GameServer/Systems/Entity/EntityBase.cs @@ -30,6 +30,7 @@ internal abstract class EntityBase State = EntityState.Born; _ = ComponentSystem.Create(); + _ = ComponentSystem.Create(); } public virtual void Activate() diff --git a/GameServer/Systems/Entity/PlayerEntity.cs b/GameServer/Systems/Entity/PlayerEntity.cs index b4c71ea..0c5fa93 100644 --- a/GameServer/Systems/Entity/PlayerEntity.cs +++ b/GameServer/Systems/Entity/PlayerEntity.cs @@ -46,6 +46,32 @@ internal class PlayerEntity : EntityBase _ = ComponentSystem.Create(); _ = ComponentSystem.Create(); + + // TODO: temporary solution to enable glider and wall run, should implement proper buff management. + EntityFightBuffComponent fightBuffComponent = ComponentSystem.Get(); + fightBuffComponent.BuffInfoList.Add(new FightBuffInformation + { + BuffId = 3004, + EntityId = Id, + InstigatorId = Id, + IsActive = true, + Duration = -1, + LeftDuration = -1, + Level = 1, + StackCount = 1 + }); + + fightBuffComponent.BuffInfoList.Add(new FightBuffInformation + { + BuffId = 3003, + EntityId = Id, + InstigatorId = Id, + IsActive = true, + Duration = -1, + LeftDuration = -1, + Level = 1, + StackCount = 1 + }); } public override void Activate()