diff --git a/src/js/utilJS.js b/src/js/utilJS.js index 38ff41e3ce1ffd6e1666cf804aaa2ab9e466fef3..9a3386042faceb86b1e88084db40440a42d6f3ff 100644 --- a/src/js/utilJS.js +++ b/src/js/utilJS.js @@ -2879,34 +2879,6 @@ window.resyncSlaveToAge = function(slave) { slave.career = randomCareer(slave); }; -/** - * @param {string} input - * @param {number} [increase=1] - * @returns {string} - */ -window.IncreasePCSkills = function(input, increase = 1) { - const player = State.variables.PC; - const oldSkill = player.skill[input]; - player.skill[input] += increase; - if (oldSkill <= 10) { - if (player.skill[input] >= 10) { - return `<span class="green"> <br>You have gained basic knowledge in ${input}.</span>`; - } - } else if (oldSkill <= 30) { - if (player.skill[input] >= 30) { - return `<span class="green"> <br>You have gained some knowledge in ${input}.</span>`; - } - } else if (oldSkill <= 60) { - if (player.skill[input] >= 60) { - return `<span class="green"> <br>You have become an expert in ${input}.</span>`; - } - } else if (oldSkill < 100) { - if (player.skill[input] >= 100) { - return `<span class="green"> <br>You have mastered ${input}.</span>`; - } - } -}; - /** * @param {string} raceName * @returns {string} diff --git a/src/player/js/playerJS.js b/src/player/js/playerJS.js index f6791de45121185ea1e9833a23f1afd5b0c996f4..494c16b95e70fa4e98e4e26792a4f8b72c8fbf57 100644 --- a/src/player/js/playerJS.js +++ b/src/player/js/playerJS.js @@ -624,3 +624,31 @@ window.PCTitle = function PCTitle() { V.PCTitle += titles.join(", "); } }; + +/** + * @param {string} input + * @param {number} [increase=1] + * @returns {string} + */ +window.IncreasePCSkills = function(input, increase = 1) { + const player = State.variables.PC; + const oldSkill = player.skill[input]; + player.skill[input] += increase; + if (oldSkill <= 10) { + if (player.skill[input] >= 10) { + return `<span class="green"> <br>You have gained basic knowledge in ${input}.</span>`; + } + } else if (oldSkill <= 30) { + if (player.skill[input] >= 30) { + return `<span class="green"> <br>You have gained some knowledge in ${input}.</span>`; + } + } else if (oldSkill <= 60) { + if (player.skill[input] >= 60) { + return `<span class="green"> <br>You have become an expert in ${input}.</span>`; + } + } else if (oldSkill < 100) { + if (player.skill[input] >= 100) { + return `<span class="green"> <br>You have mastered ${input}.</span>`; + } + } +};