Using the API

Updated 2 weeks ago

There are 2 methods to use the API. Each method uses the SCP500Controller to tell when the pill is taken.

  1. Use the LocalPlayerAffectedBySCP500 property. This is set to true when the pill is taken and stays true for the duration of the affects (30 seconds by default). Ex:
public void Update()
{
    if (SCP500Controller.LocalPlayerAffectedBySCP500)
    {
        // Do stuff here
    }
}
  1. Patch the TakePill method. Ex:
[HarmonyPostfix]
[HarmonyPatch(typeof(SCP500Controller), nameof(SCP500Controller.TakePill))]
public static void TakePillPostfix()
{
    // Do stuff here
}