_statcheck 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # $statcheck
  2. ! FUNC('$statcheck', Statname, Value, Bordervalue)
  3. ! ARGS[0] = Statname: the stat you need to compare to
  4. ! ARGS[1] = Value: the comparison value. This is the value your stat needs to be higher, or lower.
  5. ! ARGS[2] = Bordervalue: the value above (or under) the current situation cannot raise (or lower) the stat. It is like saying that this set to 50 (panty flashing) cannot make Sveta into a total exhibitionist (value 100), even if she does this every day.
  6. ! Bordervalue always has to be closer to the defined edge of the scale (0 or 100) than the Value! It cannot be the same value than the Value, but can be close to it (like func('$statcheck', pcs_agil, 70, 71) )
  7. ! The result is given back in the RESULT variable, this should be the new value of Statname, unless it is -1, then the check failed
  8. ! Usage: if func('$statcheck', pcs_agil, 30, 50) >= 0: pcs_agil = func('$statcheck', pcs_agil, 30, 50)
  9. !If it is a stat lower than X check
  10. if ARGS[2] < ARGS[1]:
  11. if ARGS[0] < ARGS[1]:
  12. !if the difference between the current stat value and the border value is really big, your stat closes tha gap in increased tempo
  13. if ARGS[0]-ARGS[2] > 30:
  14. ARGS[0] -= 3
  15. elseif ARGS[0]-ARGS[2] > 20:
  16. ARGS[0] -= 2
  17. elseif ARGS[0]-ARGS[2] > 10:
  18. ARGS[0] -= 1
  19. elseif ARGS[0]-ARGS[2] > 0 and rand(0,2) = 0:
  20. ARGS[0] -= 1
  21. end
  22. RESULT = ARGS[0]
  23. else
  24. RESULT = -1
  25. end
  26. !If it is a stat higher than X check
  27. elseif ARGS[2] > ARGS[1]:
  28. if ARGS[0] > ARGS[1]:
  29. !if the difference between the current stat value and the border value is really big, your stat closes tha gap in increased tempo
  30. if ARGS[2]-ARGS[0] > 30:
  31. ARGS[0] += 3
  32. elseif ARGS[2]-ARGS[0] > 20:
  33. ARGS[0] += 2
  34. elseif ARGS[2]-ARGS[0] > 10:
  35. ARGS[0] += 1
  36. elseif ARGS[2]-ARGS[0] > 0 and rand(0,2) = 0:
  37. ARGS[0] += 1
  38. end
  39. RESULT = ARGS[0]
  40. else
  41. RESULT = -1
  42. end
  43. else
  44. cls & '<b><font color="red">BAD ARGUMENT CHECK IN <i>$statcheck</i>, VALUE CANNOT BE 0!</font></b>'
  45. end
  46. --- $statcheck ---------------------------------