Table of Contents

Class LawController

Namespace
S1API.Law
Assembly
S1API.dll

Controls law enforcement intensity and automatic activity systems. Manages the automatic evaluation of checkpoints, patrols, and other law enforcement activities.

public static class LawController
Inheritance
LawController
Inherited Members

Remarks

Law enforcement intensity (1-10) determines which automatic activities are enabled. The automatic evaluation system runs every in-game minute based on intensity, time, day, and curfew status. To prevent automatic checkpoint activation, set intensity to 1-4.

Fields

DailyIntensityDrain

The amount of internal intensity that increases per day naturally. Note: This constant exists in the game code but the actual increase is controlled by IntensityIncreasePerDay.

public const float DailyIntensityDrain = 0.05

Field Value

float

MaxIntensity

The maximum law enforcement intensity level.

public const int MaxIntensity = 10

Field Value

int

MinIntensity

The minimum law enforcement intensity level.

public const int MinIntensity = 1

Field Value

int

Properties

Intensity

Gets the current law enforcement intensity level (1-10).

public static int Intensity { get; }

Property Value

int

Remarks

Higher values trigger more aggressive automatic law enforcement activities. Checkpoint activation typically requires intensity level 5 or higher.

InternalIntensity

Gets the internal law enforcement intensity as a normalized value (0.0-1.0).

public static float InternalIntensity { get; }

Property Value

float

Remarks

This is the underlying value used by the game. The public Intensity property is derived from this value mapped to a 1-10 range.

IsUsingOverrideSettings

Gets whether custom activity settings are currently overriding the default day-based settings.

public static bool IsUsingOverrideSettings { get; }

Property Value

bool

Remarks

When true, the game uses OverrideActivitySettings(LawActivitySettings) instead of day-specific settings (Monday, Tuesday, etc.).

Methods

ChangeIntensity(float)

Changes the law enforcement intensity by a specified amount.

public static void ChangeIntensity(float change)

Parameters

change float

The amount to change intensity by (can be negative). Value is clamped internally.

Remarks

The internal intensity is stored as a 0.0-1.0 value and mapped to 1-10 for display. Small changes (e.g., 0.1) will have a noticeable effect.

ClearActivitySettingsOverride()

Clears any activity settings override and returns to using day-based settings.

public static void ClearActivitySettingsOverride()

OverrideActivitySettings(LawActivitySettings)

Overrides the default day-based activity settings with custom settings.

public static void OverrideActivitySettings(LawActivitySettings settings)

Parameters

settings LawActivitySettings

The custom activity settings to use, or null to clear the override.

Remarks

WARNING: Advanced feature. The settings object is not part of the public API and must be obtained from game internals. To simply disable automatic activities, set Intensity to 1 instead.

SetIntensityLevel(int)

Sets the law enforcement intensity to a specific level (1-10).

public static void SetIntensityLevel(int level)

Parameters

level int

The intensity level to set (1-10). Will be clamped.

Remarks

This is a convenience method that converts a 1-10 level to the internal 0.0-1.0 range. To prevent automatic checkpoint activation, use level 1-4.

SetInternalIntensity(float)

Sets the law enforcement intensity to a specific normalized value (0.0-1.0).

public static void SetInternalIntensity(float intensity)

Parameters

intensity float

The intensity value to set (0.0 = minimum, 1.0 = maximum). Will be clamped.

Remarks

This sets the internal intensity directly. The public Intensity property will reflect the change as a 1-10 value.