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:
Kurt 2017-10-15 21:54:39 -07:00
parent c99cb4d202
commit 5c452b8b6b
2 changed files with 21 additions and 1 deletions

View File

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

View File

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