mirror of
https://github.com/kwsch/pkNX.git
synced 2026-10-02 14:16:55 -05:00
check stab move count instead of ignoring setting
thanks @sora10pls
This commit is contained in:
@@ -64,7 +64,7 @@ public int[] GetRandomMoveset(int[] Types, int movecount = 4)
|
||||
|
||||
int[] moves;
|
||||
do { moves = GetRandomMoves(Types, movecount); }
|
||||
while (!IsMovesetMeetingRequirements(moves, movecount) && loopctr++ <= maxLoop);
|
||||
while (!IsMovesetMeetingRequirements(moves, Types, movecount) && loopctr++ <= maxLoop);
|
||||
|
||||
return moves;
|
||||
}
|
||||
@@ -92,11 +92,14 @@ private int GetRandomSTABMove(int[] types)
|
||||
return move;
|
||||
}
|
||||
|
||||
private bool IsMovesetMeetingRequirements(int[] moves, int count)
|
||||
private bool IsMovesetMeetingRequirements(int[] moves, int[] types, int count)
|
||||
{
|
||||
if (Settings.DMG && Settings.DMGCount > moves.Count(move => MoveData[move].Category != 0))
|
||||
return false;
|
||||
|
||||
if (Settings.STAB && Settings.STABCount > moves.Count(move => types.Contains(MoveData[move].Type)))
|
||||
return false;
|
||||
|
||||
if (moves.Any(Settings.BannedMoves.Contains))
|
||||
return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user