_difficulty.qsrc 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. !! following function returns the basic adjustment for max_grades.
  48. !! hardcore: (115 * pcs_intel)/100
  49. !! realistic: 133
  50. !! relaxed: 155
  51. !! easy peasy: 185
  52. !! use func('_difficulty','getmaxgrades')
  53. if $ARGS[0] = 'getmaxgrades':
  54. if difficulty = 1 : max_grades = (pcs_intel * 185) / 100
  55. if difficulty = 2 : max_grades = (pcs_intel * 155) / 100
  56. if difficulty = 3 : max_grades = (pcs_intel * 133) / 100
  57. if difficulty = 4 : max_grades = (pcs_intel * 115) / 100
  58. if max_grades > 100: max_grades = 100
  59. end &! --- getmaxgrades ---
  60. --- _difficulty ---------------------------------