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)
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
This is actually really nice, thanks alot for the release.
Originally Posted by OmegaBM
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
this isnt needed to make behaviors
Originally Posted by Slendergo
Originally Posted by OmegaBM
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
this isnt needed to make behaviors
Why do you quote the entire post ._.
Originally Posted by Slendergo
this isnt needed to make behaviors
I mean, the sprite world boss could use this i guess. Cant really think of any other boss/mob that uses this.
Originally Posted by Slendergo
this isnt needed to make behaviors
sort of is, on prod, when Limon is paralyzed, he does a certain behavior, and a few other enemies do the same but with different effects and etc.
Originally Posted by Riigged
sort of is, on prod, when Limon is paralyzed, he does a certain behavior, and a few other enemies do the same but with different effects and etc.
When Limon is paralyzed, he shoots 2 shots at you constantly and shoots all out 360
Originally Posted by Desire
When Limon is paralyzed, he shoots 2 shots at you constantly and shoots all out 360
i know xD he does same thing when you are cloaked
Originally Posted by Riigged
i know xD he does same thing when you are cloaked
Shaitan the Advisor with Armor Broken too.
Cool.
/10char
This is very nice, you can make some really nice dungeons with this, I'm not only talking about production ones, this does allow you to create some super cool and unique things.
This could also be the fix for "dazed" on enemies.
Originally Posted by MikeRaarupBirk
This could also be the fix for "dazed" on enemies.
It's very easy to fix dazed on enemies. This behavior is not for that, and either wouldn't work, or be very tedious.
Originally Posted by Invader_Zim
It's very easy to fix dazed on enemies. This behavior is not for that, and either wouldn't work, or be very tedious.
halp me fix dazed xd
Realm of the Mad God Private Servers Help
[FSOD] Cave of a Thousand Treasures (Log Trap Clockwise Behavior) Need It!