Aetheria/Assets/Scripts/ServerShared/Behaviors/Reflector.cs

27 lines
1,011 B
C#
Raw Normal View History

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
public class Reflector : Behavior
{
private readonly PerformanceStat _crossSection;
2026-06-15 19:06:13 +01:00
public Reflector(RuntimeBehaviorDefinition definition, EquippedItem item) : base(definition, item)
{
2026-06-15 19:06:13 +01:00
_crossSection = definition.PerformanceStat(1, new PerformanceStat());
RegisterPerformanceStat("CrossSection", _crossSection);
}
2026-06-15 19:06:13 +01:00
public Reflector(RuntimeBehaviorDefinition definition, ConsumableItemEffect item) : base(definition, item)
{
2026-06-15 19:06:13 +01:00
_crossSection = definition.PerformanceStat(1, new PerformanceStat());
RegisterPerformanceStat("CrossSection", _crossSection);
}
public override bool Execute(float dt)
{
2026-06-21 09:37:54 +01:00
Entity.VisibilitySources[this] = Evaluate(_crossSection) * Entity.Zone.GetLight(Entity.CultPositionXZ);
2026-06-13 04:56:50 +01:00
return true;
}
}