[FSoD] Conditional Behaviors
Why did I make this?
Since I started remaking all the dungeons on my private server to be 100% prodlike, I needed certain behaviors to only happen when the enemy has a certain condition effect (Limon and Paralyze). Not sure how many people already have this, but since it was fairly simple to create, I decided it wouldn't cause any harm to release.
How do I add this to my private server?
Adding this to your private server is fairly simple. First create a new item in /wServer/logic/behaviors and name it "ConditionalBehavior.cs".




After that, replace that entire file with this code.
Code:
using wServer.realm;
namespace wServer.logic.behaviors
{
public class ConditionalBehavior : Behavior
{
private readonly ConditionEffectIndex effect;
private readonly Behavior behavior;
public ConditionalBehavior(ConditionEffectIndex effect, Behavior behavior)
{
this.effect = effect;
this.behavior = behavior;
}
protected override void OnStateEntry(Entity host, RealmTime time, ref object state)
{
behavior.OnStateEntry(host, time);
}
protected override void TickCore(Entity host, RealmTime time, ref object state)
{
if (host.HasConditionEffect(effect))
behavior.Tick(host, time);
}
}
}
How do I use this?

Example
Behavior used


This is a very basic behavior, but tons of very cool bosses/enemies can be made because of it! If this was released already, my apologies. I would love to see the cool bosses made with this so if you make something neat, upload a video on it and pm the video (if you can)
Credits
OmegaBM

