From 7f8c9f7c32083685c188bee9b0f4586f43703eeb Mon Sep 17 00:00:00 2001 From: Jeremy Saklad Date: Fri, 8 Mar 2024 13:14:26 -0600 Subject: [PATCH] feat(solver): Update Counter-church value of Holy Relics of St. Fiacre Holy Relics have been nerfed, with different values for each torso type. The new values don't follow an obvious formula, unfortunately, so they have to be hard-coded for each Torso Style value. This will need to be maintained going forward if new Torso Styles become possible. --- bonemarketsolver/solve.py | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/bonemarketsolver/solve.py b/bonemarketsolver/solve.py index 211fcfe..61803c6 100644 --- a/bonemarketsolver/solve.py +++ b/bonemarketsolver/solve.py @@ -245,16 +245,35 @@ def Solve(shadowy_level, bone_market_fluctuations = None, zoological_mania = Non # Counter-church calculation # Calculate amount of Counter-church from Holy Relics of the Thigh of Saint Fiacre - holy_relic = actions[Appendage.FIACRE_THIGH] - torso_style_divided_by_ten = model.NewIntVar('torso style divided by ten', lb = 0) - model.AddDivisionEquality(torso_style_divided_by_ten, torso_style, 10) + + # The amount of Counter-church added by each Holy Relic, which is based on the Torso Style. + # + # The precise formula for this is unknown as of this writing, so it is being hard-coded as a stopgap. + holy_relic_counter_church_each = model.NewIntVar('holy relic counter-church each') + model.AddAllowedAssignments( + (torso_style, holy_relic_counter_church_each), + ( + (10, 1), # Human + (15, 1), # Human + (20, 2), # Thorny-Breasted + (30, 2), # Seven-necked + (40, 3), # Many-limbed + (45, 3), # Segmented + (50, 4), # Mammoth + (60, 5), # Baroque + (70, 6), # Deep-water + (80, 6), # Prismatic + (100, 7) # Starved + ) + ) + holy_relic_counter_church = model.NewIntVar('holy relic counter-church', lb = 0) - model.AddMultiplicationEquality(holy_relic_counter_church, (holy_relic, torso_style_divided_by_ten)) + model.AddMultiplicationEquality(holy_relic_counter_church, (actions[Appendage.FIACRE_THIGH], holy_relic_counter_church_each)) counter_church = model.NewIntVar('counter-church', lb = 0) model.Add(counter_church == cp_model.LinearExpr.WeightedSum(actions.values(), [action.value.counter_church for action in actions.keys()]) + holy_relic_counter_church) - del holy_relic, torso_style_divided_by_ten, holy_relic_counter_church + del holy_relic_counter_church_each, holy_relic_counter_church # Exhaustion calculation