exp_gain.qsrc 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. # exp_gain
  2. !2022/08/07
  3. ! gosub that exp gain is run through to be able to modify exp gain by conditions of the player character
  4. ! use: gs 'exp_gain', 'skill', exp
  5. ! example: gs 'exp_gain', 'photoskl', rand(1,2)
  6. ! example: gs 'exp_gain', $ARGS[2], rand(3,5)
  7. if ARGS[1] > 0:
  8. !! Prevents EXP gain for stren_plus if its 50 or higher and Sveta ISNT using steroids
  9. if $ARGS[0] = 'stren_plus' and stren_plus_lvl >= 50 and drugVars['steroids_dose'] = 0:
  10. exit
  11. end
  12. !! Traits:
  13. !! - New Again
  14. if pcs_traits['new_again'] > 0: ARGS[1] *= 2
  15. !! Stats:
  16. !! - Exhaustion (lack of sleep and stamina)
  17. if pcs_stam <= 0:
  18. if pcs_condition['lack_of_sleep'] >= 20:
  19. ARGS[1] /= 8
  20. elseif pcs_condition['lack_of_sleep'] >= 10:
  21. ARGS[1] /= 4
  22. elseif pcs_condition['lack_of_sleep'] >= 5:
  23. ARGS[1] = ARGS[1] * 3 / 8
  24. elseif pcs_condition['lack_of_sleep'] >= 2:
  25. ARGS[1] = ARGS[1] * 9 / 20
  26. else
  27. ARGS[1] /= 2
  28. end
  29. elseif pcs_stam < stammax / 5:
  30. if pcs_condition['lack_of_sleep'] >= 20:
  31. ARGS[1] = ARGS[1] * 3 / 16
  32. elseif pcs_condition['lack_of_sleep'] >= 10:
  33. ARGS[1] = ARGS[1] * 3 / 8
  34. elseif pcs_condition['lack_of_sleep'] >= 5:
  35. ARGS[1] = ARGS[1] * 9 / 16
  36. elseif pcs_condition['lack_of_sleep'] >= 2 and ARGS[1] > 1:
  37. ARGS[1] = ARGS[1] * 27 / 40
  38. elseif ARGS[1] > 1:
  39. ARGS[1] = ARGS[1] * 3 / 4
  40. end
  41. else
  42. if pcs_condition['lack_of_sleep'] >= 20:
  43. ARGS[1] /= 4
  44. elseif pcs_condition['lack_of_sleep'] >= 10:
  45. ARGS[1] /= 2
  46. elseif pcs_condition['lack_of_sleep'] >= 5:
  47. ARGS[1] = ARGS[1] * 3 / 4
  48. elseif pcs_condition['lack_of_sleep'] >= 2 and ARGS[1] > 1:
  49. ARGS[1] = ARGS[1] * 9 / 10
  50. end
  51. end
  52. !! EXP Assignment
  53. dynamic "<<$ARGS[0]>>_exp += <<ARGS[1]>>"
  54. end
  55. --- exp_gain ---------------------------------