Skip to content

Commit f6da5e0

Browse files
add Effects and EffectReferences to player properties
1 parent bd08c21 commit f6da5e0

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

Code/ValueSystem/PlayerValue.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using JetBrains.Annotations;
1+
using CustomPlayerEffects;
2+
using JetBrains.Annotations;
23
using LabApi.Features.Wrappers;
34
using PlayerRoles;
45
using PlayerRoles.FirstPersonControl.Thirdperson.Subcontrollers;
@@ -67,6 +68,8 @@ public enum PlayerProperty
6768
HumeShield,
6869
MaxHumeShield,
6970
HumeShieldRegenRate,
71+
Effects,
72+
EffectReferences,
7073
GroupName,
7174
PositionX,
7275
PositionY,
@@ -94,7 +97,7 @@ public enum PlayerProperty
9497
RelativeY,
9598
RelativeZ,
9699
IsNpc,
97-
IsDummy,
100+
IsDummy
98101
}
99102

100103
private class Info<T>(Func<Player, T> handler, string? description)
@@ -126,6 +129,8 @@ private class Info<T>(Func<Player, T> handler, string? description)
126129
[PlayerProperty.HumeShield] = new Info<NumberValue>(plr => (decimal)plr.HumeShield, null),
127130
[PlayerProperty.MaxHumeShield] = new Info<NumberValue>(plr => (decimal)plr.MaxHumeShield, null),
128131
[PlayerProperty.HumeShieldRegenRate] = new Info<NumberValue>(plr => (decimal)plr.HumeShieldRegenRate, null),
132+
[PlayerProperty.Effects] = new Info<CollectionValue<TextValue>>(plr => new(plr.ActiveEffects.Select(e => e.GetType().Name.ToStaticTextValue())), "Collection of names of active effects"),
133+
[PlayerProperty.EffectReferences] = new Info<CollectionValue<ReferenceValue<StatusEffectBase>>>(plr => new(plr.ActiveEffects), "Collection of references of active effects"),
129134
[PlayerProperty.GroupName] = new Info<StaticTextValue>(plr => plr.GroupName, "The name of the group (like admin or vip)"),
130135
[PlayerProperty.PositionX] = new Info<NumberValue>(plr => (decimal)plr.Position.x, null),
131136
[PlayerProperty.PositionY] = new Info<NumberValue>(plr => (decimal)plr.Position.y, null),

0 commit comments

Comments
 (0)