Skip to content

An opposed pool roll system with modifiers help #241

Answered by HighDiceRoller
jllancaster asked this question in Q&A
Discussion options

You must be logged in to vote

In this case it's easiest to use the @ operator for the attacker as well, e.g.

from icepool import d6, map_function

tn = 4 # target number
atk = 4 # base attacker dice
co = 4 # cohesion
mod = 2 # modifier (+/-)
cov = 2 # cover (+)

output((atk + mod) @ (d6 >= tn) - (co + cov) @ (d6 >= tn))

You do have to define what happens with zero or negative pool size. @ treats a negative left operand as negating the result, whereas I did not define the result of a negative pool size.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@jllancaster
Comment options

@jllancaster
Comment options

@HighDiceRoller
Comment options

@jllancaster
Comment options

Answer selected by jllancaster
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants