Rework call for high powered moves

learn is a bit more complex; just add an overload with another param
This commit is contained in:
Kurt 2018-11-30 18:17:59 -08:00
parent 5676115f9b
commit f77454d3d4
2 changed files with 10 additions and 7 deletions

View File

@ -131,12 +131,7 @@ private int[] GetRandomMoves(int count, int index)
return moves;
}
public int[] GetHighPoweredMoves(int species, int form, int count = 4)
{
int index = Personal.GetFormeIndex(species, form);
var learn = Learnsets[index];
return learn.GetHighPoweredMoves(count, Moves);
}
internal int[] GetHighPoweredMoves(int species, int form, int count = 4) => GetHighPoweredMoves(Moves, species, form, count);
public int[] GetCurrentMoves(int species, int form, int level, int count = 4)
{
@ -145,5 +140,12 @@ public int[] GetCurrentMoves(int species, int form, int level, int count = 4)
Array.Resize(ref moves, count);
return moves;
}
public int[] GetHighPoweredMoves(Move[] movedata, int species, int form, int count = 4)
{
int index = Personal.GetFormeIndex(species, form);
var learn = Learnsets[index];
return learn.GetHighPoweredMoves(count, movedata);
}
}
}

View File

@ -499,7 +499,8 @@ private void B_HighAttack_Click(object sender, EventArgs e)
pkm.Species = CB_Species.SelectedIndex;
pkm.Level = (int)NUD_Level.Value;
pkm.Form = CB_Forme.SelectedIndex;
var moves = learn.GetHighPoweredMoves(pkm.Species, pkm.Form, 4);
var movedata = Game.Data.MoveData.LoadAll();
var moves = learn.GetHighPoweredMoves(movedata, pkm.Species, pkm.Form, 4);
SetMoves(moves);
}