Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- \ https://pastebin.com/14fyEGYx \
- \ Resistance Roll Calculator. Use with http://topps.diku.dk/torbenm/troll.msp \
- attackerSL:= 10
- \ Put the attacker's effective SL here. Default is 10. \
- ;
- defenderSL:= 10
- \ Put the defender's target number here. Default is 10. \
- ;
- usesRuleOfNumber:= 1
- \ If it's a supernatural attack that uses the Rule of 16 (or some other number, entered below), then leave as 1 here (default). Otherwise, change to 0. \
- ;
- ruleOf:= 16
- \ Enter 16 for Rule of 16, which is the default. Replace with the appropriate number if you're using a different Rule. \
- ;
- attackerCritWins:= 1
- \ Leave as 1 if the attacker automatically wins the contest on a critical success. Change to 0 if this is not the case.
- ;
- \---End of user input! The rest below is the code.---\
- skillX:= if {usesRuleOfNumber =/= 1} then attackerSL else
- if {defenderSL > ruleOf} then attackerSL else min{ruleOf,attackerSL};
- skillY:= defenderSL;
- rollX:= sum{1d6+1d6+1d6};
- rollY:= sum{1d6+1d6+1d6};
- resultX:= sum{skillX-rollX};
- resultY:= sum{skillY-rollY};
- critThresholdX:=
- {
- if {skillX >= 16}
- then 6
- else
- if {skillX = 15}
- then 5
- else 4
- };
- critYes:=
- {
- if rollX <= critThresholdX
- then 1
- else 0
- };
- \---End of setting variables. Below determines the output.---\
- if {attackerCritWins = 1} then
- if {critYes = 1} then "WIN" else
- if {resultX < 0} then "LOSE" else
- if {resultX <= resultY} then "LOSE" else "WIN"
- else
- if {resultX < 0} then "LOSE" else
- if {resultX <= resultY} then "LOSE" else "WIN"
- \ Last updated: 2018-04-27
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement