Variable target numbers #181
Answered
by
HighDiceRoller
jllancaster
asked this question in
Q&A
-
Hi there, wondering if I might be able to get some help here. I am trying to figure out how to code up a mechanic with variable target numbers for the dice pool, but my feeble brain could use some tips on getting started.
Thank you very much! I've made it this far:
|
Beta Was this translation helpful? Give feedback.
Answered by
HighDiceRoller
Feb 15, 2024
Replies: 1 comment 8 replies
-
Happy to get your message! In this case it's easiest to use the from icepool import d6, map_function
@map_function
def var_target(pool, target):
target = max(target, 2)
return sum(x >= target for x in pool) + pool.count(6)
output(var_target(d6.pool(6), d6.highest(2, 1))) |
Beta Was this translation helpful? Give feedback.
8 replies
Answer selected by
jllancaster
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Happy to get your message! In this case it's easiest to use the
@map_function
decorator, which runs a function over all outcomes of dice and all tuples-of-outcomes of pools.You can try this in your browser here.