From 4fd8a73c72fb92385489ab4c6fc533aedeffb95a Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Tue, 8 Mar 2016 12:54:26 +0100 Subject: [PATCH] Made pokemon learn all moves regardless of level, apparently people feel really strongly about this --- public/js/app.js | 9 +++++++-- public/js/replays.js | 9 +++++++-- shared/learnsets.coffee | 8 +++++++- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/public/js/app.js b/public/js/app.js index 9ebc600..2ede6df 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -609,7 +609,7 @@ }).call(this); (function() { - var EventPokemon, INT_TO_GENERATION, checkMove, eeveelutions, getGenerationFromInt, getMinimumGeneration, loopLearnsets, mustLearnMove, self, switchableFormes, unportableGenerations, unsketchableMoves, _, _ref, + var EventPokemon, INT_TO_GENERATION, checkMove, eeveelutions, getGenerationFromInt, getMinimumGeneration, levelLimit, loopLearnsets, mustLearnMove, self, switchableFormes, unportableGenerations, unsketchableMoves, _, _ref, __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; self = (typeof module !== "undefined" && module !== null ? module.exports : void 0) || window; @@ -630,6 +630,8 @@ return b - a; }); + levelLimit = false; + switchableFormes = ["Deoxys", "Rotom", "Shaymin"]; unsketchableMoves = ["Chatter", "Hyperspace Hole", "Light of Ruin", "Steam Eruption", "Struggle", "Thousand Arrows", "Thousand Waves"]; @@ -901,7 +903,10 @@ checkMove = function(looper, pokemon, move) { var checksOut, level; level = pokemon.level; - level || (level = 120); + level |= 120; + if (levelLimit = false) { + return true; + } checksOut = looper(function(learnset) { var _ref1, _ref2, _ref3, _ref4; if (((_ref1 = learnset["level-up"]) != null ? _ref1[move] : void 0) <= level || ((_ref2 = learnset["machine"]) != null ? _ref2[move] : void 0) <= level || ((_ref3 = learnset["tutor"]) != null ? _ref3[move] : void 0) <= level) { diff --git a/public/js/replays.js b/public/js/replays.js index 1d4c7f0..5263c12 100644 --- a/public/js/replays.js +++ b/public/js/replays.js @@ -609,7 +609,7 @@ }).call(this); (function() { - var EventPokemon, INT_TO_GENERATION, checkMove, eeveelutions, getGenerationFromInt, getMinimumGeneration, loopLearnsets, mustLearnMove, self, switchableFormes, unportableGenerations, unsketchableMoves, _, _ref, + var EventPokemon, INT_TO_GENERATION, checkMove, eeveelutions, getGenerationFromInt, getMinimumGeneration, levelLimit, loopLearnsets, mustLearnMove, self, switchableFormes, unportableGenerations, unsketchableMoves, _, _ref, __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; self = (typeof module !== "undefined" && module !== null ? module.exports : void 0) || window; @@ -630,6 +630,8 @@ return b - a; }); + levelLimit = false; + switchableFormes = ["Deoxys", "Rotom", "Shaymin"]; unsketchableMoves = ["Chatter", "Hyperspace Hole", "Light of Ruin", "Steam Eruption", "Struggle", "Thousand Arrows", "Thousand Waves"]; @@ -901,7 +903,10 @@ checkMove = function(looper, pokemon, move) { var checksOut, level; level = pokemon.level; - level || (level = 120); + level |= 120; + if (levelLimit = false) { + return true; + } checksOut = looper(function(learnset) { var _ref1, _ref2, _ref3, _ref4; if (((_ref1 = learnset["level-up"]) != null ? _ref1[move] : void 0) <= level || ((_ref2 = learnset["machine"]) != null ? _ref2[move] : void 0) <= level || ((_ref3 = learnset["tutor"]) != null ? _ref3[move] : void 0) <= level) { diff --git a/shared/learnsets.coffee b/shared/learnsets.coffee index c076318..58c0704 100644 --- a/shared/learnsets.coffee +++ b/shared/learnsets.coffee @@ -12,6 +12,9 @@ else unportableGenerations = [ 1, 3 ] unportableGenerations.sort((a, b) -> b - a) # numeric, descending +#Setting this to false allows Pokemon to get all moves, regardless of level +levelLimit = false + switchableFormes = [ "Deoxys" "Rotom" @@ -224,7 +227,10 @@ self.checkMoveset = (Generations, pokemon, generation, moves) -> # tutors, machines, Sketch, or pre-evolutions. checkMove = (looper, pokemon, move) -> {level} = pokemon - level ||= 120 + level |= 120 + + if levelLimit = false + return true checksOut = looper (learnset) -> # Check level-up, TM/HM, and tutors.