# Skill Study Books - probability and weight formulas
# This file is generated documentation. It is not read as configuration.
# All rolls are performed by the logical server.

# Natural LootPool symbols
# C = matching LootTable chance from tensura_skill_books-loot-tables.txt (0.0 to 1.0)
# W_random = positive random-ALL book weight from [loot].item_weights
# W_skill(S) = positive exact skill weight for S from tensura_skill_books-loot-skills.txt
# W_total = W_random + sum of every positive W_skill
# If C <= 0 or W_total <= 0, this mod adds no LootPool.
# P(exact skill book S per table generation) = C * W_skill(S) / W_total
# P(random-ALL book per table generation) = C * W_random / W_total

# Random-category book symbols
# R_skill(S) = random weight for S from tensura_skill_books-random-skills.txt
# New skills default to R_skill=1. R_skill=0 is the exact-skill blacklist value.
# R_total = sum of positive R_skill values after category and owned-skill filtering
# P(S when a random book is opened) = R_skill(S) / R_total
# A candidate with weight 0 is skipped before rolling and does not consume a failed roll.
# If K eligible skills all use weight 1, every skill has probability 1/K.
# Explicit skill-id books do not use random-pool weights.

# Combined path when a random-ALL book came from natural loot
# P(final skill S) = C * (W_random / W_total) * (R_skill(S) / R_total)

# Repeated independent generations
# P(at least one success in N generations) = 1 - (1 - P_single)^N
# Expected successes in N generations = N * P_single

# Example
# C=0.10, W_random=30, W_skill(A)=70 gives W_total=100.
# P(A)=0.10*70/100=0.07 (7 percent); P(random book)=0.10*30/100=0.03 (3 percent).
# If random weights are A=4 and B=1, then P(A inside that random pool)=4/5=0.8.
# If 100 eligible skills all use weight 1, each skill has probability 1/100=0.01 (1 percent).
