1
0
mirror of https://gitlab.com/Deukhoofd/BattleSim.git synced 2025-10-27 18:00:03 +00:00
This commit is contained in:
Deukhoofd
2016-02-27 18:24:26 +01:00
parent 9d2b1d0c32
commit 1fc7b2ecbf
4 changed files with 54 additions and 7 deletions

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()