| summaryrefslogtreecommitdiff | 
diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/shared/shr_roll.erl | 8 | 
1 files changed, 7 insertions, 1 deletions
| diff --git a/src/shared/shr_roll.erl b/src/shared/shr_roll.erl index e03d548..0e44d63 100644 --- a/src/shared/shr_roll.erl +++ b/src/shared/shr_roll.erl @@ -61,9 +61,15 @@ percentage_with_luck (Chance, Luck) ->     ModedRoll = max(0, min((Roll - Luck), 100)),     IsSuccess = (Roll =< ModedChance), +   BadLuckBonus = +      case (Luck < 0) of +         true -> 1; +         false -> 0 +      end, +     {        ModedRoll,        IsSuccess, -      calculate_costs(IsSuccess, Roll, Chance), +      (BadLuckBonus + calculate_costs(IsSuccess, Roll, Chance)),        (-1 * calculate_costs(IsSuccess, Roll, ModedChance))     }. | 


