Skip to content

2. API documentation

ALEX2014 edited this page Jun 27, 2025 · 2 revisions

Time Stop API Documentation

This document describes accessible API methods, functions, and interfaces provided by the library for time manipulation in Rain World.


1. RainWorldGame Extensions

void SwitchTimeState()

Description:
Toggles the current time state. Freezes time if currently unfrozen, unfreezes if frozen.
Internals:
Calls FreezeTime() or UnfreezeTime() as appropriate.

void FreezeTime()

Description:
Freezes time if currently unfrozen.
Behavior:
No operation if time is already frozen.

void UnfreezeTime()

Description:
Unfreezes time if currently frozen.
Behavior:
No operation if time is already unfrozen.

bool IsTimeStopActive()

Returns:
true if time is currently frozen, false otherwise.

void AddImmuneType(Type type)

Description:
Adds a type to the time-stop immune classes list.
Logging:
Records calling assembly and added type to:
Rain World/RainWorld_Data/StreamingAssets/timeStopImmuneListLog.txt

void RemoveImmuneType(Type type)

Description:
Removes a type from the time-stop immune classes list.
Logging:
Records calling assembly and removed type to:
Rain World/RainWorld_Data/StreamingAssets/timeStopImmuneListLog.txt

void AllowEffectsUpdateDuringTimeStop()

Description:
Allows some decorative graphics (mainly camera controlled effects) and sound controllers to get updates during Time Stop State.

void DisallowEffectsUpdateDuringTimeStop()

Description:
Prevents some decorative graphics (mainly camera controlled effects) and sound controllers from getting updates during Time Stop State.

bool IsEffectsUpdateAllowed()

Description:
Returns whenever or not decorative graphics and sound controllers updates are allowed during Time Stop State.


2. UpdatableAndDeletable Extensions

void SwitchTimeStopImmunityState()

Description:
Toggles time-stop immunity for the object. Grants immunity if absent, revokes if present.

void GrantTimeStopImmunity()

Description:
Grants time-stop immunity to the object.

void RevokeTimeStopImmunity()

Description:
Revokes time-stop immunity from the object.

bool IsTimeStopImmune()

Returns:
true if object has active time-stop immunity, false otherwise.

bool IsThisTypeImmune()

Returns:
true if the object's type is in the global immune classes list, false otherwise.


3. Interface

IAmImmuneToTimeStop

Behavior:
When implemented by an UpdatableAndDeletable-based object:

  • Object continues updating during time freeze even if it's IsTimeStopImmune() and IsThisTypeImmune() return false

Usage Example:

public class MyCustomObject : UpdatableAndDeletable, IAmImmuneToTimeStop
{
    // Will update even during time freeze
    public override void Update(bool eu)
    {
        base.Update(eu);
        // Custom logic here
    }
}