mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-10-01 21:26:48 -05:00
Improve batch randomization
allow .EncryptionConstant=PID improve .PID=$rand to use random PID method instead of pure rand switch comparisons to match command appearance in richtextbox
This commit is contained in:
@@ -426,17 +426,20 @@ private int getBasePP(int move)
|
||||
public void setShinyPID()
|
||||
{
|
||||
do PID = PKX.getRandomPID(Species, Gender, Version, Nature, AltForm, PID); while (!IsShiny);
|
||||
EncryptionConstant = PID;
|
||||
if (GenNumber < 6)
|
||||
EncryptionConstant = PID;
|
||||
}
|
||||
public void setPIDGender(int gender)
|
||||
{
|
||||
do PID = PKX.getRandomPID(Species, gender, Version, Nature, AltForm, PID); while (IsShiny);
|
||||
EncryptionConstant = PID;
|
||||
if (GenNumber < 6)
|
||||
EncryptionConstant = PID;
|
||||
}
|
||||
public void setPIDNature(int nature)
|
||||
{
|
||||
do PID = PKX.getRandomPID(Species, Gender, Version, nature, AltForm, PID); while (IsShiny);
|
||||
EncryptionConstant = PID;
|
||||
if (GenNumber < 6)
|
||||
EncryptionConstant = PID;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -262,11 +262,15 @@ private static ModifyResult ProcessPKM(PKM PKM, IEnumerable<StringInstruction> F
|
||||
{
|
||||
try
|
||||
{
|
||||
if (cmd.PropertyValue == CONST_RAND && (cmd.PropertyName == "PID" || cmd.PropertyName == "EncryptionConstant"))
|
||||
if (cmd.PropertyName == "EncryptionConstant" && cmd.PropertyValue == CONST_RAND)
|
||||
ReflectUtil.SetValue(PKM, cmd.PropertyName, Util.rnd32().ToString());
|
||||
else if (cmd.PropertyValue == CONST_SHINY && cmd.PropertyName == "PID")
|
||||
else if(cmd.PropertyName == "PID" && cmd.PropertyValue == CONST_RAND)
|
||||
PKM.setPIDGender(PKM.Gender);
|
||||
else if (cmd.PropertyName == "EncryptionConstant" && cmd.PropertyValue == "PID")
|
||||
PKM.EncryptionConstant = PKM.PID;
|
||||
else if (cmd.PropertyName == "PID" && cmd.PropertyValue == CONST_SHINY)
|
||||
PKM.setShinyPID();
|
||||
else if (cmd.PropertyValue == "0" && cmd.PropertyName == "Species")
|
||||
else if (cmd.PropertyName == "Species" && cmd.PropertyValue == "0")
|
||||
PKM.Data = new byte[PKM.Data.Length];
|
||||
else
|
||||
ReflectUtil.SetValue(PKM, cmd.PropertyName, cmd.PropertyValue);
|
||||
|
||||
Reference in New Issue
Block a user