mirror of
https://github.com/kwsch/pk3DS.git
synced 2026-08-23 18:25:33 -05:00
Allow first learned move to be non-stab
only forced if STAB is checked
This commit is contained in:
@@ -20,16 +20,18 @@ public LearnsetRandomizer(GameConfig config, Learnset[] sets)
|
||||
Config = config;
|
||||
moverand = new MoveRandomizer(config);
|
||||
Learnsets = sets;
|
||||
rSTABPercent = 52.3m;
|
||||
}
|
||||
|
||||
public bool Expand = true;
|
||||
public int ExpandTo = 25;
|
||||
public bool Spread = true;
|
||||
public int SpreadTo = 75;
|
||||
public bool STABFirst = true;
|
||||
|
||||
public bool STAB { set => moverand.rSTAB = value; }
|
||||
public int[] BannedMoves { set => moverand.BannedMoves = value; }
|
||||
public decimal rSTABPercent = 52.3m;
|
||||
public decimal rSTABPercent { set => moverand.rSTABPercent = value; }
|
||||
|
||||
public void Execute()
|
||||
{
|
||||
@@ -72,12 +74,11 @@ private int[] GetRandomLevels(Learnset set, int count)
|
||||
private int[] GetRandomMoves(int count, int index)
|
||||
{
|
||||
count = Expand ? ExpandTo : count;
|
||||
moverand.rSTABPercent = rSTABPercent;
|
||||
|
||||
int[] moves = new int[count];
|
||||
if (count == 0)
|
||||
return moves;
|
||||
moves[0] = moverand.GetRandomFirstMove(index);
|
||||
moves[0] = STABFirst ? moverand.GetRandomFirstMove(index) : moverand.GetRandomFirstMoveAny();
|
||||
moverand.GetRandomLearnset(index, count - 1).CopyTo(moves, 1);
|
||||
return moves;
|
||||
}
|
||||
|
||||
@@ -145,6 +145,7 @@ private void B_RandAll_Click(object sender, EventArgs e)
|
||||
SpreadTo = (int)NUD_Level.Value,
|
||||
STAB = CHK_STAB.Checked,
|
||||
rSTABPercent = NUD_STAB.Value,
|
||||
STABFirst = CHK_STAB.Checked,
|
||||
BannedMoves = banned.ToArray()
|
||||
};
|
||||
rand.Execute();
|
||||
|
||||
@@ -140,6 +140,7 @@ private void B_RandAll_Click(object sender, EventArgs e)
|
||||
SpreadTo = (int) NUD_Level.Value,
|
||||
STAB = CHK_STAB.Checked,
|
||||
rSTABPercent = NUD_STAB.Value,
|
||||
STABFirst = CHK_STAB.Checked,
|
||||
BannedMoves = new[] { 165, 621, 464 }.Concat(Legal.Z_Moves).ToArray(), // Struggle, Hyperspace Fury, Dark Void
|
||||
};
|
||||
rand.Execute();
|
||||
|
||||
Reference in New Issue
Block a user