Omnikron13

DQuest - Corrected to-hit algorithm

Mar 1st, 2012
101
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (define to-hit
  2.  (lambda ($attacker $defender)
  3.   (if (> $attacker (* $defender 2))
  4.    2
  5.    (if (> $attacker $defender)
  6.     3
  7.     (if (>= (* $attacker 2) $defender)
  8.      4
  9.      (if (>= (* $attacker 3) $defender)
  10.       5
  11.       6))))))
RAW Paste Data