Add amalgamy fascination for Diplomat

This fascination scales with the amount of amalgamy on the skeleton.
This commit is contained in:
Jeremy Saklad 2021-08-03 15:34:37 -05:00
parent 84c62aa3c6
commit 06df9e6304
Signed by: Jeremy Saklad
GPG Key ID: 9CA2149583EDBF84
2 changed files with 28 additions and 0 deletions

View File

@ -129,6 +129,11 @@ class Buyer(Enum):
cost = Cost.ACTION.value cost = Cost.ACTION.value
) )
THE_TRIFLING_DIPLOMAT_AMALGAMY = Action(
"Sell the Diplomat an amalgamous skeleton",
cost = Cost.ACTION.value
)
THE_TRIFLING_DIPLOMAT_ANTIQUITY = Action( THE_TRIFLING_DIPLOMAT_ANTIQUITY = Action(
"Sell the Diplomat an antique skeleton", "Sell the Diplomat an antique skeleton",
cost = Cost.ACTION.value cost = Cost.ACTION.value

View File

@ -1025,6 +1025,29 @@ def Solve(shadowy_level, bone_market_fluctuations = None, zoological_mania = Non
model.Add(added_exhaustion == 0).OnlyEnforceIf(actions[Buyer.THE_CARPENTERS_GRANDDAUGHTER]) model.Add(added_exhaustion == 0).OnlyEnforceIf(actions[Buyer.THE_CARPENTERS_GRANDDAUGHTER])
# The Trifling Diplomat - Amalgamy
model.Add(skeleton_in_progress >= 100).OnlyEnforceIf(actions[Buyer.THE_TRIFLING_DIPLOMAT_AMALGAMY])
model.Add(amalgamy >= 5).OnlyEnforceIf(actions[Buyer.THE_TRIFLING_DIPLOMAT_AMALGAMY])
amalgamy_squared = model.NewIntVar(0, cp_model.INT32_MAX, '{}: {}'.format(Buyer.THE_TRIFLING_DIPLOMAT_AMALGAMY.name, 'amalgamy squared'))
model.AddMultiplicationEquality(amalgamy_squared, [amalgamy, amalgamy])
value_remainder = model.NewIntVar(0, 49, '{}: {}'.format(Buyer.THE_TRIFLING_DIPLOMAT_AMALGAMY.name, 'value remainder'))
model.AddModuloEquality(value_remainder, value, 50)
model.Add(primary_revenue == value - value_remainder + 50).OnlyEnforceIf(actions[Buyer.THE_TRIFLING_DIPLOMAT_AMALGAMY])
model.Add(secondary_revenue == 50*amalgamy_squared).OnlyEnforceIf(actions[Buyer.THE_TRIFLING_DIPLOMAT_AMALGAMY])
model.Add(difficulty_level == 0).OnlyEnforceIf(actions[Buyer.THE_TRIFLING_DIPLOMAT_AMALGAMY])
# The indirection is necessary for applying an enforcement literal
derived_exhaustion = model.NewIntVar(cp_model.INT32_MIN, cp_model.INT32_MAX, '{}: {}'.format(Buyer.THE_TRIFLING_DIPLOMAT_AMALGAMY.name, 'derived exhaustion'))
model.AddDivisionEquality(derived_exhaustion, amalgamy_squared, 100)
model.Add(added_exhaustion == derived_exhaustion).OnlyEnforceIf(actions[Buyer.THE_TRIFLING_DIPLOMAT_AMALGAMY])
del amalgamy_squared, value_remainder, derived_exhaustion
# The Trifling Diplomat - Antiquity # The Trifling Diplomat - Antiquity
model.Add(skeleton_in_progress >= 100).OnlyEnforceIf(actions[Buyer.THE_TRIFLING_DIPLOMAT_ANTIQUITY]) model.Add(skeleton_in_progress >= 100).OnlyEnforceIf(actions[Buyer.THE_TRIFLING_DIPLOMAT_ANTIQUITY])
model.Add(antiquity >= 5).OnlyEnforceIf(actions[Buyer.THE_TRIFLING_DIPLOMAT_ANTIQUITY]) model.Add(antiquity >= 5).OnlyEnforceIf(actions[Buyer.THE_TRIFLING_DIPLOMAT_ANTIQUITY])