Allow first learned move to be non-stab

only forced if STAB is checked
This commit is contained in:
Kurt
2017-09-22 19:59:28 -07:00
parent 3dcfd6a3f4
commit 4399a4f4b4
3 changed files with 6 additions and 3 deletions

View File

@@ -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;
}

View File

@@ -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();

View File

@@ -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();