Move DIFFICULTY_SCALER to challenge_functions.py, specify char import in read_char.py
This commit is contained in:
parent
dee14ddf06
commit
6fedd6979f
|
@ -1,3 +1,6 @@
|
|||
# This is a constant used to calculate difficulty checks. You almost certainly do not need to change this.
|
||||
DIFFICULTY_SCALER = 0.6
|
||||
|
||||
def narrow_challenge(difficulty_level: int, stat: int):
|
||||
offset = 6 - difficulty_level
|
||||
stat += offset
|
||||
|
@ -9,6 +12,11 @@ def narrow_challenge(difficulty_level: int, stat: int):
|
|||
else:
|
||||
return stat/10
|
||||
|
||||
def broad_challenge(difficulty_level: int, stat: int):
|
||||
chance = DIFFICULTY_SCALER*stat//difficulty_level
|
||||
|
||||
return chance
|
||||
|
||||
def mean_outcome(success: int, failure: int, chance: float):
|
||||
mean_success = success*chance
|
||||
mean_failure = failure*(1-chance)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
try:
|
||||
from .custom_char import *
|
||||
from .custom_char import Char
|
||||
except:
|
||||
print("Note: custom_char.py does not exist. Using default_char.py")
|
||||
from .default_char import *
|
||||
from .default_char import Char
|
||||
|
|
|
@ -27,8 +27,7 @@ ATTRIBUTE_MULTIPLIER = 10000000
|
|||
# This is the highest number of attribute to calculate fractional exponents for.
|
||||
MAXIMUM_ATTRIBUTE = 100
|
||||
|
||||
# This is a constant used to calculate difficulty checks. You almost certainly do not need to change this.
|
||||
DIFFICULTY_SCALER = 0.6
|
||||
from .challenge_functions import DIFFICULTY_SCALER
|
||||
|
||||
|
||||
def NewIntermediateBoolVar(self, name, expression, domain):
|
||||
|
|
Loading…
Reference in New Issue