Add forcedoubles setting

This commit is contained in:
Kurt 2018-11-23 22:19:38 -08:00
parent 15974cd8d8
commit c554e4a984
2 changed files with 12 additions and 1 deletions

View File

@ -25,9 +25,12 @@ public class TrainerRandSettings
[Category(General), Description("Force special strong battles to have a full team of 6 Pokémon.")]
public bool ForceSpecialTeamCount6 { get; set; } = true;
[Category(General), Description("Force all battles to be a Double Battle with an even (not odd) amount of Pokémon.")]
public bool ForceDoubles { get; set; }
#endregion
#region General
#region Classes
[Category(Classes), Description("Change Trainer Class to another random Trainer Class.")]
public bool RandomTrainerClass { get; set; } = false;

View File

@ -84,6 +84,14 @@ private void SetupTeamCount(VsTrainer tr)
var pinfo = Personal.Table.OrderBy(pk => Math.Abs(avgBST - pk.BST)).First();
int avgSpec = Array.IndexOf(Personal.Table, pinfo);
if (Settings.ForceDoubles && !(special && count % 2 == 1))
{
if (tr.Team.Count % 2 != 0)
tr.Team.Add(GetBlankPKM(avgLevel, avgSpec));
tr.Self.AI |= (int)TrainerAI.Doubles;
tr.Self.Mode = BattleMode.Doubles;
}
if (Settings.ForceSpecialTeamCount6 && special && count == 6)
{
for (int g = tr.Team.Count; g < 6; g++)