fix: Correct segmented ribcage cost

When using a Segmented Ribcage as a tail, the cost in Nevercold Brass is
calculated before the additional segment is taken into account.
This commit is contained in:
Jeremy Saklad 2022-08-22 18:21:52 -05:00
parent d6178ba241
commit 0c2a1a0515
Signed by: Jeremy Saklad
GPG Key ID: 94B02EA3D0B6481B
1 changed files with 2 additions and 2 deletions

View File

@ -337,8 +337,8 @@ def Solve(shadowy_level, bone_market_fluctuations = None, zoological_mania = Non
add_segments = actions[Appendage.SEGMENTED_RIBCAGE]
# Additional segments may be added once the torso and skulls are chosen, so the sum of their properties are the starting point.
base_segments = model.NewIntVar('base segments', lb = 0)
model.Add(base_segments == cp_model.LinearExpr.WeightedSum([value for (key, value) in actions.items() if isinstance(key, (Torso, Skull))], [action.value.segments for action in chain(Torso, Skull)]))
base_segments = model.NewIntVar('base segments', lb = -1)
model.Add(base_segments == cp_model.LinearExpr.WeightedSum([value for (key, value) in actions.items() if isinstance(key, (Torso, Skull))], [action.value.segments for action in chain(Torso, Skull)]) - 1)
first_term, *_ = model.NewIntermediateIntVar(
partialmethod(BoneMarketModel.AddMultiplicationEquality,