Set EnergyMax to 0 when UnlimitedEnergy enabled, more fields in Concomitants

This commit is contained in:
xeon 2024-02-23 16:00:08 +03:00
parent 832f4ab3eb
commit 32b7c987bf
2 changed files with 7 additions and 0 deletions

View file

@ -266,6 +266,7 @@ internal class CreatureController : Controller
if (_gameplayFeatures.UnlimitedEnergy) if (_gameplayFeatures.UnlimitedEnergy)
{ {
EntityAttributeComponent attr = entity.ComponentSystem.Get<EntityAttributeComponent>(); EntityAttributeComponent attr = entity.ComponentSystem.Get<EntityAttributeComponent>();
attr.SetAttribute(EAttributeType.EnergyMax, 0);
attr.SetAttribute(EAttributeType.SpecialEnergy1Max, 0); attr.SetAttribute(EAttributeType.SpecialEnergy1Max, 0);
attr.SetAttribute(EAttributeType.SpecialEnergy2Max, 0); attr.SetAttribute(EAttributeType.SpecialEnergy2Max, 0);
attr.SetAttribute(EAttributeType.SpecialEnergy3Max, 0); attr.SetAttribute(EAttributeType.SpecialEnergy3Max, 0);

View file

@ -4,6 +4,8 @@ namespace GameServer.Systems.Entity.Component;
internal class EntityConcomitantsComponent : EntityComponentBase internal class EntityConcomitantsComponent : EntityComponentBase
{ {
public List<long> CustomEntityIds { get; } public List<long> CustomEntityIds { get; }
public long PhantomRoleEntityId { get; set; }
public long VisionEntityId { get; set; }
public EntityConcomitantsComponent() public EntityConcomitantsComponent()
{ {
@ -19,6 +21,10 @@ internal class EntityConcomitantsComponent : EntityComponentBase
EntityComponentPb pb = new() EntityComponentPb pb = new()
{ {
ConcomitantsComponentPb = new() ConcomitantsComponentPb = new()
{
PhantomRoleEid = PhantomRoleEntityId,
VisionEntityId = VisionEntityId
}
}; };
pb.ConcomitantsComponentPb.CustomEntityIds.AddRange(CustomEntityIds); pb.ConcomitantsComponentPb.CustomEntityIds.AddRange(CustomEntityIds);