API

I made an API of sorts that allows anyone to make their own dice effect:


public interface IEffect
{
    EffectType Outcome { get; }
    bool ShowDefaultTooltip { get; }
    string Name { get; }
    string Tooltip { get; }
    void Use();
}
    

Your dice roll has to be an IEffect from MysteryDice.Effects, and anything put in Use() will run when rolled.

Use() is only run by the client that rolled the die, so if you need server logic such as spawning things, it's best to use a networker for that.

To register your effect in your plugin's Awake method, you would call:


MysteryDice.MysteryDice.RegisterNewEffect(new YourEffect());
    

I made an Example Mod that uses said API if you want to see how it all works.

Back