# Victoriana (Heresy) dice in Anydice?

I'm looking for help with calculating the dice probabilities for the Heresy dice system, as featured in the Victoriana (3rd ed, in case it matters) RPG.

It's a d6 dice pool system. You roll attribute+skill d6s. Each 1 or 6 is a success, and for each 6 you roll, you roll an additional die. Lather, rinse, repeat.

More-difficult tasks mean adding more dice into the mix, which the game calls "black dice". Each black die subtracts a success if it rolls a 1 or 6. Black dice do not roll extra dice on a 6.

So, the black die are easy. That part is just

- [count {1,6} in Bd6]


Where B is the variable I've stuffed the number of black dice into.

It seems to me that the overall logic (algorithm/pseudocode) should be something like:

Input N skill + B black
initiate empty variable S
loop: roll N skill dice {
for each die
1: increase S by 1
6: increase S by 1, increase N by 1
}
loop: roll B black dice {
for each die
1,6: decrease S by 1
}


But I'm failing to translate that into Anydice syntax. Repeatedly, in many different ways. Any help?

• I maybe reverse-engineered a solution from the NWOD example? anydice.com/program/1a19f But I don't completely understand it, so I'm not sure it's working right, though the output distributions look plausible. – NatB Feb 26 '20 at 5:02
• You are correct that POOL only exists as an alias for [splode d6]. You can write your function as function: heresy S:n vs B:n { result: Sd[splode d6] - [count {1,6} in Bd6] } – Caleth Feb 26 '20 at 10:39
• Welcome to RPG.SE! Take the tour if you haven't already and see the help center or ask us here in the comments (use @ to ping someone) if you need more guidance. Good Luck and Happy Gaming! – Someone_Evil Feb 26 '20 at 12:11

If I understood your explanation right, this code should do it:

function: helper ROLL:n max MAX:n {
if ROLL = 6 & MAX > 0 {
result: 1 + [helper d6 max MAX-1]
} else {
result: ROLL = 1 | ROLL = 6
}
}

SKILL: [helper d6 max 9]
BLACK: [helper d6 max 0]

output SKILL named "single skill die"
output BLACK named "single black die"
output 3dSKILL - 2dBLACK named "3 skill dice, 2 black dice"


Note that the helper function is only used to construct the custom skill die. You can increase the maximum number of possible rerolls above 9, but then you'll also need to increase AnyDice's built-in recursion depth limit.

Ps. The output of programs like this that involve exploding dice will typically include a long tail of high-value results with probabilities that round down to 0.00%. If you'd prefer to cut off the tail e.g. for graphing purposes, you can impose an artificial upper limit using something like:

output [lowest of 10 and 3dSKILL - 2dBLACK]

• Oh, that's much cleaner to read than what I came up with, and it seems right. Couple questions, to make sure I'm understanding: (1) Because of recursion, the result on the first if would be 1+1+..+1+the last die, right? The recursion is why the function doesn't need a dummy variable or a loop to add extra dice in? (2) ROLL = 1 | ROLL = 6 is equivalent to ROLL = {1,6}, right? And the only reason that would ever match on a 6 is because the rerolls have hit their cap, right? – NatB Feb 28 '20 at 0:37
• Yes, to both questions. – Ilmari Karonen Feb 28 '20 at 9:04