# _difficulty if difficulty = 0: difficulty = 3 end if $ARGS[0] = 'setdifficulty': difficulty = 3 if $ARGS[1] = 'easy peasy': difficulty = 1 if $ARGS[1] = 'relaxed': difficulty = 2 if $ARGS[1] = 'hardcore': difficulty = 4 end !! following function returns the current difficulty if $ARGS[0] = 'getdifficulty': $result = 'realistic' if difficulty = 1: $result = 'easy peasy' if difficulty = 2: $result = 'relaxed' if difficulty = 4: $result = 'hardcore' end &! --- getdifficulty --- !! following function returns the basic adjustment for stat gain via exp. !! hardcore: 80 !! realistic: 60 !! relaxed: 40 !! easy peasy: 20 !! use func('_difficulty','getexpadj') if $ARGS[0] = 'getexpadj': result = 20 * difficulty end &! --- getexpadj --- !! following function adjusts money gain by difficulty. !! use func('_difficulty','addmoney', x) with x being the base amount (for 'realistic' difficulty) if $ARGS[0] = 'addmoney': money += (ARGS[1] * (5-difficulty)) / 2 end &! --- addmoney --- !! following function returns the adjusted money added (e.g. for displaying the correct amount of money earnt in texts) !! use func('_difficulty','addmoneystring', x) with x being the base amount (for 'realistic' difficulty) if $ARGS[0] = 'addmoneystring': result = (ARGS[1] * (5-difficulty)) / 2 end &! --- addmoneystring --- !! following function adjusts money spent by difficulty. !! use func('_difficulty','spendmoney', x) with x being the base amount (for 'realistic' difficulty) if $ARGS[0] = 'spendmoney': money -= (ARGS[1] * (difficulty + 1)) / 4 end &! --- spendmoney --- !! following function returns the adjusted money spent (e.g. for displaying the correct price in shops) !! use func('_difficulty','spendmoneystring', x) with x being the base amount (for 'realistic' difficulty) if $ARGS[0] = 'spendmoneystring': result = (ARGS[1] * (difficulty + 1)) / 4 end &! --- spendmoneystring --- !! following function returns the basic adjustment for max_grades. !! hardcore: (115 * pcs_intel)/100 !! realistic: 133 !! relaxed: 155 !! easy peasy: 185 !! use func('_difficulty','getmaxgrades') if $ARGS[0] = 'getmaxgrades': if difficulty = 1 : max_grades = (pcs_intel * 185) / 100 if difficulty = 2 : max_grades = (pcs_intel * 155) / 100 if difficulty = 3 : max_grades = (pcs_intel * 133) / 100 if difficulty = 4 : max_grades = (pcs_intel * 115) / 100 if max_grades > 100: max_grades = 100 end &! --- getmaxgrades --- --- _difficulty ---------------------------------