This commit is contained in:
Deukhoofd committed 2016-02-27 18:24:26 +01:00
1 parent 9d2b1d0c32
commit 1fc7b2ecbf
4 files changed
+54 -7

No files matched your search

+19
View File
@@ -58,6 +58,7 @@ getGenerationFromInt = (generationInteger) ->
loopLearnsets = (Generations, pokemon, forGeneration, iterator) ->
minimumGeneration = getMinimumGeneration(forGeneration)
{species, forme, ability} = pokemon
origspecies = species
formeName = forme || "default"
# Find pre-evolutions and formes
thePokemon = []
@@ -100,6 +101,17 @@ loopLearnsets = (Generations, pokemon, forGeneration, iterator) ->
return true if iterator(learnset, species, formeName, generation) == true
return false
eeveelutions = [
'Vaporeon'
'Jolteon'
'Flareon'
'Espeon'
'Umbreon'
'Leafeon'
'Glaceon'
'Sylveon'
]
# Returns an array of moves that this Pokemon can learn for a given generation.
self.learnableMoves = (Generations, pokemon, forGeneration) ->
learnable = []
@@ -121,6 +133,13 @@ self.learnableMoves = (Generations, pokemon, forGeneration) ->
for moveName of Generations[getGenerationFromInt(forGeneration)].MoveData
if moveName not in unsketchableMoves
learnable.push(moveName)
if pokemon.species in eeveelutions and forGeneration is 7
remindex = -1
for ele, index in learnable
if "Hydro Pump" in ele and "Flare Blitz" in ele and "Psychic" in ele and pokemon.species != 'Eevee'
remindex = index
learnable.splice(remindex, 1)
console.log(learnable)
_.chain(learnable).flatten().sort().unique().value()