mirror of
https://github.com/kwsch/pk3DS.git
synced 2026-04-26 00:28:31 -05:00
prevent fixed damage from learnset source
weed out fixed damage moves from learnset provided arrays can result in duplicate terrible moves but whatever closes #214
This commit is contained in:
parent
c99cb4d202
commit
5c452b8b6b
|
|
@ -32,7 +32,11 @@ public LearnsetRandomizer(GameConfig config, Learnset[] sets)
|
|||
public bool Learn4Level1 = false;
|
||||
|
||||
public bool STAB { set => moverand.rSTAB = value; }
|
||||
public IList<int> BannedMoves { set => moverand.BannedMoves = value; }
|
||||
public IList<int> BannedMoves
|
||||
{
|
||||
get => moverand.BannedMoves;
|
||||
set => moverand.BannedMoves = value;
|
||||
}
|
||||
public decimal rSTABPercent { set => moverand.rSTABPercent = value; }
|
||||
|
||||
public void Execute()
|
||||
|
|
|
|||
|
|
@ -673,6 +673,22 @@ private void B_Randomize_Click(object sender, EventArgs e)
|
|||
pk.Moves = learn.GetHighPoweredMoves(pk.Species, pk.Form, 4);
|
||||
break;
|
||||
}
|
||||
// sanitize moves
|
||||
if (CB_Moves.SelectedIndex > 1) // learn source
|
||||
{
|
||||
bool update = false;
|
||||
var moves = pk.Moves;
|
||||
for (int m = 0; m < moves.Length; m++)
|
||||
{
|
||||
if (!learn.BannedMoves.Contains(moves[m]))
|
||||
continue;
|
||||
update = true;
|
||||
moves[m] = move.GetRandomFirstMove(pk.Species);
|
||||
}
|
||||
|
||||
if (update)
|
||||
pk.Moves = moves;
|
||||
}
|
||||
}
|
||||
saveData(tr, i);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user