From 06929bd7b2fb95bf90f38de5e84d6a5ceb83c7e8 Mon Sep 17 00:00:00 2001 From: Jeremy Saklad Date: Sun, 13 Jun 2021 14:27:53 -0500 Subject: [PATCH] Add Embellishment enumeration These actions are taken after a declaration is made, but before the skeleton is sold. Since these actions offer a way of reducing implausibility, difficulty level has been tweaked to avoid allow lowering it past zero. --- Bone Market Solver.py | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/Bone Market Solver.py b/Bone Market Solver.py index 9c22c64..24e91ef 100644 --- a/Bone Market Solver.py +++ b/Bone Market Solver.py @@ -69,6 +69,9 @@ class Cost(enum.Enum): # Various opportunity cards DOCK_FAVOURS = ACTION + # Extraordinary Implication + EXTRAORDINARY_IMPLICATION = 250 + # Eyeless Skull # No consistent source EYELESS_SKULL = cp_model.INT32_MAX/2 @@ -116,6 +119,9 @@ class Cost(enum.Enum): # These are accumulated while acquiring other qualities. HUMAN_ARM = 0 + # Incisive Observation + INCISIVE_OBSERVATION = 50 + # Crate of Incorruptible Biscuits INCORRUPTIBLE_BISCUITS = 250 @@ -170,6 +176,10 @@ class Cost(enum.Enum): # Hand-picked Peppercaps PEPPERCAPS = HINTERLAND_SCRIP + # Revisionist Historical Narrative + # Waswood + REVISIONIST_NARRATIVE = ACTION + 4*EXTRAORDINARY_IMPLICATION + INCISIVE_OBSERVATION + # Knob of Scintillack SCINTILLACK = 250 @@ -1027,6 +1037,25 @@ class Declaration(enum.Enum): # The current value of Zoological Mania, which grants a 10% bonus to value for a certain declaration. ZOOLOGICAL_MANIA = Declaration.AMPHIBIAN + +# Actions taken after a declaration is made. +class Embellishment(enum.Enum): + MORE_PLAUSIBLE = Action( + "Make it seem just a bit more plausible", + cost = Cost.ACTION.value + Cost.REVISIONIST_NARRATIVE.value, + implausibility = -1 + ) + + CONVINCING_HISTORY = Action( + "Invest great time and skill in coming up with a convincing history", + cost = Cost.ACTION.value + 3*Cost.REVISIONIST_NARRATIVE.value, + implausibility = -5 + ) + + def __str__(self): + return str(self.value) + + # Which skeleton attribute is currently boosted. class Fluctuation(enum.Enum): ANTIQUITY = 1 @@ -1035,6 +1064,7 @@ class Fluctuation(enum.Enum): # The current value of Bone Market Fluctuations, which grants various bonuses to certain buyers. BONE_MARKET_FLUCTUATIONS = Fluctuation.AMALGAMY + def Solve(): model = cp_model.CpModel() @@ -1063,6 +1093,10 @@ def Solve(): for declaration in Declaration: actions[declaration] = model.NewBoolVar(declaration.value.name) + # Embellishment + for embellishment in Embellishment: + actions[embellishment] = model.NewIntVar(0, cp_model.INT32_MAX, embellishment.value.name) + # One torso model.Add(cp_model.LinearExpr.Sum([value for (key, value) in actions.items() if isinstance(key, Torso)]) == 1) @@ -1165,7 +1199,7 @@ def Solve(): # Cost # Calculate value of actions needed to sell the skeleton. - difficulty_level = model.NewIntVar(0, cp_model.INT32_MAX, 'difficulty level') + difficulty_level = model.NewIntVar(cp_model.INT32_MIN, cp_model.INT32_MAX, 'difficulty level') non_zero_difficulty_level = model.NewIntVar(1, cp_model.INT32_MAX, 'non-zero difficulty level') model.AddMaxEquality(non_zero_difficulty_level, [difficulty_level, 1])