From 1c4c2b358d374e22804c51d294e55c1d55efeabe Mon Sep 17 00:00:00 2001 From: sora10pls Date: Thu, 28 Dec 2017 19:43:14 -0500 Subject: [PATCH] Revise RSTE levelup move get --- pk3DS/Subforms/Gen6/RSTE.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pk3DS/Subforms/Gen6/RSTE.cs b/pk3DS/Subforms/Gen6/RSTE.cs index ea82437..cb13bec 100644 --- a/pk3DS/Subforms/Gen6/RSTE.cs +++ b/pk3DS/Subforms/Gen6/RSTE.cs @@ -15,6 +15,7 @@ namespace pk3DS { public partial class RSTE : Form { + private readonly LearnsetRandomizer learn = new LearnsetRandomizer(Main.Config, Main.Config.Learnsets); public RSTE(byte[][] trc, byte[][] trd, byte[][] trp) { trclass = trc; @@ -630,7 +631,7 @@ private void Randomize() InitializeTrainerTeamInfo(t, rImportant[i] == null); RandomizeTrainerAIClass(t, trClass); RandomizeTrainerPrizeItem(t); - RandomizeTeam(t, move, itemvals, type, mevo, typerand); + RandomizeTeam(t, move, learn, itemvals, type, mevo, typerand); trdata[i] = t.Write(); trpoke[i] = t.WriteTeam(); @@ -639,7 +640,7 @@ private void Randomize() WinFormsUtil.Alert("Randomized all Trainers according to specification!", "Press the Dump to .TXT button to view the new Trainer information!"); } - private static void RandomizeTeam(trdata6 t, MoveRandomizer move, ushort[] itemvals, int type, bool mevo, bool typerand) + private static void RandomizeTeam(trdata6 t, MoveRandomizer move, LearnsetRandomizer learn, ushort[] itemvals, int type, bool mevo, bool typerand) { int last = t.Team.Length - 1; for (int p = 0; p < t.Team.Length; p++) @@ -682,12 +683,22 @@ private static void RandomizeTeam(trdata6 t, MoveRandomizer move, ushort[] itemv else if (rItem) pk.Item = itemvals[rnd32() % itemvals.Length]; + // random if (rMove) { var pkMoves = move.GetRandomMoveset(pk.Species, 4); for (int m = 0; m < 4; m++) pk.Moves[m] = (ushort)pkMoves[m]; } + + // levelup + if (rNoMove) + { + t.Moves = true; + var pkMoves = learn.GetCurrentMoves(pk.Species, pk.Form, pk.Level, 4); + for (int m = 0; m < 4; m++) + pk.Moves[m] = (ushort)pkMoves[m]; + } } } private static void InitializeTrainerTeamInfo(trdata6 t, bool important)