Skip to content

byChance beta ​

Function of @v12-engine/engine

ts
export declare function byChance(context: EffectContext, chance: EffectValue | undefined, target?: Entity): boolean;

Whether an effect that happens by chance (EffectCommon.chance) does this time: a draw from the world's numbers (world.rng) under its share at the context's level, or what its code says for the target. True with no chance, and then nothing is drawn (the world's numbers go on as they were); nothing is drawn for a share of 0 or of 1 either