_difficulty.qsrc 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. # _difficulty
  2. if difficulty = 0:
  3. difficulty = 3
  4. end
  5. if $ARGS[0] = 'setdifficulty':
  6. difficulty = 3
  7. if $ARGS[1] = 'easy peasy': difficulty = 1
  8. if $ARGS[1] = 'relaxed': difficulty = 2
  9. if $ARGS[1] = 'hardcore': difficulty = 4
  10. end
  11. !! following function returns the current difficulty
  12. if $ARGS[0] = 'getdifficulty':
  13. $result = 'realistic'
  14. if difficulty = 1: $result = 'easy peasy'
  15. if difficulty = 2: $result = 'relaxed'
  16. if difficulty = 4: $result = 'hardcore'
  17. end &! --- getdifficulty ---
  18. !! following function returns the basic adjustment for stat gain via exp.
  19. !! hardcore: 80
  20. !! realistic: 60
  21. !! relaxed: 40
  22. !! easy peasy: 20
  23. !! use func('_difficulty','getexpadj')
  24. if $ARGS[0] = 'getexpadj':
  25. result = 20 * difficulty
  26. end &! --- getexpadj ---
  27. !! following function adjusts money gain by difficulty.
  28. !! use func('_difficulty','addmoney', x) with x being the base amount (for 'realistic' difficulty)
  29. if $ARGS[0] = 'addmoney':
  30. money += (ARGS[1] * (5-difficulty)) / 2
  31. end &! --- addmoney ---
  32. !! following function returns the adjusted money added (e.g. for displaying the correct amount of money earnt in texts)
  33. !! use func('_difficulty','addmoneystring', x) with x being the base amount (for 'realistic' difficulty)
  34. if $ARGS[0] = 'addmoneystring':
  35. result = (ARGS[1] * (5-difficulty)) / 2
  36. end &! --- addmoneystring ---
  37. !! following function adjusts money spent by difficulty.
  38. !! use func('_difficulty','spendmoney', x) with x being the base amount (for 'realistic' difficulty)
  39. if $ARGS[0] = 'spendmoney':
  40. money -= (ARGS[1] * (difficulty + 1)) / 4
  41. end &! --- spendmoney ---
  42. !! following function returns the adjusted money spent (e.g. for displaying the correct price in shops)
  43. !! use func('_difficulty','spendmoneystring', x) with x being the base amount (for 'realistic' difficulty)
  44. if $ARGS[0] = 'spendmoneystring':
  45. result = (ARGS[1] * (difficulty + 1)) / 4
  46. end &! --- spendmoneystring ---
  47. --- _difficulty ---------------------------------