Count starting limbs in cost of adding joints

Some torsos, notably the Headless Skeleton, come with pre-filled limbs
that must be factored into the calculation.
This commit is contained in:
Jeremy Saklad 2021-06-17 11:26:24 -05:00
parent 244e87e4bf
commit c6c04c1025
Signed by: Jeremy Saklad
GPG Key ID: 9CA2149583EDBF84

View File

@ -1338,7 +1338,7 @@ def Solve(bone_market_fluctuations, zoological_mania, occasional_buyer = None, d
add_joints = actions[Appendage.ADD_JOINTS]
base_joints = model.NewIntVar(0, cp_model.INT32_MAX, 'base joints')
model.Add(base_joints == cp_model.LinearExpr.ScalProd([value for (key, value) in actions.items() if isinstance(key, Torso)], [torso.value.limbs_needed for torso in Torso]))
model.Add(base_joints == cp_model.LinearExpr.ScalProd([value for (key, value) in actions.items() if isinstance(key, Torso)], [torso.value.limbs_needed + torso.value.arms + torso.value.legs + torso.value.wings + torso.value.fins + torso.value.tentacles for torso in Torso]))
add_joints_amber_cost_multiple = model.NewIntVar(0, cp_model.INT32_MAX, 'add joints amber cost multiple')