_difficulty.qsrc 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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:
  27. result = 10 * difficulty
  28. else
  29. result = 20 * difficulty
  30. end
  31. end &! --- getexpadj ---
  32. !! following function adjusts money gain by difficulty.
  33. !! use func('_difficulty','addmoney', x) with x being the base amount (for 'realistic' difficulty)
  34. if $ARGS[0] = 'addmoney':
  35. money += (ARGS[1] * (5-difficulty)) / 2
  36. end &! --- addmoney ---
  37. !! following function returns the adjusted money added (e.g. for displaying the correct amount of money earnt in texts)
  38. !! use func('_difficulty','addmoneystring', x) with x being the base amount (for 'realistic' difficulty)
  39. if $ARGS[0] = 'addmoneystring':
  40. result = (ARGS[1] * (5-difficulty)) / 2
  41. end &! --- addmoneystring ---
  42. !! following function adjusts money spent by difficulty.
  43. !! use func('_difficulty','spendmoney', x) with x being the base amount (for 'realistic' difficulty)
  44. if $ARGS[0] = 'spendmoney':
  45. money -= (ARGS[1] * (difficulty + 1)) / 4
  46. end &! --- spendmoney ---
  47. !! following function returns the adjusted money spent (e.g. for displaying the correct price in shops)
  48. !! use func('_difficulty','spendmoneystring', x) with x being the base amount (for 'realistic' difficulty)
  49. if $ARGS[0] = 'spendmoneystring':
  50. result = (ARGS[1] * (difficulty + 1)) / 4
  51. end &! --- spendmoneystring ---
  52. !! following function returns the basic adjustment for max_grades.
  53. !! hardcore: (115 * pcs_intel)/100
  54. !! realistic: 133
  55. !! relaxed: 155
  56. !! easy peasy: 185
  57. !! use func('_difficulty','getmaxgrades')
  58. if $ARGS[0] = 'getmaxgrades':
  59. if difficulty = 1 : max_grades = (pcs_intel * 185) / 100
  60. if difficulty = 2 : max_grades = (pcs_intel * 155) / 100
  61. if difficulty = 3 : max_grades = (pcs_intel * 133) / 100
  62. if difficulty = 4 : max_grades = (pcs_intel * 115) / 100
  63. if max_grades > 100: max_grades = 100
  64. end &! --- getexpadj ---
  65. --- _difficulty ---------------------------------