_difficulty.qsrc 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. !!Trait ''Everything is new again'', gained from the cursed school boy start
  26. if csb_start = 1 and daystart <= 84: result = 30 * difficulty
  27. if csb_start = 0: result = 20 * difficulty
  28. end &! --- getexpadj ---
  29. !! following function adjusts money gain by difficulty.
  30. !! use func('_difficulty','addmoney', x) with x being the base amount (for 'realistic' difficulty)
  31. if $ARGS[0] = 'addmoney':
  32. money += (ARGS[1] * (5-difficulty)) / 2
  33. end &! --- addmoney ---
  34. !! following function returns the adjusted money added (e.g. for displaying the correct amount of money earnt in texts)
  35. !! use func('_difficulty','addmoneystring', x) with x being the base amount (for 'realistic' difficulty)
  36. if $ARGS[0] = 'addmoneystring':
  37. result = (ARGS[1] * (5-difficulty)) / 2
  38. end &! --- addmoneystring ---
  39. !! following function adjusts money spent by difficulty.
  40. !! use func('_difficulty','spendmoney', x) with x being the base amount (for 'realistic' difficulty)
  41. if $ARGS[0] = 'spendmoney':
  42. money -= (ARGS[1] * (difficulty + 1)) / 4
  43. end &! --- spendmoney ---
  44. !! following function returns the adjusted money spent (e.g. for displaying the correct price in shops)
  45. !! use func('_difficulty','spendmoneystring', x) with x being the base amount (for 'realistic' difficulty)
  46. if $ARGS[0] = 'spendmoneystring':
  47. result = (ARGS[1] * (difficulty + 1)) / 4
  48. end &! --- spendmoneystring ---
  49. --- _difficulty ---------------------------------