Skip to content

RandomChanceConditionalEffect ​

Inherits: ConditionalEffect < CompositeEffect < Effect < DatabaseResource < Resource

Applies child effects based on a percentage chance, with optional advanced RNG modes to smooth out bad luck streaks.

Properties ​

floatchance_percent25.0
RngModerng_modeRngMode.PURE_RANDOM
floatpity_increase_percent5.0
floatpity_max_chance100.0
intstreak_max_failures5

Methods ​

voidspecific_effect_logic( effect_instance: EffectInstance )
floatget_current_chance( effect_instance: EffectInstance )
voidreset_rng_state( effect_instance: EffectInstance )
Stringget_editor_description()

Enumerations ​

enum RngMode ​

The options of rng mode: pure random, pity timer, streak breaker, weighted streak.

  • PURE_RANDOM = 0 - Each roll is fully independent
  • PITY_TIMER = 1 - Chance increases after each failure
  • STREAK_BREAKER = 2 - Guarantees success after N consecutive failures
  • WEIGHTED_STREAK = 3 - Combines pity timer with a guaranteed-success ceiling

Property descriptions ​

Condition Settings

float chance_percent = 25.0 ​

Base percentage chance (0–100) for the effect to trigger

RNG Mode

RngMode rng_mode = RngMode.PURE_RANDOM ​

How the chance is rolled: purely random, or a mode that evens out bad luck streaks.

Pity Timer Settings

float pity_increase_percent = 5.0 ​

Chance increase per consecutive failure (used by PITY_TIMER and WEIGHTED_STREAK)

float pity_max_chance = 100.0 ​

Maximum chance the pity timer can reach (used by PITY_TIMER and WEIGHTED_STREAK)

Streak Breaker Settings

int streak_max_failures = 5 ​

Consecutive failures before success is guaranteed (used by STREAK_BREAKER and WEIGHTED_STREAK)

Method descriptions ​

void specific_effect_logic( effect_instance: EffectInstance ) ​

What the effect does to its target when it is applied.

float get_current_chance( effect_instance: EffectInstance ) ​

Returns the effective chance for this instance (accounts for pity / streak state). Useful for debugging and UI display.

void reset_rng_state( effect_instance: EffectInstance ) ​

Resets the RNG state for this effect instance (e.g. on combat state transitions).

String get_editor_description() ​

A short text for the effect editor that says what the effect does.