public void OnPickingUpScp330(PickingUpScp330EventArgs ev)
 {
     if (Scp330Control.Singleton.Config.AllowedCandies.Count == 0)
     {
         ev.IsAllowed = false;
         return;
     }
     if (!Scp330Control.Singleton.Config.AllowedCandies.Contains(ev.ItemId))
     {
         int index = rng.Next(0, Scp330Control.Singleton.Config.AllowedCandies.Count - 1);
         ev.ItemId = Scp330Control.Singleton.Config.AllowedCandies.ElementAt(index);
     }
 }
Example #2
0
 /// <summary>
 /// Called before a player picks up a SCP-330 candy.
 /// </summary>
 /// <param name="ev">The <see cref="PickingUpScp330EventArgs"/> instance.</param>
 public static void OnPickingUp330(PickingUpScp330EventArgs ev) => PickingUpScp330.InvokeSafely(ev);