From 7565f30d32ec2b8be78b1be79f695d36ee43b375 Mon Sep 17 00:00:00 2001 From: Jeremy Saklad Date: Thu, 24 Jun 2021 08:45:59 -0500 Subject: [PATCH] Update formula for Zoological Mania bonus Certain declarations now have their value boosted by 15% during Zoological Mania, rather than just 10%. The list of declarations is currently hardcoded, and may need to be updated in the future. --- Bone Market Solver.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Bone Market Solver.py b/Bone Market Solver.py index df85aef..a4e7c94 100644 --- a/Bone Market Solver.py +++ b/Bone Market Solver.py @@ -1251,14 +1251,16 @@ def Solve(shadowy_level, bone_market_fluctuations, zoological_mania, occasional_ original_value = model.NewIntVar(0, cp_model.INT32_MAX, 'original value') model.Add(original_value == cp_model.LinearExpr.ScalProd(actions.values(), [action.value.value for action in actions.keys()])) - multiplied_value = model.NewIntVar(0, cp_model.INT32_MAX*11, 'multiplied value') - model.Add(multiplied_value == original_value*11).OnlyEnforceIf(actions[zoological_mania]) - model.Add(multiplied_value == original_value*10).OnlyEnforceIf(actions[zoological_mania].Not()) + multiplier = 115 if zoological_mania in [Declaration.FISH, Declaration.INSECT, Declaration.SPIDER] else 110 + + multiplied_value = model.NewIntVar(0, cp_model.INT32_MAX, 'multiplied value') + model.Add(multiplied_value == multiplier*original_value).OnlyEnforceIf(actions[zoological_mania]) + model.Add(multiplied_value == 100*original_value).OnlyEnforceIf(actions[zoological_mania].Not()) value = model.NewIntVar(0, cp_model.INT32_MAX, 'value') - model.AddDivisionEquality(value, multiplied_value, 10) + model.AddDivisionEquality(value, multiplied_value, 100) - del original_value, multiplied_value + del original_value, multiplier, multiplied_value # Torso Style calculation