Created
January 13, 2011 01:08
-
-
Save MisterPhoton/777229 to your computer and use it in GitHub Desktop.
D&D AnyDice Hunter Calc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MISS: 0 | |
HIT: 1 | |
CRITICALHIT: 2 | |
function: attack ROLL:n vs DEFENSE:n { | |
if ROLL = 1 { result: MISS } | |
if ROLL = 20 { | |
if ROLL + ATTACK >= DEFENSE { result: CRITICALHIT } | |
result: HIT | |
} | |
if ROLL + ATTACK >= DEFENSE { result: HIT } | |
result: MISS | |
} | |
function: damage for ATTACKS:s { | |
D: 0 | |
loop A over {1..#ATTACKS} { | |
if A@ATTACKS = CRITICALHIT { D: D + CRITICAL } | |
else if A@ATTACKS = HIT { D: D + DAMAGE } | |
} | |
result: D + [extra damage for ATTACKS] | |
} | |
function: extra damage for ATTACKS:s { | |
if [ATTACKS contains CRITICALHIT] { | |
result: [maximum of QUARRY] | |
} | |
if [ATTACKS contains HIT] { result: QUARRY } | |
result: 0 | |
} | |
function: twin strike { | |
result: [damage for 2d[attack d20 vs DEFENSE]] | |
} | |
DEFENSE: d{12..22} | |
QUARRY: d6 | |
ATTACK : 6 + 2 | |
DAMAGE : d12 + 6 | |
CRITICAL: 18 | |
output [twin strike] named "Greatbow" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment