Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Using the API
Updated 2 years agoThere are 2 methods to use the API. Each method uses the SCP500Controller to tell when the pill is taken.
- Use the
LocalPlayerAffectedBySCP500property. 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
}
}
- Patch the
TakePillmethod. Ex:
[HarmonyPostfix]
[HarmonyPatch(typeof(SCP500Controller), nameof(SCP500Controller.TakePill))]
public static void TakePillPostfix()
{
// Do stuff here
}