From 46c38698c73402cc12d9e99279c6ccc38b8ca22f Mon Sep 17 00:00:00 2001 From: Kurt Date: Sun, 15 Oct 2017 14:02:58 -0700 Subject: [PATCH] Shuffle learnset STAB with others closes #217 --- pk3DS.Core/Randomizers/LearnsetRandomizer.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pk3DS.Core/Randomizers/LearnsetRandomizer.cs b/pk3DS.Core/Randomizers/LearnsetRandomizer.cs index 92fd3ff..7e59ae1 100644 --- a/pk3DS.Core/Randomizers/LearnsetRandomizer.cs +++ b/pk3DS.Core/Randomizers/LearnsetRandomizer.cs @@ -85,7 +85,11 @@ private int[] GetRandomMoves(int count, int index) if (count == 0) return moves; moves[0] = STABFirst ? moverand.GetRandomFirstMove(index) : moverand.GetRandomFirstMoveAny(); - moverand.GetRandomLearnset(index, count - 1).CopyTo(moves, 1); + var rand = moverand.GetRandomLearnset(index, count - 1); + + // STAB Moves (if requested) come first; randomize the order of moves + Util.Shuffle(rand); + rand.CopyTo(moves, 1); return moves; }