RandomChanceCondition ​
Inherits: EntityCondition < Condition < Resource
Checks if a random roll succeeds based on percentage chance. Supports multiple RNG modes including pity timers for bad luck protection.
Properties ​
float | chance_percent | 50.0 |
RngMode | rng_mode | RngMode.PURE_RANDOM |
float | pity_increase_percent | 5.0 |
float | max_pity_chance | 100.0 |
int | max_failures | 5 |
Variables ​
int | consecutive_failures | 0 |
Methods ​
bool | evaluate( argument: Variant = null ) |
float | get_current_chance() |
void | reset_pity_timer() |
String | get_description() |
String | get_function_description() |
Enumerations ​
enum RngMode ​
The options of rng mode: pure random, pity timer, streak breaker, weighted streak.
- PURE_RANDOM =
0- Each roll is independent (original behavior) - PITY_TIMER =
1- Chance increases after each failure - STREAK_BREAKER =
2- Guarantees success after X failures - WEIGHTED_STREAK =
3- Combines pity timer with guaranteed success
Property descriptions ​
float chance_percent = 50.0 ​
The chance of success, in percent
RngMode rng_mode = RngMode.PURE_RANDOM ​
How luck is smoothed out: pure random, a growing chance after failures, or a guaranteed success after a streak of failures
Pity Timer Settings
float pity_increase_percent = 5.0 ​
How much to increase chance per failure (only for PITY_TIMER and WEIGHTED_STREAK)
float max_pity_chance = 100.0 ​
Maximum chance the pity timer can reach
Streak Breaker Settings
int max_failures = 5 ​
Maximum failures before guaranteed success (only for STREAK_BREAKER and WEIGHTED_STREAK)
Variable descriptions ​
int consecutive_failures = 0 ​
Internal state - tracks consecutive failures for this specific condition instance
Method descriptions ​
bool evaluate( argument: Variant = null ) ​
Is the condition met?
float get_current_chance() ​
Get current effective chance (for debugging/UI)
void reset_pity_timer() ​
Reset the failure counter (useful for combat state transitions)
String get_description() ​
A short text about what the condition checks.
String get_function_description() ​
The sentence the editor shows for the condition, with {placeholders} for its values.