Nemesis fights are straightforward:
- Choose pools of yang/yin,
- Roll Nd6 vs. Skill,
- Deal Yang hits to opponent(s),
- Block dealt hits with Yin or Chi,
- First to -1 Chi loses,
- Players win ties.
Pursuant to an earlier question, I am attempting to model this sequence in Anydice. For simplicity, I skip over the yang/yin steps, and model the players as a single large pool of Chi.
Ideally, this Anydice plot shall display the likelihood that players possessing PCHI
chi win a fight against a Nemesis possessing NCHI
chi.
The recursive "fight" function:
function: fight PCHI:n chi vs NCHI:n chi {
HITS: 5d(1d6<=2)
TAKES: 5d(1d6<=2)
PLAYERWIN: HITS >= TAKES
if PLAYERWIN {
if NCHI = 0 {
result: 1
}
result: [fight PCHI chi vs NCHI-1 chi]
}
if X = 0 {
result: 0
}
result: [fight PCHI-1 chi vs NCHI chi]
}
output [fight 5 chi vs 5 chi]
At present, Anydice produces the following error:
calculation error
Boolean values can only be numbers, but you provided "d{?}".
Depending on what you want, you might need to create a function.
I believe this indicates that PLAYERWIN
is a range of rolls. All well and good, but at present I'm not sure how to structure the function such that it recurs with different arguments based on whether players did indeed deal equal or greater hits.