mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-27 06:20:25 +00:00
Merge branch 'master' of https://github.com/kwsch/PKHeX
# Conflicts: # PKHeX/Saves/SaveUtil.cs
This commit is contained in:
commit
3eedb7ffa7
23 changed files with 1601 additions and 271 deletions
37
PKHeX/MainWindow/Main.Designer.cs
generated
37
PKHeX/MainWindow/Main.Designer.cs
generated
|
@ -427,6 +427,8 @@
|
|||
this.mnuLSave = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.PB_Legal = new System.Windows.Forms.PictureBox();
|
||||
this.L_UpdateAvailable = new System.Windows.Forms.LinkLabel();
|
||||
this.L_SaveSlot = new System.Windows.Forms.Label();
|
||||
this.CB_SaveSlot = new System.Windows.Forms.ComboBox();
|
||||
this.tabMain.SuspendLayout();
|
||||
this.Tab_Main.SuspendLayout();
|
||||
this.FLP_Main.SuspendLayout();
|
||||
|
@ -3543,7 +3545,7 @@
|
|||
this.Menu_Open.Name = "Menu_Open";
|
||||
this.Menu_Open.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O)));
|
||||
this.Menu_Open.ShowShortcutKeys = false;
|
||||
this.Menu_Open.Size = new System.Drawing.Size(139, 22);
|
||||
this.Menu_Open.Size = new System.Drawing.Size(152, 22);
|
||||
this.Menu_Open.Text = "&Open...";
|
||||
this.Menu_Open.Click += new System.EventHandler(this.mainMenuOpen);
|
||||
//
|
||||
|
@ -3553,7 +3555,7 @@
|
|||
this.Menu_Save.Name = "Menu_Save";
|
||||
this.Menu_Save.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S)));
|
||||
this.Menu_Save.ShowShortcutKeys = false;
|
||||
this.Menu_Save.Size = new System.Drawing.Size(139, 22);
|
||||
this.Menu_Save.Size = new System.Drawing.Size(152, 22);
|
||||
this.Menu_Save.Text = "&Save PK6...";
|
||||
this.Menu_Save.Click += new System.EventHandler(this.mainMenuSave);
|
||||
//
|
||||
|
@ -3565,7 +3567,7 @@
|
|||
this.Menu_ExportSAV.Enabled = false;
|
||||
this.Menu_ExportSAV.Image = global::PKHeX.Properties.Resources.saveSAV;
|
||||
this.Menu_ExportSAV.Name = "Menu_ExportSAV";
|
||||
this.Menu_ExportSAV.Size = new System.Drawing.Size(139, 22);
|
||||
this.Menu_ExportSAV.Size = new System.Drawing.Size(152, 22);
|
||||
this.Menu_ExportSAV.Text = "&Export SAV...";
|
||||
//
|
||||
// Menu_ExportMAIN
|
||||
|
@ -3574,7 +3576,7 @@
|
|||
this.Menu_ExportMAIN.Name = "Menu_ExportMAIN";
|
||||
this.Menu_ExportMAIN.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.E)));
|
||||
this.Menu_ExportMAIN.ShowShortcutKeys = false;
|
||||
this.Menu_ExportMAIN.Size = new System.Drawing.Size(142, 22);
|
||||
this.Menu_ExportMAIN.Size = new System.Drawing.Size(152, 22);
|
||||
this.Menu_ExportMAIN.Text = "&Export main";
|
||||
this.Menu_ExportMAIN.Click += new System.EventHandler(this.clickExportSAV);
|
||||
//
|
||||
|
@ -3584,7 +3586,7 @@
|
|||
this.Menu_ExportBAK.Name = "Menu_ExportBAK";
|
||||
this.Menu_ExportBAK.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.B)));
|
||||
this.Menu_ExportBAK.ShowShortcutKeys = false;
|
||||
this.Menu_ExportBAK.Size = new System.Drawing.Size(142, 22);
|
||||
this.Menu_ExportBAK.Size = new System.Drawing.Size(152, 22);
|
||||
this.Menu_ExportBAK.Text = "Export &Backup";
|
||||
this.Menu_ExportBAK.Click += new System.EventHandler(this.clickExportSAVBAK);
|
||||
//
|
||||
|
@ -3594,7 +3596,7 @@
|
|||
this.Menu_Exit.Name = "Menu_Exit";
|
||||
this.Menu_Exit.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Q)));
|
||||
this.Menu_Exit.ShowShortcutKeys = false;
|
||||
this.Menu_Exit.Size = new System.Drawing.Size(139, 22);
|
||||
this.Menu_Exit.Size = new System.Drawing.Size(152, 22);
|
||||
this.Menu_Exit.Text = "&Quit";
|
||||
this.Menu_Exit.Click += new System.EventHandler(this.mainMenuExit);
|
||||
//
|
||||
|
@ -5101,6 +5103,8 @@
|
|||
//
|
||||
// Tab_SAV
|
||||
//
|
||||
this.Tab_SAV.Controls.Add(this.CB_SaveSlot);
|
||||
this.Tab_SAV.Controls.Add(this.L_SaveSlot);
|
||||
this.Tab_SAV.Controls.Add(this.L_Secure2);
|
||||
this.Tab_SAV.Controls.Add(this.TB_Secure2);
|
||||
this.Tab_SAV.Controls.Add(this.L_Secure1);
|
||||
|
@ -5478,6 +5482,25 @@
|
|||
this.L_UpdateAvailable.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
this.L_UpdateAvailable.Visible = false;
|
||||
//
|
||||
// L_SaveSlot
|
||||
//
|
||||
this.L_SaveSlot.AutoSize = true;
|
||||
this.L_SaveSlot.Location = new System.Drawing.Point(92, 151);
|
||||
this.L_SaveSlot.Name = "L_SaveSlot";
|
||||
this.L_SaveSlot.Size = new System.Drawing.Size(56, 13);
|
||||
this.L_SaveSlot.TabIndex = 19;
|
||||
this.L_SaveSlot.Text = "Save Slot:";
|
||||
//
|
||||
// CB_SaveSlot
|
||||
//
|
||||
this.CB_SaveSlot.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.CB_SaveSlot.FormattingEnabled = true;
|
||||
this.CB_SaveSlot.Location = new System.Drawing.Point(150, 148);
|
||||
this.CB_SaveSlot.Name = "CB_SaveSlot";
|
||||
this.CB_SaveSlot.Size = new System.Drawing.Size(121, 21);
|
||||
this.CB_SaveSlot.TabIndex = 20;
|
||||
this.CB_SaveSlot.SelectedValueChanged += new System.EventHandler(this.updateSaveSlot);
|
||||
//
|
||||
// Main
|
||||
//
|
||||
this.AllowDrop = true;
|
||||
|
@ -6099,6 +6122,8 @@
|
|||
private System.Windows.Forms.MaskedTextBox TB_Tough;
|
||||
private System.Windows.Forms.MaskedTextBox TB_Sheen;
|
||||
private System.Windows.Forms.Label Label_IVs;
|
||||
private System.Windows.Forms.ComboBox CB_SaveSlot;
|
||||
private System.Windows.Forms.Label L_SaveSlot;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -455,7 +455,7 @@ namespace PKHeX
|
|||
// Set Form
|
||||
string[] formStrings = PKX.getFormList(Set.Species,
|
||||
Util.getStringList("types", "en"),
|
||||
Util.getStringList("forms", "en"), gendersymbols);
|
||||
Util.getStringList("forms", "en"), gendersymbols, SAV.Generation);
|
||||
int form = 0;
|
||||
for (int i = 0; i < formStrings.Length; i++)
|
||||
if (formStrings[i].Contains(Set.Form ?? ""))
|
||||
|
@ -589,7 +589,7 @@ namespace PKHeX
|
|||
|
||||
string ext = Path.GetExtension(path);
|
||||
FileInfo fi = new FileInfo(path);
|
||||
if (fi.Length > 0x10009C)
|
||||
if (fi.Length > 0x10009C && fi.Length != 0x380000)
|
||||
Util.Error("Input file is too large.", path);
|
||||
else
|
||||
{
|
||||
|
@ -642,7 +642,7 @@ namespace PKHeX
|
|||
}
|
||||
else if ((temp = PKMConverter.getPKMfromBytes(input)) != null)
|
||||
{
|
||||
PKM pk = PKMConverter.convertToFormat(temp, SAV.Generation, out c);
|
||||
PKM pk = PKMConverter.convertToFormat(temp, SAV.PKMType, out c);
|
||||
if (pk == null)
|
||||
Util.Alert("Conversion failed.", c);
|
||||
else if (SAV.Generation == 1 && ((PK1) pk).Japanese != SAV.GetJapanese)
|
||||
|
@ -702,7 +702,7 @@ namespace PKHeX
|
|||
B_OpenWondercards_Click(tg, null);
|
||||
return;
|
||||
}
|
||||
PKM pk = PKMConverter.convertToFormat(temp, SAV.Generation, out c);
|
||||
PKM pk = PKMConverter.convertToFormat(temp, SAV.PKMType, out c);
|
||||
if (pk == null)
|
||||
Util.Alert("Conversion failed.", c);
|
||||
else
|
||||
|
@ -803,9 +803,9 @@ namespace PKHeX
|
|||
}
|
||||
private void loadSAV(SaveFile sav, string path)
|
||||
{
|
||||
PKM pk = preparePKM();
|
||||
// clean fields
|
||||
populateFields(SAV.BlankPKM);
|
||||
PKM pk = preparePKM();
|
||||
SAV = sav;
|
||||
|
||||
if (path != null) // Actual save file
|
||||
|
@ -954,6 +954,21 @@ namespace PKHeX
|
|||
if (SAV.Generation == 1)
|
||||
Label_IsShiny.Visible = false;
|
||||
|
||||
if (SAV.Version == GameVersion.BATREV)
|
||||
{
|
||||
L_SaveSlot.Visible = CB_SaveSlot.Visible = true;
|
||||
CB_SaveSlot.Items.Clear();
|
||||
CB_SaveSlot.DisplayMember = "Text"; CB_SaveSlot.ValueMember = "Value";
|
||||
CB_SaveSlot.DataSource = new BindingSource(((SAV4BR) SAV).SaveSlots.Select(i => new ComboItem
|
||||
{
|
||||
Text = ((SAV4BR) SAV).SaveNames[i],
|
||||
Value = i
|
||||
}).ToList(), null);
|
||||
CB_SaveSlot.SelectedValue = ((SAV4BR)SAV).CurrentSlot;
|
||||
}
|
||||
else
|
||||
L_SaveSlot.Visible = CB_SaveSlot.Visible = false;
|
||||
|
||||
// HaX override, needs to be after DEV_Ability enabled assignment.
|
||||
TB_AbilityNumber.Visible = SAV.Generation >= 6 && DEV_Ability.Enabled;
|
||||
|
||||
|
@ -1050,8 +1065,16 @@ namespace PKHeX
|
|||
extraBytes = PK3.ExtraBytes;
|
||||
break;
|
||||
case 4:
|
||||
getFieldsfromPKM = populateFieldsPK4;
|
||||
getPKMfromFields = preparePK4;
|
||||
if (SAV.Version == GameVersion.BATREV)
|
||||
{
|
||||
getFieldsfromPKM = populateFieldsBK4;
|
||||
getPKMfromFields = prepareBK4;
|
||||
}
|
||||
else
|
||||
{
|
||||
getFieldsfromPKM = populateFieldsPK4;
|
||||
getPKMfromFields = preparePK4;
|
||||
}
|
||||
extraBytes = PK4.ExtraBytes;
|
||||
break;
|
||||
case 5:
|
||||
|
@ -1447,7 +1470,7 @@ namespace PKHeX
|
|||
if (pkm.Format != SAV.Generation) // past gen format
|
||||
{
|
||||
string c;
|
||||
pkm = PKMConverter.convertToFormat(pkm, SAV.Generation, out c);
|
||||
pkm = PKMConverter.convertToFormat(pkm, SAV.PKMType, out c);
|
||||
if (pk.Format != pkm.Format && focus) // converted
|
||||
Util.Alert("Converted File.");
|
||||
}
|
||||
|
@ -1518,7 +1541,7 @@ namespace PKHeX
|
|||
if (!hasForms)
|
||||
return;
|
||||
|
||||
CB_Form.DataSource = PKX.getFormList(species, types, forms, gendersymbols).ToList();
|
||||
CB_Form.DataSource = PKX.getFormList(species, types, forms, gendersymbols, SAV.Generation).ToList();
|
||||
}
|
||||
private void setAbilityList()
|
||||
{
|
||||
|
@ -2831,7 +2854,7 @@ namespace PKHeX
|
|||
// Create Temp File to Drag
|
||||
PKM pkx = preparePKM();
|
||||
bool encrypt = ModifierKeys == Keys.Control;
|
||||
string filename = $"{Path.GetFileNameWithoutExtension(pkx.FileName)}{(encrypt ? ".ek" : ".pk") + pkx.Format}";
|
||||
string filename = $"{Path.GetFileNameWithoutExtension(pkx.FileName)}{(encrypt ? ".ek" + pkx.Format : "."+pkx.Extension) }";
|
||||
byte[] dragdata = encrypt ? pkx.EncryptedBoxData : pkx.DecryptedBoxData;
|
||||
// Make file
|
||||
string newfile = Path.Combine(Path.GetTempPath(), Util.CleanFileName(filename));
|
||||
|
@ -3037,7 +3060,6 @@ namespace PKHeX
|
|||
Util.Error($"Slot read error @ slot {slot}.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Load the PKX file
|
||||
PKM pk = 30 <= slot && slot < 36 ? SAV.getPartySlot(offset) : SAV.getStoredSlot(offset);
|
||||
if (pk.Valid && pk.Species != 0)
|
||||
|
@ -3087,6 +3109,16 @@ namespace PKHeX
|
|||
|
||||
updateBoxViewers();
|
||||
}
|
||||
|
||||
private void updateSaveSlot(object sender, EventArgs e)
|
||||
{
|
||||
if (SAV.Version == GameVersion.BATREV)
|
||||
{
|
||||
((SAV4BR) SAV).CurrentSlot = Util.getIndex(CB_SaveSlot);
|
||||
setPKXBoxes();
|
||||
}
|
||||
}
|
||||
|
||||
private void clickDelete(object sender, EventArgs e)
|
||||
{
|
||||
int slot = getSlot(sender);
|
||||
|
@ -3522,7 +3554,7 @@ namespace PKHeX
|
|||
{
|
||||
string c;
|
||||
PKM temp = PKMConverter.getPKMfromBytes(data);
|
||||
PKM pk = PKMConverter.convertToFormat(temp, SAV.Generation, out c);
|
||||
PKM pk = PKMConverter.convertToFormat(temp, SAV.PKMType, out c);
|
||||
|
||||
if (pk != null) // Write to save
|
||||
{
|
||||
|
@ -3871,7 +3903,7 @@ namespace PKHeX
|
|||
PKM temp = mg != null ? mg.convertToPKM(SAV) : PKMConverter.getPKMfromBytes(data);
|
||||
string c;
|
||||
|
||||
PKM pk = PKMConverter.convertToFormat(temp, SAV.Generation, out c);
|
||||
PKM pk = PKMConverter.convertToFormat(temp, SAV.PKMType, out c);
|
||||
if (pk == null)
|
||||
{ Util.Error(c); Console.WriteLine(c); return; }
|
||||
|
||||
|
|
|
@ -120,108 +120,6 @@
|
|||
<metadata name="tabMain.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Label_Species.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="CB_Species.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="TB_Nickname.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Label_EXP.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Label_Nature.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="CB_Nature.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Label_HeldItem.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="CB_HeldItem.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Label_Ability.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Label_Language.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="CB_Language.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="CHK_IsEgg.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="CHK_Infected.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="CHK_Cured.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Label_PKRS.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Label_Country.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="CB_Country.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Label_SubRegion.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="CB_SubRegion.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Label_3DSRegion.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="CB_3DSReg.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="CHK_AsEgg.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="GB_EggConditions.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="BTN_RandomEVs.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="BTN_RandomIVs.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="PB_WarnMove4.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="PB_WarnMove3.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="PB_WarnMove2.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="PB_WarnMove1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="GB_RelearnMoves.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="GB_CurrentMoves.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="TB_EC.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="BTN_RerollEC.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Label_EncryptionConstant.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Label_PID.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
|
@ -281,6 +179,15 @@
|
|||
<metadata name="CB_Species.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Label_Species.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="CB_Species.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="TB_Nickname.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="CHK_Nicknamed.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
|
@ -293,6 +200,9 @@
|
|||
<metadata name="Label_EXP.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Label_EXP.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="TB_EXP.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
|
@ -323,6 +233,18 @@
|
|||
<metadata name="CB_Nature.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Label_Nature.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="CB_Nature.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Label_HeldItem.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="CB_HeldItem.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Label_HeldItem.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
|
@ -368,6 +290,9 @@
|
|||
<metadata name="Label_Ability.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Label_Ability.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="CB_Ability.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
|
@ -392,6 +317,33 @@
|
|||
<metadata name="CB_Language.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Label_Language.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="CB_Language.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="CHK_IsEgg.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="CHK_IsEgg.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="CHK_Infected.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="CHK_Cured.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="CHK_Infected.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="CHK_Cured.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Label_PKRS.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Label_PKRS.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
|
@ -419,6 +371,18 @@
|
|||
<metadata name="CB_Country.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Label_Country.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="CB_Country.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Label_SubRegion.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="CB_SubRegion.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Label_SubRegion.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
|
@ -431,6 +395,18 @@
|
|||
<metadata name="CB_3DSReg.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Label_3DSRegion.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="CB_3DSReg.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="CHK_AsEgg.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="GB_EggConditions.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="CHK_AsEgg.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
|
@ -539,6 +515,12 @@
|
|||
<metadata name="CB_EncounterType.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="BTN_RandomEVs.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="BTN_RandomIVs.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="TB_Sheen.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
|
@ -842,6 +824,24 @@
|
|||
<metadata name="PB_WarnMove4.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="PB_WarnMove3.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="PB_WarnMove2.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="PB_WarnMove1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="GB_RelearnMoves.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="GB_CurrentMoves.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="PB_WarnMove4.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<data name="PB_WarnMove4.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAeZJREFUOE+1
|
||||
|
@ -1104,6 +1104,15 @@
|
|||
<metadata name="TB_EC.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="BTN_RerollEC.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Label_EncryptionConstant.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="TB_EC.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Label_CTGender.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
|
@ -1354,6 +1363,165 @@
|
|||
<metadata name="PAN_Box.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="B_BoxRight.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="B_BoxLeft.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="CB_BoxSelect.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="PAN_BattleBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="L_ReadOnlyPBB.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="L_BattleBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="L_Party.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="PAN_Party.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="GB_Daycare.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="GB_GTS.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="GB_Fused.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="L_ReadOnlyOther.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="GB_SUBE.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="L_Secure2.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="TB_Secure2.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="L_Secure1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="TB_Secure1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="B_JPEG.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="L_GameSync.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="TB_GameSync.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="B_SaveBoxBin.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="B_VerifyCHK.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="PAN_Box.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="bpkx30.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="bpkx29.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="bpkx28.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="bpkx27.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="bpkx26.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="bpkx25.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="bpkx24.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="bpkx23.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="bpkx22.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="bpkx21.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="bpkx20.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="bpkx19.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="bpkx18.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="bpkx17.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="bpkx16.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="bpkx15.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="bpkx14.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="bpkx13.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="bpkx12.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="bpkx11.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="bpkx10.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="bpkx9.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="bpkx8.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="bpkx7.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="bpkx6.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="bpkx5.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="bpkx4.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="bpkx3.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="bpkx2.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="bpkx1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="bpkx30.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
|
@ -1459,63 +1627,6 @@
|
|||
<metadata name="PAN_BattleBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="L_ReadOnlyPBB.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="L_BattleBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="L_Party.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="PAN_Party.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="GB_Daycare.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="GB_GTS.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="GB_Fused.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="L_ReadOnlyOther.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="GB_SUBE.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="L_Secure2.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="TB_Secure2.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="L_Secure1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="TB_Secure1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="B_JPEG.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="L_GameSync.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="TB_GameSync.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="B_SaveBoxBin.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="B_VerifyCHK.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="PAN_BattleBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="PB_Locked.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
|
@ -1834,33 +1945,6 @@
|
|||
<metadata name="subepkx1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="L_Secure2.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="TB_Secure2.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="L_Secure1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="TB_Secure1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="B_JPEG.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="L_GameSync.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="TB_GameSync.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="B_SaveBoxBin.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="B_VerifyCHK.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="GB_SAVtools.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
|
|
|
@ -250,5 +250,253 @@ namespace PKHeX
|
|||
pk4.RefreshChecksum();
|
||||
return pk4;
|
||||
}
|
||||
|
||||
private void populateFieldsBK4()
|
||||
{
|
||||
BK4 pk4 = pkm as BK4;
|
||||
if (pk4 == null)
|
||||
return;
|
||||
|
||||
// Do first
|
||||
pk4.Stat_Level = PKX.getLevel(pk4.Species, pk4.EXP);
|
||||
if (pk4.Stat_Level == 100)
|
||||
pk4.EXP = PKX.getEXP(pk4.Stat_Level, pk4.Species);
|
||||
|
||||
CB_Species.SelectedValue = pk4.Species;
|
||||
TB_Level.Text = pk4.Stat_Level.ToString();
|
||||
TB_EXP.Text = pk4.EXP.ToString();
|
||||
|
||||
// Load rest
|
||||
CHK_Fateful.Checked = pk4.FatefulEncounter;
|
||||
CHK_IsEgg.Checked = pk4.IsEgg;
|
||||
CHK_Nicknamed.Checked = pk4.IsNicknamed;
|
||||
Label_OTGender.Text = gendersymbols[pk4.OT_Gender];
|
||||
Label_OTGender.ForeColor = pk4.OT_Gender == 1 ? Color.Red : Color.Blue;
|
||||
TB_PID.Text = pk4.PID.ToString("X8");
|
||||
CB_HeldItem.SelectedValue = pk4.HeldItem;
|
||||
setAbilityList();
|
||||
CB_Nature.SelectedValue = pk4.Nature;
|
||||
TB_TID.Text = pk4.TID.ToString("00000");
|
||||
TB_SID.Text = pk4.SID.ToString("00000");
|
||||
TB_Nickname.Text = pk4.Nickname;
|
||||
TB_OT.Text = pk4.OT_Name;
|
||||
TB_Friendship.Text = pk4.CurrentFriendship.ToString();
|
||||
GB_OT.BackgroundImage = null;
|
||||
CB_Language.SelectedValue = pk4.Language;
|
||||
CB_GameOrigin.SelectedValue = pk4.Version;
|
||||
CB_EncounterType.SelectedValue = pk4.Gen4 ? pk4.EncounterType : 0;
|
||||
CB_Ball.SelectedValue = pk4.Ball;
|
||||
|
||||
if (pk4.MetDate.HasValue)
|
||||
{
|
||||
CAL_MetDate.Value = pk4.MetDate.Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
CAL_MetDate.Value = new DateTime(2000, 1, 1);
|
||||
}
|
||||
|
||||
if (pk4.Egg_Location != 0)
|
||||
{
|
||||
// Was obtained initially as an egg.
|
||||
CHK_AsEgg.Checked = true;
|
||||
GB_EggConditions.Enabled = true;
|
||||
|
||||
CB_EggLocation.SelectedValue = pk4.Egg_Location;
|
||||
if (pk4.EggMetDate.HasValue)
|
||||
{
|
||||
CAL_EggDate.Value = pk4.EggMetDate.Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
CAL_EggDate.Value = new DateTime(2000, 1, 1);
|
||||
}
|
||||
}
|
||||
else { CAL_EggDate.Value = new DateTime(2000, 01, 01); CHK_AsEgg.Checked = GB_EggConditions.Enabled = false; CB_EggLocation.SelectedValue = 0; }
|
||||
|
||||
CB_MetLocation.SelectedValue = pk4.Met_Location;
|
||||
|
||||
TB_MetLevel.Text = pk4.Met_Level.ToString();
|
||||
|
||||
// Reset Label and ComboBox visibility, as well as non-data checked status.
|
||||
Label_PKRS.Visible = CB_PKRSStrain.Visible = CHK_Infected.Checked = pk4.PKRS_Strain != 0;
|
||||
Label_PKRSdays.Visible = CB_PKRSDays.Visible = pk4.PKRS_Days != 0;
|
||||
|
||||
// Set SelectedIndexes for PKRS
|
||||
CB_PKRSStrain.SelectedIndex = pk4.PKRS_Strain;
|
||||
CHK_Cured.Checked = pk4.PKRS_Strain > 0 && pk4.PKRS_Days == 0;
|
||||
CB_PKRSDays.SelectedIndex = Math.Min(CB_PKRSDays.Items.Count - 1, pk4.PKRS_Days); // to strip out bad hacked 'rus
|
||||
|
||||
TB_Cool.Text = pk4.CNT_Cool.ToString();
|
||||
TB_Beauty.Text = pk4.CNT_Beauty.ToString();
|
||||
TB_Cute.Text = pk4.CNT_Cute.ToString();
|
||||
TB_Smart.Text = pk4.CNT_Smart.ToString();
|
||||
TB_Tough.Text = pk4.CNT_Tough.ToString();
|
||||
TB_Sheen.Text = pk4.CNT_Sheen.ToString();
|
||||
|
||||
TB_HPIV.Text = pk4.IV_HP.ToString();
|
||||
TB_ATKIV.Text = pk4.IV_ATK.ToString();
|
||||
TB_DEFIV.Text = pk4.IV_DEF.ToString();
|
||||
TB_SPEIV.Text = pk4.IV_SPE.ToString();
|
||||
TB_SPAIV.Text = pk4.IV_SPA.ToString();
|
||||
TB_SPDIV.Text = pk4.IV_SPD.ToString();
|
||||
CB_HPType.SelectedValue = pk4.HPType;
|
||||
|
||||
TB_HPEV.Text = pk4.EV_HP.ToString();
|
||||
TB_ATKEV.Text = pk4.EV_ATK.ToString();
|
||||
TB_DEFEV.Text = pk4.EV_DEF.ToString();
|
||||
TB_SPEEV.Text = pk4.EV_SPE.ToString();
|
||||
TB_SPAEV.Text = pk4.EV_SPA.ToString();
|
||||
TB_SPDEV.Text = pk4.EV_SPD.ToString();
|
||||
|
||||
CB_Move1.SelectedValue = pk4.Move1;
|
||||
CB_Move2.SelectedValue = pk4.Move2;
|
||||
CB_Move3.SelectedValue = pk4.Move3;
|
||||
CB_Move4.SelectedValue = pk4.Move4;
|
||||
CB_PPu1.SelectedIndex = pk4.Move1_PPUps;
|
||||
CB_PPu2.SelectedIndex = pk4.Move2_PPUps;
|
||||
CB_PPu3.SelectedIndex = pk4.Move3_PPUps;
|
||||
CB_PPu4.SelectedIndex = pk4.Move4_PPUps;
|
||||
TB_PP1.Text = pk4.Move1_PP.ToString();
|
||||
TB_PP2.Text = pk4.Move2_PP.ToString();
|
||||
TB_PP3.Text = pk4.Move3_PP.ToString();
|
||||
TB_PP4.Text = pk4.Move4_PP.ToString();
|
||||
|
||||
// Set Form if count is enough, else cap.
|
||||
CB_Form.SelectedIndex = CB_Form.Items.Count > pk4.AltForm ? pk4.AltForm : CB_Form.Items.Count - 1;
|
||||
|
||||
// Load Extrabyte Value
|
||||
TB_ExtraByte.Text = pk4.Data[Convert.ToInt32(CB_ExtraBytes.Text, 16)].ToString();
|
||||
|
||||
updateStats();
|
||||
|
||||
TB_EXP.Text = pk4.EXP.ToString();
|
||||
Label_Gender.Text = gendersymbols[pk4.Gender];
|
||||
Label_Gender.ForeColor = pk4.Gender == 2 ? Label_Species.ForeColor : (pk4.Gender == 1 ? Color.Red : Color.Blue);
|
||||
|
||||
if (HaX)
|
||||
DEV_Ability.SelectedValue = pk4.Ability;
|
||||
else
|
||||
{
|
||||
int[] abils = SAV.Personal.getAbilities(pk4.Species, pk4.AltForm);
|
||||
int abil = Array.IndexOf(abils, pk4.Ability);
|
||||
|
||||
if (abil < 0)
|
||||
CB_Ability.SelectedIndex = 0;
|
||||
else if (abils[0] == abils[1] || abils[1] == 0)
|
||||
CB_Ability.SelectedIndex = pk4.PIDAbility;
|
||||
else
|
||||
CB_Ability.SelectedIndex = abil < 0 || abil >= CB_Ability.Items.Count ? 0 : abil;
|
||||
}
|
||||
}
|
||||
private PKM prepareBK4()
|
||||
{
|
||||
BK4 pk4 = pkm as BK4;
|
||||
if (pk4 == null)
|
||||
return null;
|
||||
|
||||
pk4.Species = Util.getIndex(CB_Species);
|
||||
pk4.HeldItem = Util.getIndex(CB_HeldItem);
|
||||
pk4.TID = Util.ToInt32(TB_TID.Text);
|
||||
pk4.SID = Util.ToInt32(TB_SID.Text);
|
||||
pk4.EXP = Util.ToUInt32(TB_EXP.Text);
|
||||
pk4.PID = Util.getHEXval(TB_PID.Text);
|
||||
pk4.Ability = (byte)Array.IndexOf(abilitylist, CB_Ability.Text.Remove(CB_Ability.Text.Length - 4));
|
||||
|
||||
pk4.FatefulEncounter = CHK_Fateful.Checked;
|
||||
pk4.Gender = PKX.getGender(Label_Gender.Text);
|
||||
pk4.AltForm = (MT_Form.Enabled ? Convert.ToInt32(MT_Form.Text) : CB_Form.Enabled ? CB_Form.SelectedIndex : 0) & 0x1F;
|
||||
pk4.EV_HP = Util.ToInt32(TB_HPEV.Text);
|
||||
pk4.EV_ATK = Util.ToInt32(TB_ATKEV.Text);
|
||||
pk4.EV_DEF = Util.ToInt32(TB_DEFEV.Text);
|
||||
pk4.EV_SPE = Util.ToInt32(TB_SPEEV.Text);
|
||||
pk4.EV_SPA = Util.ToInt32(TB_SPAEV.Text);
|
||||
pk4.EV_SPD = Util.ToInt32(TB_SPDEV.Text);
|
||||
|
||||
pk4.CNT_Cool = Util.ToInt32(TB_Cool.Text);
|
||||
pk4.CNT_Beauty = Util.ToInt32(TB_Beauty.Text);
|
||||
pk4.CNT_Cute = Util.ToInt32(TB_Cute.Text);
|
||||
pk4.CNT_Smart = Util.ToInt32(TB_Smart.Text);
|
||||
pk4.CNT_Tough = Util.ToInt32(TB_Tough.Text);
|
||||
pk4.CNT_Sheen = Util.ToInt32(TB_Sheen.Text);
|
||||
|
||||
pk4.PKRS_Days = CB_PKRSDays.SelectedIndex;
|
||||
pk4.PKRS_Strain = CB_PKRSStrain.SelectedIndex;
|
||||
pk4.Nickname = TB_Nickname.Text;
|
||||
pk4.Move1 = Util.getIndex(CB_Move1);
|
||||
pk4.Move2 = Util.getIndex(CB_Move2);
|
||||
pk4.Move3 = Util.getIndex(CB_Move3);
|
||||
pk4.Move4 = Util.getIndex(CB_Move4);
|
||||
pk4.Move1_PP = Util.getIndex(CB_Move1) > 0 ? Util.ToInt32(TB_PP1.Text) : 0;
|
||||
pk4.Move2_PP = Util.getIndex(CB_Move2) > 0 ? Util.ToInt32(TB_PP2.Text) : 0;
|
||||
pk4.Move3_PP = Util.getIndex(CB_Move3) > 0 ? Util.ToInt32(TB_PP3.Text) : 0;
|
||||
pk4.Move4_PP = Util.getIndex(CB_Move4) > 0 ? Util.ToInt32(TB_PP4.Text) : 0;
|
||||
pk4.Move1_PPUps = Util.getIndex(CB_Move1) > 0 ? CB_PPu1.SelectedIndex : 0;
|
||||
pk4.Move2_PPUps = Util.getIndex(CB_Move2) > 0 ? CB_PPu2.SelectedIndex : 0;
|
||||
pk4.Move3_PPUps = Util.getIndex(CB_Move3) > 0 ? CB_PPu3.SelectedIndex : 0;
|
||||
pk4.Move4_PPUps = Util.getIndex(CB_Move4) > 0 ? CB_PPu4.SelectedIndex : 0;
|
||||
|
||||
pk4.IV_HP = Util.ToInt32(TB_HPIV.Text);
|
||||
pk4.IV_ATK = Util.ToInt32(TB_ATKIV.Text);
|
||||
pk4.IV_DEF = Util.ToInt32(TB_DEFIV.Text);
|
||||
pk4.IV_SPE = Util.ToInt32(TB_SPEIV.Text);
|
||||
pk4.IV_SPA = Util.ToInt32(TB_SPAIV.Text);
|
||||
pk4.IV_SPD = Util.ToInt32(TB_SPDIV.Text);
|
||||
pk4.IsEgg = CHK_IsEgg.Checked;
|
||||
pk4.IsNicknamed = CHK_Nicknamed.Checked;
|
||||
|
||||
pk4.OT_Name = TB_OT.Text;
|
||||
pk4.CurrentFriendship = Util.ToInt32(TB_Friendship.Text);
|
||||
|
||||
pk4.Ball = Util.getIndex(CB_Ball);
|
||||
pk4.Met_Level = Util.ToInt32(TB_MetLevel.Text);
|
||||
pk4.OT_Gender = PKX.getGender(Label_OTGender.Text);
|
||||
pk4.EncounterType = Util.getIndex(CB_EncounterType);
|
||||
pk4.Version = Util.getIndex(CB_GameOrigin);
|
||||
pk4.Language = Util.getIndex(CB_Language);
|
||||
|
||||
// Default Dates
|
||||
DateTime? egg_date = null;
|
||||
int egg_location = 0;
|
||||
if (CHK_AsEgg.Checked) // If encountered as an egg, load the Egg Met data from fields.
|
||||
{
|
||||
egg_date = CAL_EggDate.Value;
|
||||
egg_location = Util.getIndex(CB_EggLocation);
|
||||
}
|
||||
// Egg Met Data
|
||||
pk4.EggMetDate = egg_date;
|
||||
pk4.Egg_Location = egg_location;
|
||||
// Met Data
|
||||
pk4.MetDate = CAL_MetDate.Value;
|
||||
pk4.Met_Location = Util.getIndex(CB_MetLocation);
|
||||
|
||||
if (pk4.IsEgg && pk4.Met_Location == 0) // If still an egg, it has no hatch location/date. Zero it!
|
||||
pk4.MetDate = null;
|
||||
|
||||
// Toss in Party Stats
|
||||
Array.Resize(ref pk4.Data, pk4.SIZE_PARTY);
|
||||
pk4.Stat_Level = Util.ToInt32(TB_Level.Text);
|
||||
pk4.Stat_HPCurrent = Util.ToInt32(Stat_HP.Text);
|
||||
pk4.Stat_HPMax = Util.ToInt32(Stat_HP.Text);
|
||||
pk4.Stat_ATK = Util.ToInt32(Stat_ATK.Text);
|
||||
pk4.Stat_DEF = Util.ToInt32(Stat_DEF.Text);
|
||||
pk4.Stat_SPE = Util.ToInt32(Stat_SPE.Text);
|
||||
pk4.Stat_SPA = Util.ToInt32(Stat_SPA.Text);
|
||||
pk4.Stat_SPD = Util.ToInt32(Stat_SPD.Text);
|
||||
|
||||
if (HaX)
|
||||
{
|
||||
pk4.Ability = (byte)Util.getIndex(DEV_Ability);
|
||||
pk4.Stat_Level = (byte)Math.Min(Convert.ToInt32(MT_Level.Text), byte.MaxValue);
|
||||
}
|
||||
|
||||
// Fix Moves if a slot is empty
|
||||
pk4.FixMoves();
|
||||
|
||||
pk4.RefreshChecksum();
|
||||
return pk4;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -151,6 +151,7 @@
|
|||
<Compile Include="PKM\XK3.cs" />
|
||||
<Compile Include="PKM\PK1.cs" />
|
||||
<Compile Include="PKM\PK2.cs" />
|
||||
<Compile Include="PKM\BK4.cs" />
|
||||
<Compile Include="PKM\PKM.cs" />
|
||||
<Compile Include="PKM\PKMConverter.cs" />
|
||||
<Compile Include="PKM\ShowdownSet.cs" />
|
||||
|
@ -177,6 +178,7 @@
|
|||
<Compile Include="Saves\SAV3RSBox.cs" />
|
||||
<Compile Include="Saves\SAV3.cs" />
|
||||
<Compile Include="Saves\SAV4.cs" />
|
||||
<Compile Include="Saves\SAV4BR.cs" />
|
||||
<Compile Include="Saves\SAV5.cs" />
|
||||
<Compile Include="Saves\SAV6.cs" />
|
||||
<Compile Include="Saves\SaveFile.cs" />
|
||||
|
|
461
PKHeX/PKM/BK4.cs
Normal file
461
PKHeX/PKM/BK4.cs
Normal file
|
@ -0,0 +1,461 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
|
||||
namespace PKHeX
|
||||
{
|
||||
public class BK4 : PKM // Big Endian 4th Generation PKM File
|
||||
{
|
||||
internal static readonly byte[] ExtraBytes =
|
||||
{
|
||||
0x42, 0x43, 0x5E, 0x63, 0x64, 0x65, 0x66, 0x67, 0x87
|
||||
};
|
||||
public sealed override int SIZE_PARTY => PKX.SIZE_4PARTY;
|
||||
public override int SIZE_STORED => PKX.SIZE_4STORED;
|
||||
public override int Format => 4;
|
||||
|
||||
public override byte[] DecryptedBoxData => EncryptedBoxData;
|
||||
|
||||
public override string Extension => "bk4";
|
||||
|
||||
public override bool Valid => ChecksumValid || (Sanity != 0 && Species <= 493); // What does Sanity do?
|
||||
|
||||
public BK4(byte[] decryptedData = null, string ident = null)
|
||||
{
|
||||
Data = (byte[])(decryptedData ?? new byte[SIZE_PARTY]).Clone();
|
||||
uint sv = ((PID & 0x3E000) >> 0xD) % 24;
|
||||
Data = PKX.shuffleArray45(Data, sv);
|
||||
Identifier = ident;
|
||||
if (Sanity != 0 && Species <= 493 && !ChecksumValid) // We can only hope
|
||||
{
|
||||
RefreshChecksum();
|
||||
}
|
||||
if (Valid && Sanity == 0)
|
||||
{
|
||||
Sanity = 0x4000;
|
||||
}
|
||||
if (Data.Length != SIZE_PARTY)
|
||||
Array.Resize(ref Data, SIZE_PARTY);
|
||||
}
|
||||
public override PKM Clone() { return new BK4(Encrypt()); }
|
||||
|
||||
// Future Attributes
|
||||
public override uint EncryptionConstant { get { return PID; } set { } }
|
||||
public override int Nature { get { return (int)(PID%25); } set { } }
|
||||
public override int CurrentFriendship { get { return OT_Friendship; } set { OT_Friendship = value; } }
|
||||
public override int CurrentHandler { get { return 0; } set { } }
|
||||
|
||||
// Structure
|
||||
public override uint PID { get { return Util.SwapEndianness(BitConverter.ToUInt32(Data, 0x00)); } set { BitConverter.GetBytes(Util.SwapEndianness(value)).CopyTo(Data, 0x00); } }
|
||||
public override ushort Sanity { get { return Util.SwapEndianness(BitConverter.ToUInt16(Data, 0x04)); } set { BitConverter.GetBytes(Util.SwapEndianness(value)).CopyTo(Data, 0x04); } }
|
||||
public override ushort Checksum { get { return Util.SwapEndianness(BitConverter.ToUInt16(Data, 0x06)); } set { BitConverter.GetBytes(Util.SwapEndianness(value)).CopyTo(Data, 0x06); } }
|
||||
|
||||
#region Block A
|
||||
public override int Species { get { return Util.SwapEndianness(BitConverter.ToUInt16(Data, 0x08)); } set { BitConverter.GetBytes(Util.SwapEndianness((ushort)value)).CopyTo(Data, 0x08); } }
|
||||
public override int HeldItem { get { return Util.SwapEndianness(BitConverter.ToUInt16(Data, 0x0A)); } set { BitConverter.GetBytes(Util.SwapEndianness((ushort)value)).CopyTo(Data, 0x0A); } }
|
||||
public override int SID { get { return Util.SwapEndianness(BitConverter.ToUInt16(Data, 0x0C)); } set { BitConverter.GetBytes(Util.SwapEndianness((ushort)value)).CopyTo(Data, 0x0C); } }
|
||||
public override int TID { get { return Util.SwapEndianness(BitConverter.ToUInt16(Data, 0x0E)); } set { BitConverter.GetBytes(Util.SwapEndianness((ushort)value)).CopyTo(Data, 0x0E); } }
|
||||
public override uint EXP
|
||||
{
|
||||
get { return Util.SwapEndianness(BitConverter.ToUInt32(Data, 0x10)); }
|
||||
set { BitConverter.GetBytes(Util.SwapEndianness(value)).CopyTo(Data, 0x10); }
|
||||
}
|
||||
public override int OT_Friendship { get { return Data[0x14]; } set { Data[0x14] = (byte)value; } }
|
||||
public override int Ability { get { return Data[0x15]; } set { Data[0x15] = (byte)value; } }
|
||||
public override byte MarkByte { get { return Data[0x16]; } protected set { Data[0x16] = value; } }
|
||||
public override int Language { get { return Data[0x17]; } set { Data[0x17] = (byte)value; } }
|
||||
public override int EV_HP { get { return Data[0x18]; } set { Data[0x18] = (byte)value; } }
|
||||
public override int EV_ATK { get { return Data[0x19]; } set { Data[0x19] = (byte)value; } }
|
||||
public override int EV_DEF { get { return Data[0x1A]; } set { Data[0x1A] = (byte)value; } }
|
||||
public override int EV_SPE { get { return Data[0x1B]; } set { Data[0x1B] = (byte)value; } }
|
||||
public override int EV_SPA { get { return Data[0x1C]; } set { Data[0x1C] = (byte)value; } }
|
||||
public override int EV_SPD { get { return Data[0x1D]; } set { Data[0x1D] = (byte)value; } }
|
||||
public override int CNT_Cool { get { return Data[0x1E]; } set { Data[0x1E] = (byte)value; } }
|
||||
public override int CNT_Beauty { get { return Data[0x1F]; } set { Data[0x1F] = (byte)value; } }
|
||||
public override int CNT_Cute { get { return Data[0x20]; } set { Data[0x20] = (byte)value; } }
|
||||
public override int CNT_Smart { get { return Data[0x21]; } set { Data[0x21] = (byte)value; } }
|
||||
public override int CNT_Tough { get { return Data[0x22]; } set { Data[0x22] = (byte)value; } }
|
||||
public override int CNT_Sheen { get { return Data[0x23]; } set { Data[0x23] = (byte)value; } }
|
||||
|
||||
private byte RIB0 { get { return Data[0x24]; } set { Data[0x24] = value; } } // Sinnoh 1
|
||||
private byte RIB1 { get { return Data[0x25]; } set { Data[0x25] = value; } } // Sinnoh 2
|
||||
private byte RIB2 { get { return Data[0x26]; } set { Data[0x26] = value; } } // Unova 1
|
||||
private byte RIB3 { get { return Data[0x27]; } set { Data[0x27] = value; } } // Unova 2
|
||||
public bool RibbonChampionSinnoh { get { return (RIB0 & (1 << 0)) == 1 << 0; } set { RIB0 = (byte)(RIB0 & ~(1 << 0) | (value ? 1 << 0 : 0)); } }
|
||||
public bool RibbonAbility { get { return (RIB0 & (1 << 1)) == 1 << 1; } set { RIB0 = (byte)(RIB0 & ~(1 << 1) | (value ? 1 << 1 : 0)); } }
|
||||
public bool RibbonAbilityGreat { get { return (RIB0 & (1 << 2)) == 1 << 2; } set { RIB0 = (byte)(RIB0 & ~(1 << 2) | (value ? 1 << 2 : 0)); } }
|
||||
public bool RibbonAbilityDouble { get { return (RIB0 & (1 << 3)) == 1 << 3; } set { RIB0 = (byte)(RIB0 & ~(1 << 3) | (value ? 1 << 3 : 0)); } }
|
||||
public bool RibbonAbilityMulti { get { return (RIB0 & (1 << 4)) == 1 << 4; } set { RIB0 = (byte)(RIB0 & ~(1 << 4) | (value ? 1 << 4 : 0)); } }
|
||||
public bool RibbonAbilityPair { get { return (RIB0 & (1 << 5)) == 1 << 5; } set { RIB0 = (byte)(RIB0 & ~(1 << 5) | (value ? 1 << 5 : 0)); } }
|
||||
public bool RibbonAbilityWorld { get { return (RIB0 & (1 << 6)) == 1 << 6; } set { RIB0 = (byte)(RIB0 & ~(1 << 6) | (value ? 1 << 6 : 0)); } }
|
||||
public bool RibbonAlert { get { return (RIB0 & (1 << 7)) == 1 << 7; } set { RIB0 = (byte)(RIB0 & ~(1 << 7) | (value ? 1 << 7 : 0)); } }
|
||||
public bool RibbonShock { get { return (RIB1 & (1 << 0)) == 1 << 0; } set { RIB1 = (byte)(RIB1 & ~(1 << 0) | (value ? 1 << 0 : 0)); } }
|
||||
public bool RibbonDowncast { get { return (RIB1 & (1 << 1)) == 1 << 1; } set { RIB1 = (byte)(RIB1 & ~(1 << 1) | (value ? 1 << 1 : 0)); } }
|
||||
public bool RibbonCareless { get { return (RIB1 & (1 << 2)) == 1 << 2; } set { RIB1 = (byte)(RIB1 & ~(1 << 2) | (value ? 1 << 2 : 0)); } }
|
||||
public bool RibbonRelax { get { return (RIB1 & (1 << 3)) == 1 << 3; } set { RIB1 = (byte)(RIB1 & ~(1 << 3) | (value ? 1 << 3 : 0)); } }
|
||||
public bool RibbonSnooze { get { return (RIB1 & (1 << 4)) == 1 << 4; } set { RIB1 = (byte)(RIB1 & ~(1 << 4) | (value ? 1 << 4 : 0)); } }
|
||||
public bool RibbonSmile { get { return (RIB1 & (1 << 5)) == 1 << 5; } set { RIB1 = (byte)(RIB1 & ~(1 << 5) | (value ? 1 << 5 : 0)); } }
|
||||
public bool RibbonGorgeous { get { return (RIB1 & (1 << 6)) == 1 << 6; } set { RIB1 = (byte)(RIB1 & ~(1 << 6) | (value ? 1 << 6 : 0)); } }
|
||||
public bool RibbonRoyal { get { return (RIB1 & (1 << 7)) == 1 << 7; } set { RIB1 = (byte)(RIB1 & ~(1 << 7) | (value ? 1 << 7 : 0)); } }
|
||||
public bool RibbonGorgeousRoyal { get { return (RIB2 & (1 << 0)) == 1 << 0; } set { RIB2 = (byte)(RIB2 & ~(1 << 0) | (value ? 1 << 0 : 0)); } }
|
||||
public bool RibbonFootprint { get { return (RIB2 & (1 << 1)) == 1 << 1; } set { RIB2 = (byte)(RIB2 & ~(1 << 1) | (value ? 1 << 1 : 0)); } }
|
||||
public bool RibbonRecord { get { return (RIB2 & (1 << 2)) == 1 << 2; } set { RIB2 = (byte)(RIB2 & ~(1 << 2) | (value ? 1 << 2 : 0)); } }
|
||||
public bool RibbonEvent { get { return (RIB2 & (1 << 3)) == 1 << 3; } set { RIB2 = (byte)(RIB2 & ~(1 << 3) | (value ? 1 << 3 : 0)); } }
|
||||
public bool RibbonLegend { get { return (RIB2 & (1 << 4)) == 1 << 4; } set { RIB2 = (byte)(RIB2 & ~(1 << 4) | (value ? 1 << 4 : 0)); } }
|
||||
public bool RibbonChampionWorld { get { return (RIB2 & (1 << 5)) == 1 << 5; } set { RIB2 = (byte)(RIB2 & ~(1 << 5) | (value ? 1 << 5 : 0)); } }
|
||||
public bool RibbonBirthday { get { return (RIB2 & (1 << 6)) == 1 << 6; } set { RIB2 = (byte)(RIB2 & ~(1 << 6) | (value ? 1 << 6 : 0)); } }
|
||||
public bool RibbonSpecial { get { return (RIB2 & (1 << 7)) == 1 << 7; } set { RIB2 = (byte)(RIB2 & ~(1 << 7) | (value ? 1 << 7 : 0)); } }
|
||||
public bool RibbonSouvenir { get { return (RIB3 & (1 << 0)) == 1 << 0; } set { RIB3 = (byte)(RIB3 & ~(1 << 0) | (value ? 1 << 0 : 0)); } }
|
||||
public bool RibbonWishing { get { return (RIB3 & (1 << 1)) == 1 << 1; } set { RIB3 = (byte)(RIB3 & ~(1 << 1) | (value ? 1 << 1 : 0)); } }
|
||||
public bool RibbonClassic { get { return (RIB3 & (1 << 2)) == 1 << 2; } set { RIB3 = (byte)(RIB3 & ~(1 << 2) | (value ? 1 << 2 : 0)); } }
|
||||
public bool RibbonPremier { get { return (RIB3 & (1 << 3)) == 1 << 3; } set { RIB3 = (byte)(RIB3 & ~(1 << 3) | (value ? 1 << 3 : 0)); } }
|
||||
public bool RIB3_4 { get { return (RIB3 & (1 << 4)) == 1 << 4; } set { RIB3 = (byte)(RIB3 & ~(1 << 4) | (value ? 1 << 4 : 0)); } } // Unused
|
||||
public bool RIB3_5 { get { return (RIB3 & (1 << 5)) == 1 << 5; } set { RIB3 = (byte)(RIB3 & ~(1 << 5) | (value ? 1 << 5 : 0)); } } // Unused
|
||||
public bool RIB3_6 { get { return (RIB3 & (1 << 6)) == 1 << 6; } set { RIB3 = (byte)(RIB3 & ~(1 << 6) | (value ? 1 << 6 : 0)); } } // Unused
|
||||
public bool RIB3_7 { get { return (RIB3 & (1 << 7)) == 1 << 7; } set { RIB3 = (byte)(RIB3 & ~(1 << 7) | (value ? 1 << 7 : 0)); } } // Unused
|
||||
#endregion
|
||||
|
||||
#region Block B
|
||||
public override int Move1 { get { return Util.SwapEndianness(BitConverter.ToUInt16(Data, 0x28)); } set { BitConverter.GetBytes(Util.SwapEndianness((ushort)value)).CopyTo(Data, 0x28); } }
|
||||
public override int Move2 { get { return Util.SwapEndianness(BitConverter.ToUInt16(Data, 0x2A)); } set { BitConverter.GetBytes(Util.SwapEndianness((ushort)value)).CopyTo(Data, 0x2A); } }
|
||||
public override int Move3 { get { return Util.SwapEndianness(BitConverter.ToUInt16(Data, 0x2C)); } set { BitConverter.GetBytes(Util.SwapEndianness((ushort)value)).CopyTo(Data, 0x2C); } }
|
||||
public override int Move4 { get { return Util.SwapEndianness(BitConverter.ToUInt16(Data, 0x2E)); } set { BitConverter.GetBytes(Util.SwapEndianness((ushort)value)).CopyTo(Data, 0x2E); } }
|
||||
public override int Move1_PP { get { return Data[0x30]; } set { Data[0x30] = (byte)value; } }
|
||||
public override int Move2_PP { get { return Data[0x31]; } set { Data[0x31] = (byte)value; } }
|
||||
public override int Move3_PP { get { return Data[0x32]; } set { Data[0x32] = (byte)value; } }
|
||||
public override int Move4_PP { get { return Data[0x33]; } set { Data[0x33] = (byte)value; } }
|
||||
public override int Move1_PPUps { get { return Data[0x34]; } set { Data[0x34] = (byte)value; } }
|
||||
public override int Move2_PPUps { get { return Data[0x35]; } set { Data[0x35] = (byte)value; } }
|
||||
public override int Move3_PPUps { get { return Data[0x36]; } set { Data[0x36] = (byte)value; } }
|
||||
public override int Move4_PPUps { get { return Data[0x37]; } set { Data[0x37] = (byte)value; } }
|
||||
public uint IV32 { get { return Util.SwapEndianness(BitConverter.ToUInt32(Data, 0x38)); } set { BitConverter.GetBytes(Util.SwapEndianness(value)).CopyTo(Data, 0x38); } }
|
||||
public override int IV_HP { get { return (int)(IV32 >> 02) & 0x1F; } set { IV32 = (uint)((IV32 & ~(0x1F << 02)) | (uint)((value > 31 ? 31 : value) << 02)); } }
|
||||
public override int IV_ATK { get { return (int)(IV32 >> 07) & 0x1F; } set { IV32 = (uint)((IV32 & ~(0x1F << 07)) | (uint)((value > 31 ? 31 : value) << 07)); } }
|
||||
public override int IV_DEF { get { return (int)(IV32 >> 12) & 0x1F; } set { IV32 = (uint)((IV32 & ~(0x1F << 12)) | (uint)((value > 31 ? 31 : value) << 12)); } }
|
||||
public override int IV_SPE { get { return (int)(IV32 >> 17) & 0x1F; } set { IV32 = (uint)((IV32 & ~(0x1F << 17)) | (uint)((value > 31 ? 31 : value) << 17)); } }
|
||||
public override int IV_SPA { get { return (int)(IV32 >> 22) & 0x1F; } set { IV32 = (uint)((IV32 & ~(0x1F << 22)) | (uint)((value > 31 ? 31 : value) << 22)); } }
|
||||
public override int IV_SPD { get { return (int)(IV32 >> 27) & 0x1F; } set { IV32 = (uint)((IV32 & ~(0x1F << 27)) | (uint)((value > 31 ? 31 : value) << 27)); } }
|
||||
public override bool IsNicknamed { get { return ((IV32 >> 0) & 1) == 1; } set { IV32 = (uint)((IV32 & ~0x00000001) | (uint)(value ? 0x00000001 : 0)); } }
|
||||
public override bool IsEgg { get { return ((IV32 >> 1) & 1) == 1; } set { IV32 = (uint)((IV32 & ~0x00000002) | (uint)(value ? 0x00000002 : 0)); } }
|
||||
|
||||
private byte RIB4 { get { return Data[0x3C]; } set { Data[0x3C] = value; } } // Hoenn 1a
|
||||
private byte RIB5 { get { return Data[0x3D]; } set { Data[0x3D] = value; } } // Hoenn 1b
|
||||
private byte RIB6 { get { return Data[0x3E]; } set { Data[0x3E] = value; } } // Hoenn 2a
|
||||
private byte RIB7 { get { return Data[0x3F]; } set { Data[0x3F] = value; } } // Hoenn 2b
|
||||
public bool RibbonG3Cool { get { return (RIB4 & (1 << 0)) == 1 << 0; } set { RIB4 = (byte)(RIB4 & ~(1 << 0) | (value ? 1 << 0 : 0)); } }
|
||||
public bool RibbonG3CoolSuper { get { return (RIB4 & (1 << 1)) == 1 << 1; } set { RIB4 = (byte)(RIB4 & ~(1 << 1) | (value ? 1 << 1 : 0)); } }
|
||||
public bool RibbonG3CoolHyper { get { return (RIB4 & (1 << 2)) == 1 << 2; } set { RIB4 = (byte)(RIB4 & ~(1 << 2) | (value ? 1 << 2 : 0)); } }
|
||||
public bool RibbonG3CoolMaster { get { return (RIB4 & (1 << 3)) == 1 << 3; } set { RIB4 = (byte)(RIB4 & ~(1 << 3) | (value ? 1 << 3 : 0)); } }
|
||||
public bool RibbonG3Beauty { get { return (RIB4 & (1 << 4)) == 1 << 4; } set { RIB4 = (byte)(RIB4 & ~(1 << 4) | (value ? 1 << 4 : 0)); } }
|
||||
public bool RibbonG3BeautySuper { get { return (RIB4 & (1 << 5)) == 1 << 5; } set { RIB4 = (byte)(RIB4 & ~(1 << 5) | (value ? 1 << 5 : 0)); } }
|
||||
public bool RibbonG3BeautyHyper { get { return (RIB4 & (1 << 6)) == 1 << 6; } set { RIB4 = (byte)(RIB4 & ~(1 << 6) | (value ? 1 << 6 : 0)); } }
|
||||
public bool RibbonG3BeautyMaster { get { return (RIB4 & (1 << 7)) == 1 << 7; } set { RIB4 = (byte)(RIB4 & ~(1 << 7) | (value ? 1 << 7 : 0)); } }
|
||||
public bool RibbonG3Cute { get { return (RIB5 & (1 << 0)) == 1 << 0; } set { RIB5 = (byte)(RIB5 & ~(1 << 0) | (value ? 1 << 0 : 0)); } }
|
||||
public bool RibbonG3CuteSuper { get { return (RIB5 & (1 << 1)) == 1 << 1; } set { RIB5 = (byte)(RIB5 & ~(1 << 1) | (value ? 1 << 1 : 0)); } }
|
||||
public bool RibbonG3CuteHyper { get { return (RIB5 & (1 << 2)) == 1 << 2; } set { RIB5 = (byte)(RIB5 & ~(1 << 2) | (value ? 1 << 2 : 0)); } }
|
||||
public bool RibbonG3CuteMaster { get { return (RIB5 & (1 << 3)) == 1 << 3; } set { RIB5 = (byte)(RIB5 & ~(1 << 3) | (value ? 1 << 3 : 0)); } }
|
||||
public bool RibbonG3Smart { get { return (RIB5 & (1 << 4)) == 1 << 4; } set { RIB5 = (byte)(RIB5 & ~(1 << 4) | (value ? 1 << 4 : 0)); } }
|
||||
public bool RibbonG3SmartSuper { get { return (RIB5 & (1 << 5)) == 1 << 5; } set { RIB5 = (byte)(RIB5 & ~(1 << 5) | (value ? 1 << 5 : 0)); } }
|
||||
public bool RibbonG3SmartHyper { get { return (RIB5 & (1 << 6)) == 1 << 6; } set { RIB5 = (byte)(RIB5 & ~(1 << 6) | (value ? 1 << 6 : 0)); } }
|
||||
public bool RibbonG3SmartMaster { get { return (RIB5 & (1 << 7)) == 1 << 7; } set { RIB5 = (byte)(RIB5 & ~(1 << 7) | (value ? 1 << 7 : 0)); } }
|
||||
public bool RibbonG3Tough { get { return (RIB6 & (1 << 0)) == 1 << 0; } set { RIB6 = (byte)(RIB6 & ~(1 << 0) | (value ? 1 << 0 : 0)); } }
|
||||
public bool RibbonG3ToughSuper { get { return (RIB6 & (1 << 1)) == 1 << 1; } set { RIB6 = (byte)(RIB6 & ~(1 << 1) | (value ? 1 << 1 : 0)); } }
|
||||
public bool RibbonG3ToughHyper { get { return (RIB6 & (1 << 2)) == 1 << 2; } set { RIB6 = (byte)(RIB6 & ~(1 << 2) | (value ? 1 << 2 : 0)); } }
|
||||
public bool RibbonG3ToughMaster { get { return (RIB6 & (1 << 3)) == 1 << 3; } set { RIB6 = (byte)(RIB6 & ~(1 << 3) | (value ? 1 << 3 : 0)); } }
|
||||
public bool RibbonChampionG3Hoenn { get { return (RIB6 & (1 << 4)) == 1 << 4; } set { RIB6 = (byte)(RIB6 & ~(1 << 4) | (value ? 1 << 4 : 0)); } }
|
||||
public bool RibbonWinning { get { return (RIB6 & (1 << 5)) == 1 << 5; } set { RIB6 = (byte)(RIB6 & ~(1 << 5) | (value ? 1 << 5 : 0)); } }
|
||||
public bool RibbonVictory { get { return (RIB6 & (1 << 6)) == 1 << 6; } set { RIB6 = (byte)(RIB6 & ~(1 << 6) | (value ? 1 << 6 : 0)); } }
|
||||
public bool RibbonArtist { get { return (RIB6 & (1 << 7)) == 1 << 7; } set { RIB6 = (byte)(RIB6 & ~(1 << 7) | (value ? 1 << 7 : 0)); } }
|
||||
public bool RibbonEffort { get { return (RIB7 & (1 << 0)) == 1 << 0; } set { RIB7 = (byte)(RIB7 & ~(1 << 0) | (value ? 1 << 0 : 0)); } }
|
||||
public bool RibbonChampionBattle { get { return (RIB7 & (1 << 1)) == 1 << 1; } set { RIB7 = (byte)(RIB7 & ~(1 << 1) | (value ? 1 << 1 : 0)); } }
|
||||
public bool RibbonChampionRegional{ get { return (RIB7 & (1 << 2)) == 1 << 2; } set { RIB7 = (byte)(RIB7 & ~(1 << 2) | (value ? 1 << 2 : 0)); } }
|
||||
public bool RibbonChampionNational{ get { return (RIB7 & (1 << 3)) == 1 << 3; } set { RIB7 = (byte)(RIB7 & ~(1 << 3) | (value ? 1 << 3 : 0)); } }
|
||||
public bool RibbonCountry { get { return (RIB7 & (1 << 4)) == 1 << 4; } set { RIB7 = (byte)(RIB7 & ~(1 << 4) | (value ? 1 << 4 : 0)); } }
|
||||
public bool RibbonNational { get { return (RIB7 & (1 << 5)) == 1 << 5; } set { RIB7 = (byte)(RIB7 & ~(1 << 5) | (value ? 1 << 5 : 0)); } }
|
||||
public bool RibbonEarth { get { return (RIB7 & (1 << 6)) == 1 << 6; } set { RIB7 = (byte)(RIB7 & ~(1 << 6) | (value ? 1 << 6 : 0)); } }
|
||||
public bool RibbonWorld { get { return (RIB7 & (1 << 7)) == 1 << 7; } set { RIB7 = (byte)(RIB7 & ~(1 << 7) | (value ? 1 << 7 : 0)); } }
|
||||
|
||||
public override bool FatefulEncounter { get { return (Data[0x40] & 0x80) == 0x80; } set { Data[0x40] = (byte)(Data[0x40] & ~0x80 | (value ? 0x80 : 0)); } }
|
||||
public override int Gender { get { return (Data[0x40] >> 5) & 0x3; } set { Data[0x40] = (byte)(Data[0x40] & ~0x60 | ((value & 3) << 5)); } }
|
||||
public override int AltForm { get { return Data[0x40] & 0x1F; } set { Data[0x40] = (byte)(Data[0x40] & ~0x1F | (value & 0x1F)); } }
|
||||
// 0x43-0x47 Unused
|
||||
#endregion
|
||||
|
||||
#region Block C
|
||||
public override string Nickname
|
||||
{
|
||||
get
|
||||
{
|
||||
return PKX.array2strG4BE(Data.Skip(0x48).Take(22).ToArray())
|
||||
.Replace("\uE08F", "\u2640") // nidoran
|
||||
.Replace("\uE08E", "\u2642") // nidoran
|
||||
.Replace("\u2019", "\u0027"); // farfetch'd
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value.Length > 11)
|
||||
value = value.Substring(0, 11); // Hard cap
|
||||
string TempNick = value // Replace Special Characters and add Terminator
|
||||
.Replace("\u2640", "\uE08F") // nidoran
|
||||
.Replace("\u2642", "\uE08E") // nidoran
|
||||
.Replace("\u0027", "\u2019"); // farfetch'd
|
||||
PKX.str2arrayG4BE(TempNick).CopyTo(Data, 0x48);
|
||||
}
|
||||
}
|
||||
// 0x5E unused
|
||||
public override int Version { get { return Data[0x5F]; } set { Data[0x5F] = (byte)value; } }
|
||||
private byte RIB8 { get { return Data[0x60]; } set { Data[0x60] = value; } } // Sinnoh 3
|
||||
private byte RIB9 { get { return Data[0x61]; } set { Data[0x61] = value; } } // Sinnoh 4
|
||||
private byte RIBA { get { return Data[0x62]; } set { Data[0x62] = value; } } // Sinnoh 5
|
||||
private byte RIBB { get { return Data[0x63]; } set { Data[0x63] = value; } } // Sinnoh 6
|
||||
public bool RibbonG4Cool { get { return (RIB8 & (1 << 0)) == 1 << 0; } set { RIB8 = (byte)(RIB8 & ~(1 << 0) | (value ? 1 << 0 : 0)); } }
|
||||
public bool RibbonG4CoolGreat { get { return (RIB8 & (1 << 1)) == 1 << 1; } set { RIB8 = (byte)(RIB8 & ~(1 << 1) | (value ? 1 << 1 : 0)); } }
|
||||
public bool RibbonG4CoolUltra { get { return (RIB8 & (1 << 2)) == 1 << 2; } set { RIB8 = (byte)(RIB8 & ~(1 << 2) | (value ? 1 << 2 : 0)); } }
|
||||
public bool RibbonG4CoolMaster { get { return (RIB8 & (1 << 3)) == 1 << 3; } set { RIB8 = (byte)(RIB8 & ~(1 << 3) | (value ? 1 << 3 : 0)); } }
|
||||
public bool RibbonG4Beauty { get { return (RIB8 & (1 << 4)) == 1 << 4; } set { RIB8 = (byte)(RIB8 & ~(1 << 4) | (value ? 1 << 4 : 0)); } }
|
||||
public bool RibbonG4BeautyGreat { get { return (RIB8 & (1 << 5)) == 1 << 5; } set { RIB8 = (byte)(RIB8 & ~(1 << 5) | (value ? 1 << 5 : 0)); } }
|
||||
public bool RibbonG4BeautyUltra { get { return (RIB8 & (1 << 6)) == 1 << 6; } set { RIB8 = (byte)(RIB8 & ~(1 << 6) | (value ? 1 << 6 : 0)); } }
|
||||
public bool RibbonG4BeautyMaster { get { return (RIB8 & (1 << 7)) == 1 << 7; } set { RIB8 = (byte)(RIB8 & ~(1 << 7) | (value ? 1 << 7 : 0)); } }
|
||||
public bool RibbonG4Cute { get { return (RIB9 & (1 << 0)) == 1 << 0; } set { RIB9 = (byte)(RIB9 & ~(1 << 0) | (value ? 1 << 0 : 0)); } }
|
||||
public bool RibbonG4CuteGreat { get { return (RIB9 & (1 << 1)) == 1 << 1; } set { RIB9 = (byte)(RIB9 & ~(1 << 1) | (value ? 1 << 1 : 0)); } }
|
||||
public bool RibbonG4CuteUltra { get { return (RIB9 & (1 << 2)) == 1 << 2; } set { RIB9 = (byte)(RIB9 & ~(1 << 2) | (value ? 1 << 2 : 0)); } }
|
||||
public bool RibbonG4CuteMaster { get { return (RIB9 & (1 << 3)) == 1 << 3; } set { RIB9 = (byte)(RIB9 & ~(1 << 3) | (value ? 1 << 3 : 0)); } }
|
||||
public bool RibbonG4Smart { get { return (RIB9 & (1 << 4)) == 1 << 4; } set { RIB9 = (byte)(RIB9 & ~(1 << 4) | (value ? 1 << 4 : 0)); } }
|
||||
public bool RibbonG4SmartGreat { get { return (RIB9 & (1 << 5)) == 1 << 5; } set { RIB9 = (byte)(RIB9 & ~(1 << 5) | (value ? 1 << 5 : 0)); } }
|
||||
public bool RibbonG4SmartUltra { get { return (RIB9 & (1 << 6)) == 1 << 6; } set { RIB9 = (byte)(RIB9 & ~(1 << 6) | (value ? 1 << 6 : 0)); } }
|
||||
public bool RibbonG4SmartMaster { get { return (RIB9 & (1 << 7)) == 1 << 7; } set { RIB9 = (byte)(RIB9 & ~(1 << 7) | (value ? 1 << 7 : 0)); } }
|
||||
public bool RibbonG4Tough { get { return (RIBA & (1 << 0)) == 1 << 0; } set { RIBA = (byte)(RIBA & ~(1 << 0) | (value ? 1 << 0 : 0)); } }
|
||||
public bool RibbonG4ToughGreat { get { return (RIBA & (1 << 1)) == 1 << 1; } set { RIBA = (byte)(RIBA & ~(1 << 1) | (value ? 1 << 1 : 0)); } }
|
||||
public bool RibbonG4ToughUltra { get { return (RIBA & (1 << 2)) == 1 << 2; } set { RIBA = (byte)(RIBA & ~(1 << 2) | (value ? 1 << 2 : 0)); } }
|
||||
public bool RibbonG4ToughMaster { get { return (RIBA & (1 << 3)) == 1 << 3; } set { RIBA = (byte)(RIBA & ~(1 << 3) | (value ? 1 << 3 : 0)); } }
|
||||
public bool RIBA_4 { get { return (RIBA & (1 << 4)) == 1 << 4; } set { RIBA = (byte)(RIBA & ~(1 << 4) | (value ? 1 << 4 : 0)); } } // Unused
|
||||
public bool RIBA_5 { get { return (RIBA & (1 << 5)) == 1 << 5; } set { RIBA = (byte)(RIBA & ~(1 << 5) | (value ? 1 << 5 : 0)); } } // Unused
|
||||
public bool RIBA_6 { get { return (RIBA & (1 << 6)) == 1 << 6; } set { RIBA = (byte)(RIBA & ~(1 << 6) | (value ? 1 << 6 : 0)); } } // Unused
|
||||
public bool RIBA_7 { get { return (RIBA & (1 << 7)) == 1 << 7; } set { RIBA = (byte)(RIBA & ~(1 << 7) | (value ? 1 << 7 : 0)); } } // Unused
|
||||
public bool RIBB_0 { get { return (RIBB & (1 << 0)) == 1 << 0; } set { RIBB = (byte)(RIBB & ~(1 << 0) | (value ? 1 << 0 : 0)); } } // Unused
|
||||
public bool RIBB_1 { get { return (RIBB & (1 << 1)) == 1 << 1; } set { RIBB = (byte)(RIBB & ~(1 << 1) | (value ? 1 << 1 : 0)); } } // Unused
|
||||
public bool RIBB_2 { get { return (RIBB & (1 << 2)) == 1 << 2; } set { RIBB = (byte)(RIBB & ~(1 << 2) | (value ? 1 << 2 : 0)); } } // Unused
|
||||
public bool RIBB_3 { get { return (RIBB & (1 << 3)) == 1 << 3; } set { RIBB = (byte)(RIBB & ~(1 << 3) | (value ? 1 << 3 : 0)); } } // Unused
|
||||
public bool RIBB_4 { get { return (RIBB & (1 << 4)) == 1 << 4; } set { RIBB = (byte)(RIBB & ~(1 << 4) | (value ? 1 << 4 : 0)); } } // Unused
|
||||
public bool RIBB_5 { get { return (RIBB & (1 << 5)) == 1 << 5; } set { RIBB = (byte)(RIBB & ~(1 << 5) | (value ? 1 << 5 : 0)); } } // Unused
|
||||
public bool RIBB_6 { get { return (RIBB & (1 << 6)) == 1 << 6; } set { RIBB = (byte)(RIBB & ~(1 << 6) | (value ? 1 << 6 : 0)); } } // Unused
|
||||
public bool RIBB_7 { get { return (RIBB & (1 << 7)) == 1 << 7; } set { RIBB = (byte)(RIBB & ~(1 << 7) | (value ? 1 << 7 : 0)); } } // Unused
|
||||
// 0x64-0x67 Unused
|
||||
#endregion
|
||||
|
||||
#region Block D
|
||||
public override string OT_Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return PKX.array2strG4BE(Data.Skip(0x68).Take(16).ToArray())
|
||||
.Replace("\uE08F", "\u2640") // Nidoran ♂
|
||||
.Replace("\uE08E", "\u2642") // Nidoran ♀
|
||||
.Replace("\u2019", "\u0027"); // Farfetch'd
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value.Length > 7)
|
||||
value = value.Substring(0, 7); // Hard cap
|
||||
string TempNick = value // Replace Special Characters and add Terminator
|
||||
.Replace("\u2640", "\uE08F") // Nidoran ♂
|
||||
.Replace("\u2642", "\uE08E") // Nidoran ♀
|
||||
.Replace("\u0027", "\u2019"); // Farfetch'd
|
||||
PKX.str2arrayG4BE(TempNick).CopyTo(Data, 0x68);
|
||||
}
|
||||
}
|
||||
protected override int Egg_Year { get { return Data[0x78]; } set { Data[0x78] = (byte)value; } }
|
||||
protected override int Egg_Month { get { return Data[0x79]; } set { Data[0x79] = (byte)value; } }
|
||||
protected override int Egg_Day { get { return Data[0x7A]; } set { Data[0x7A] = (byte)value; } }
|
||||
protected override int Met_Year { get { return Data[0x7B]; } set { Data[0x7B] = (byte)value; } }
|
||||
protected override int Met_Month { get { return Data[0x7C]; } set { Data[0x7C] = (byte)value; } }
|
||||
protected override int Met_Day { get { return Data[0x7D]; } set { Data[0x7D] = (byte)value; } }
|
||||
|
||||
public override int Egg_Location
|
||||
{
|
||||
get
|
||||
{
|
||||
ushort hgssloc = Util.SwapEndianness(BitConverter.ToUInt16(Data, 0x44));
|
||||
if (hgssloc != 0)
|
||||
return hgssloc;
|
||||
return Util.SwapEndianness(BitConverter.ToUInt16(Data, 0x7E));
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == 0)
|
||||
{
|
||||
BitConverter.GetBytes(Util.SwapEndianness((ushort)0)).CopyTo(Data, 0x44);
|
||||
BitConverter.GetBytes(Util.SwapEndianness((ushort)0)).CopyTo(Data, 0x7E);
|
||||
}
|
||||
else if (PtHGSS)
|
||||
{
|
||||
BitConverter.GetBytes(Util.SwapEndianness((ushort)value)).CopyTo(Data, 0x44);
|
||||
BitConverter.GetBytes(Util.SwapEndianness((ushort)0xBBA)).CopyTo(Data, 0x7E); // Faraway Place (for DP display)
|
||||
}
|
||||
else if ((value < 2000 && value > 111) || (value < 3000 && value > 2010))
|
||||
{
|
||||
// Met location not in DP, set to Mystery Zone (0, illegal) as opposed to Faraway Place
|
||||
BitConverter.GetBytes(Util.SwapEndianness((ushort)0)).CopyTo(Data, 0x44);
|
||||
BitConverter.GetBytes(Util.SwapEndianness((ushort)0)).CopyTo(Data, 0x7E);
|
||||
}
|
||||
else
|
||||
{
|
||||
BitConverter.GetBytes(Util.SwapEndianness((ushort)0)).CopyTo(Data, 0x44);
|
||||
BitConverter.GetBytes(Util.SwapEndianness((ushort)value)).CopyTo(Data, 0x7E);
|
||||
}
|
||||
}
|
||||
}
|
||||
public override int Met_Location
|
||||
{
|
||||
get
|
||||
{
|
||||
ushort hgssloc = Util.SwapEndianness(BitConverter.ToUInt16(Data, 0x46));
|
||||
if (hgssloc != 0)
|
||||
return hgssloc;
|
||||
return Util.SwapEndianness(BitConverter.ToUInt16(Data, 0x80));
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == 0)
|
||||
{
|
||||
BitConverter.GetBytes(Util.SwapEndianness((ushort)0)).CopyTo(Data, 0x46);
|
||||
BitConverter.GetBytes(Util.SwapEndianness((ushort)0)).CopyTo(Data, 0x80);
|
||||
}
|
||||
else if (PtHGSS)
|
||||
{
|
||||
BitConverter.GetBytes(Util.SwapEndianness((ushort)value)).CopyTo(Data, 0x46);
|
||||
BitConverter.GetBytes(Util.SwapEndianness((ushort)0xBBA)).CopyTo(Data, 0x80); // Faraway Place (for DP display)
|
||||
}
|
||||
else if ((value < 2000 && value > 111) || (value < 3000 && value > 2010))
|
||||
{
|
||||
// Met location not in DP, set to Mystery Zone (0, illegal) as opposed to Faraway Place
|
||||
BitConverter.GetBytes(Util.SwapEndianness((ushort)0)).CopyTo(Data, 0x46);
|
||||
BitConverter.GetBytes(Util.SwapEndianness((ushort)0)).CopyTo(Data, 0x80);
|
||||
}
|
||||
else
|
||||
{
|
||||
BitConverter.GetBytes(Util.SwapEndianness((ushort)0)).CopyTo(Data, 0x46);
|
||||
BitConverter.GetBytes(Util.SwapEndianness((ushort)value)).CopyTo(Data, 0x80);
|
||||
}
|
||||
}
|
||||
}
|
||||
private byte PKRS { get { return Data[0x82]; } set { Data[0x82] = value; } }
|
||||
public override int PKRS_Days { get { return PKRS & 0xF; } set { PKRS = (byte)(PKRS & ~0xF | value); } }
|
||||
public override int PKRS_Strain { get { return PKRS >> 4; } set { PKRS = (byte)(PKRS & 0xF | (value << 4)); } }
|
||||
public override int Ball
|
||||
{
|
||||
get
|
||||
{
|
||||
// Pokemon obtained in HGSS have the HGSS ball set (@0x86)
|
||||
// However, this info is not set when receiving a wondercard!
|
||||
// The PGT contains a preformatted PK4 file, which is slightly modified.
|
||||
// No HGSS balls were used, and no HGSS ball info is set.
|
||||
|
||||
// Sneaky way = return the higher of the two values.
|
||||
return Math.Max(Data[0x86], Data[0x83]);
|
||||
}
|
||||
set
|
||||
{
|
||||
// Ball to display in DPPt
|
||||
Data[0x83] = (byte)(value <= 0x10 ? value : 4); // Cap at Cherish Ball
|
||||
|
||||
// HGSS Exclusive Balls -- If the user wants to screw things up, let them. Any legality checking could catch hax.
|
||||
if (value > 0x10 || (HGSS && !FatefulEncounter))
|
||||
Data[0x86] = (byte)(value <= 0x18 ? value : 4); // Cap at Comp Ball
|
||||
else
|
||||
Data[0x86] = 0; // Unused
|
||||
}
|
||||
}
|
||||
public override int Met_Level { get { return Data[0x84] >> 1; } set { Data[0x84] = (byte)((Data[0x84] & 0x1) | value << 1); } }
|
||||
public override int OT_Gender { get { return Data[0x84] & 1; } set { Data[0x84] = (byte)((Data[0x84] & ~0x1) | value & 1); } }
|
||||
public override int EncounterType { get { return Data[0x85]; } set { Data[0x85] = (byte)value; } }
|
||||
// Unused 0x87
|
||||
#endregion
|
||||
|
||||
public override int Stat_Level { get { return Data[0x8C]; } set { Data[0x8C] = (byte)value; } }
|
||||
public override int Stat_HPCurrent { get { return Util.SwapEndianness(BitConverter.ToUInt16(Data, 0x8E)); } set { BitConverter.GetBytes(Util.SwapEndianness((ushort)value)).CopyTo(Data, 0x8E); } }
|
||||
public override int Stat_HPMax { get { return Util.SwapEndianness(BitConverter.ToUInt16(Data, 0x90)); } set { BitConverter.GetBytes(Util.SwapEndianness((ushort)value)).CopyTo(Data, 0x90); } }
|
||||
public override int Stat_ATK { get { return Util.SwapEndianness(BitConverter.ToUInt16(Data, 0x92)); } set { BitConverter.GetBytes(Util.SwapEndianness((ushort)value)).CopyTo(Data, 0x92); } }
|
||||
public override int Stat_DEF { get { return Util.SwapEndianness(BitConverter.ToUInt16(Data, 0x94)); } set { BitConverter.GetBytes(Util.SwapEndianness((ushort)value)).CopyTo(Data, 0x94); } }
|
||||
public override int Stat_SPE { get { return Util.SwapEndianness(BitConverter.ToUInt16(Data, 0x96)); } set { BitConverter.GetBytes(Util.SwapEndianness((ushort)value)).CopyTo(Data, 0x96); } }
|
||||
public override int Stat_SPA { get { return Util.SwapEndianness(BitConverter.ToUInt16(Data, 0x98)); } set { BitConverter.GetBytes(Util.SwapEndianness((ushort)value)).CopyTo(Data, 0x98); } }
|
||||
public override int Stat_SPD { get { return Util.SwapEndianness(BitConverter.ToUInt16(Data, 0x9A)); } set { BitConverter.GetBytes(Util.SwapEndianness((ushort)value)).CopyTo(Data, 0x9A); } }
|
||||
|
||||
public override int PSV => (int)((PID >> 16 ^ PID & 0xFFFF) >> 3);
|
||||
public override int TSV => (TID ^ SID) >> 3;
|
||||
public override int Characteristic
|
||||
{
|
||||
get
|
||||
{
|
||||
// Characteristic with PID%6
|
||||
int pm6 = (int)(PID % 6); // PID MOD 6
|
||||
int maxIV = IVs.Max();
|
||||
int pm6stat = 0;
|
||||
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
pm6stat = (pm6 + i) % 6;
|
||||
if (IVs[pm6stat] == maxIV)
|
||||
break; // P%6 is this stat
|
||||
}
|
||||
return pm6stat * 5 + maxIV % 5;
|
||||
}
|
||||
}
|
||||
|
||||
// Methods
|
||||
public override bool getGenderIsValid()
|
||||
{
|
||||
int gv = PersonalTable.HGSS[Species].Gender;
|
||||
|
||||
if (gv == 255)
|
||||
return Gender == 2;
|
||||
if (gv == 254)
|
||||
return Gender == 0;
|
||||
if (gv == 0)
|
||||
return Gender == 1;
|
||||
if (gv <= (PID & 0xFF))
|
||||
return Gender == 0;
|
||||
if ((PID & 0xFF) < gv)
|
||||
return Gender == 1;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected override ushort CalculateChecksum()
|
||||
{
|
||||
ushort chk = 0;
|
||||
for (int i = 8; i < SIZE_STORED; i += 2)
|
||||
chk += Util.SwapEndianness(BitConverter.ToUInt16(Data, i));
|
||||
return chk;
|
||||
}
|
||||
|
||||
public override byte[] Encrypt()
|
||||
{
|
||||
RefreshChecksum();
|
||||
return PKX.shuffleArray45(Data, PKX.blockPositionInvert[((PID & 0x3E000) >> 0xD)%24]);
|
||||
}
|
||||
|
||||
public PK4 convertToPK4()
|
||||
{
|
||||
PK4 pk4 = new PK4();
|
||||
foreach (string property in ReflectUtil.getPropertiesCanWritePublic(typeof(PK4)).Intersect(ReflectUtil.getPropertiesCanWritePublic(typeof(BK4))))
|
||||
{
|
||||
var prop = ReflectUtil.GetValue(this, property);
|
||||
if (prop != null)
|
||||
ReflectUtil.SetValue(pk4, property, prop);
|
||||
}
|
||||
// Fix Non-Reflectable properties
|
||||
Array.Copy(Data, 0x78, pk4.Data, 0x78, 6); // Met Info
|
||||
for (int i = 0; i < 11; i++) // Nickname
|
||||
{
|
||||
Data.Skip(0x48 + 2 * i).Take(2).Reverse().ToArray().CopyTo(pk4.Data, 0x48 + 2 * i);
|
||||
}
|
||||
for (int i = 0; i < 8; i++) // OT_Name
|
||||
{
|
||||
Data.Skip(0x68 + 2 * i).Take(2).Reverse().ToArray().CopyTo(pk4.Data, 0x68 + 2 * i);
|
||||
}
|
||||
pk4.Sanity = 0;
|
||||
pk4.RefreshChecksum();
|
||||
return pk4;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -405,6 +405,30 @@ namespace PKHeX
|
|||
return PKX.encryptArray45(Data);
|
||||
}
|
||||
|
||||
public BK4 convertToBK4()
|
||||
{
|
||||
BK4 bk4 = new BK4();
|
||||
foreach (string property in ReflectUtil.getPropertiesCanWritePublic(typeof(PK4)).Intersect(ReflectUtil.getPropertiesCanWritePublic(typeof(BK4))))
|
||||
{
|
||||
var prop = ReflectUtil.GetValue(this, property);
|
||||
if (prop != null)
|
||||
ReflectUtil.SetValue(bk4, property, prop);
|
||||
}
|
||||
// Fix Non-Reflectable properties
|
||||
Array.Copy(Data, 0x78, bk4.Data, 0x78, 6); // Met Info
|
||||
for (int i = 0; i < 11; i++) // Nickname
|
||||
{
|
||||
Data.Skip(0x48 + 2*i).Take(2).Reverse().ToArray().CopyTo(bk4.Data, 0x48 + 2*i);
|
||||
}
|
||||
for (int i = 0; i < 8; i++) // OT_Name
|
||||
{
|
||||
Data.Skip(0x68 + 2 * i).Take(2).Reverse().ToArray().CopyTo(bk4.Data, 0x68 + 2 * i);
|
||||
}
|
||||
bk4.Sanity = 0x4000;
|
||||
bk4.RefreshChecksum();
|
||||
return bk4;
|
||||
}
|
||||
|
||||
public PK5 convertToPK5()
|
||||
{
|
||||
// Double Check Location Data to see if we're already a PK5
|
||||
|
|
|
@ -8,7 +8,7 @@ namespace PKHeX
|
|||
{
|
||||
public abstract int SIZE_PARTY { get; }
|
||||
public abstract int SIZE_STORED { get; }
|
||||
public string Extension => "pk" + Format;
|
||||
public virtual string Extension => "pk" + Format;
|
||||
|
||||
// Internal Attributes set on creation
|
||||
public byte[] Data; // Raw Storage
|
||||
|
@ -22,7 +22,7 @@ namespace PKHeX
|
|||
public virtual byte[] DecryptedBoxData => Write().Take(SIZE_STORED).ToArray();
|
||||
public virtual bool Valid => ChecksumValid && Sanity == 0;
|
||||
|
||||
protected ushort CalculateChecksum()
|
||||
protected virtual ushort CalculateChecksum()
|
||||
{
|
||||
ushort chk = 0;
|
||||
switch (Format)
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace PKHeX
|
||||
{
|
||||
|
@ -43,7 +45,7 @@ namespace PKHeX
|
|||
case PKX.SIZE_4PARTY:
|
||||
case PKX.SIZE_4STORED:
|
||||
case PKX.SIZE_5PARTY:
|
||||
if ((BitConverter.ToUInt16(data, 0x80) >= 0x3333 || data[0x5F] >= 0x10) && BitConverter.ToUInt16(data, 0x46) == 0) // PK5
|
||||
if (((BitConverter.ToUInt16(data, 0x4) == 0) && (BitConverter.ToUInt16(data, 0x80) >= 0x3333 || data[0x5F] >= 0x10)) && BitConverter.ToUInt16(data, 0x46) == 0) // PK5
|
||||
return 5;
|
||||
return 4;
|
||||
case PKX.SIZE_6STORED:
|
||||
|
@ -89,7 +91,14 @@ namespace PKHeX
|
|||
case 3:
|
||||
return new PK3(data, ident);
|
||||
case 4:
|
||||
return new PK4(data, ident);
|
||||
var pk = new PK4(data, ident);
|
||||
if (!pk.Valid || pk.Sanity != 0)
|
||||
{
|
||||
var bk = new BK4(data, ident);
|
||||
if (bk.Valid)
|
||||
return bk;
|
||||
}
|
||||
return pk;
|
||||
case 5:
|
||||
return new PK5(data, ident);
|
||||
case 6:
|
||||
|
@ -98,7 +107,7 @@ namespace PKHeX
|
|||
return null;
|
||||
}
|
||||
}
|
||||
internal static PKM convertToFormat(PKM pk, int Format, out string comment)
|
||||
internal static PKM convertToFormat(PKM pk, Type PKMType, out string comment)
|
||||
{
|
||||
if (pk == null || pk.Species == 0)
|
||||
{
|
||||
|
@ -106,67 +115,109 @@ namespace PKHeX
|
|||
return null;
|
||||
}
|
||||
|
||||
string currentFormat = pk.Format.ToString();
|
||||
PKM pkm = pk.Clone();
|
||||
Type fromType = pk.GetType();
|
||||
int fromFormat = int.Parse(fromType.Name.Last().ToString());
|
||||
int toFormat = int.Parse(PKMType.Name.Last().ToString());
|
||||
Console.WriteLine($"Trying to convert {fromType.Name} to {PKMType.Name}.");
|
||||
|
||||
if (pk.Format == Format)
|
||||
PKM pkm = null;
|
||||
|
||||
if (fromType == PKMType)
|
||||
{
|
||||
comment = "No need to convert, current format matches requested format.";
|
||||
return pk;
|
||||
}
|
||||
if (pk.Format <= 2 && Format <= 2) // 1<->2, already checked not equal
|
||||
if (fromFormat <= toFormat)
|
||||
{
|
||||
switch (Format)
|
||||
pkm = pk.Clone();
|
||||
if (pkm.IsEgg) // force hatch
|
||||
{
|
||||
case 1:
|
||||
if (pk.Species > 151)
|
||||
{ comment = $"Cannot convert a {PKX.getSpeciesName(pk.Species, ((PK2)pk).Japanese ? 1 : 2)} to pk{Format}"; return null; }
|
||||
pkm = ((PK2)pk).convertToPK1();
|
||||
pkm.IsEgg = false;
|
||||
if (pkm.AO)
|
||||
pkm.Met_Location = 318; // Battle Resort
|
||||
else if (pkm.XY)
|
||||
pkm.Met_Location = 38; // Route 7
|
||||
else if (pkm.Gen5)
|
||||
pkm.Met_Location = 16; // Route 16
|
||||
else
|
||||
pkm.Met_Location = 30001; // Pokétransfer
|
||||
}
|
||||
switch (fromType.Name)
|
||||
{
|
||||
case "PK1":
|
||||
if (PKMType == typeof(PK2))
|
||||
{
|
||||
if (pk.Species > 151)
|
||||
{
|
||||
comment = $"Cannot convert a {PKX.getSpeciesName(pk.Species, ((PK2)pk).Japanese ? 1 : 2)} to {PKMType.Name}";
|
||||
return null;
|
||||
}
|
||||
pkm = ((PK2)pk).convertToPK1();
|
||||
}
|
||||
else
|
||||
pkm = null;
|
||||
break;
|
||||
case 2:
|
||||
pkm = ((PK1)pk).convertToPK2();
|
||||
case "PK2":
|
||||
if (PKMType == typeof(PK1))
|
||||
{
|
||||
pkm = ((PK1)pk).convertToPK2();
|
||||
}
|
||||
else
|
||||
pkm = null;
|
||||
break;
|
||||
case "PK3":
|
||||
if (toFormat == 3)
|
||||
{
|
||||
// Colo/XD stuff here!
|
||||
}
|
||||
pkm = ((PK3)pkm).convertToPK4();
|
||||
if (toFormat == 4)
|
||||
{
|
||||
if (PKMType == typeof (BK4))
|
||||
pkm = ((PK4) pkm).convertToBK4();
|
||||
break;
|
||||
}
|
||||
pkm = ((PK4)pkm).convertToPK5();
|
||||
if (toFormat == 5)
|
||||
break;
|
||||
pkm = ((PK5)pkm).convertToPK6();
|
||||
break;
|
||||
case "PK4":
|
||||
if (PKMType == typeof(BK4))
|
||||
{
|
||||
pkm = ((PK4)pkm).convertToBK4();
|
||||
break;
|
||||
}
|
||||
pkm = ((PK4)pkm).convertToPK5();
|
||||
if (toFormat == 5)
|
||||
break;
|
||||
pkm = ((PK5)pkm).convertToPK6();
|
||||
break;
|
||||
case "BK4":
|
||||
pkm = ((BK4)pkm).convertToPK4();
|
||||
if (toFormat == 4)
|
||||
break;
|
||||
pkm = ((PK4)pkm).convertToPK5();
|
||||
if (toFormat == 5)
|
||||
break;
|
||||
pkm = ((PK5)pkm).convertToPK6();
|
||||
break;
|
||||
case "PK5":
|
||||
pkm = ((PK5)pkm).convertToPK6();
|
||||
break;
|
||||
case "PK6":
|
||||
// This shouldn't happen before Sun/Moon.
|
||||
break;
|
||||
}
|
||||
comment = $"Converted from pk{pk.Format} to pk{Format}";
|
||||
return pkm;
|
||||
}
|
||||
if (pk.Format > Format)
|
||||
if (pkm == null)
|
||||
{
|
||||
comment = "Cannot convert a PKM backwards." + Environment.NewLine
|
||||
+ "Current Format: " + pk.Format + Environment.NewLine
|
||||
+ "Desired Format: " + Format;
|
||||
return null;
|
||||
comment = $"Cannot convert a {fromType.Name} to a {PKMType.Name}.";
|
||||
}
|
||||
if ((pk.Format == 1 || pk.Format == 2) && 2 < Format && Format < 7)
|
||||
else
|
||||
{
|
||||
comment = $"Cannot convert a PK{pk.Format} to a PK{Format}.";
|
||||
return null;
|
||||
comment = $"Converted from {fromType.Name} to {PKMType.Name}.";
|
||||
}
|
||||
if (pk.Format == 1 && Format == 7)
|
||||
{
|
||||
comment = "PK1 to PK7 conversion is not yet supported." + Environment.NewLine
|
||||
+ "Please wait for Sun/Moon to release and documentation to occur.";
|
||||
return null;
|
||||
}
|
||||
if (pkm.IsEgg) // force hatch
|
||||
{
|
||||
pkm.IsEgg = false;
|
||||
if (pkm.AO)
|
||||
pkm.Met_Location = 318; // Battle Resort
|
||||
else if (pkm.XY)
|
||||
pkm.Met_Location = 38; // Route 7
|
||||
else if (pkm.Gen5)
|
||||
pkm.Met_Location = 16; // Route 16
|
||||
else
|
||||
pkm.Met_Location = 30001; // Pokétransfer
|
||||
}
|
||||
if (pkm.Format == 3 && Format > 3)
|
||||
pkm = ((PK3) pkm).convertToPK4();
|
||||
if (pkm.Format == 4 && Format > 4)
|
||||
pkm = ((PK4) pkm).convertToPK5();
|
||||
if (pkm.Format == 5 && Format > 5)
|
||||
pkm = ((PK5) pkm).convertToPK6();
|
||||
comment = $"Converted from pk{currentFormat} to pk{Format}";
|
||||
return pkm;
|
||||
}
|
||||
internal static void checkEncrypted(ref byte[] pkm)
|
||||
|
@ -180,6 +231,8 @@ namespace PKHeX
|
|||
return;
|
||||
case 4:
|
||||
case 5:
|
||||
if (BitConverter.ToUInt16(pkm, 4) != 0) // BK4
|
||||
return;
|
||||
for (int i = 8; i < PKX.SIZE_4STORED; i += 2)
|
||||
chk += BitConverter.ToUInt16(pkm, i);
|
||||
if (chk != BitConverter.ToUInt16(pkm, 0x06))
|
||||
|
|
|
@ -581,7 +581,7 @@ namespace PKHeX
|
|||
}
|
||||
|
||||
// Personal.dat
|
||||
public static string[] getFormList(int species, string[] t, string[] f, string[] g)
|
||||
public static string[] getFormList(int species, string[] t, string[] f, string[] g, int generation = 6)
|
||||
{
|
||||
// Mega List
|
||||
if (Array.IndexOf(new[]
|
||||
|
@ -708,6 +708,49 @@ namespace PKHeX
|
|||
};
|
||||
|
||||
case 493:
|
||||
if (generation == 4)
|
||||
return new[]
|
||||
{
|
||||
t[00], // Normal
|
||||
t[01], // Fighting
|
||||
t[02], // Flying
|
||||
t[03], // Poison
|
||||
t[04], // etc
|
||||
t[05],
|
||||
t[06],
|
||||
t[07],
|
||||
t[08],
|
||||
"???", // ???-type arceus
|
||||
t[09],
|
||||
t[10],
|
||||
t[11],
|
||||
t[12],
|
||||
t[13],
|
||||
t[14],
|
||||
t[15],
|
||||
t[16] // No Fairy Type
|
||||
};
|
||||
if (generation == 5)
|
||||
return new[]
|
||||
{
|
||||
t[00], // Normal
|
||||
t[01], // Fighting
|
||||
t[02], // Flying
|
||||
t[03], // Poison
|
||||
t[04], // etc
|
||||
t[05],
|
||||
t[06],
|
||||
t[07],
|
||||
t[08],
|
||||
t[09],
|
||||
t[10],
|
||||
t[11],
|
||||
t[12],
|
||||
t[13],
|
||||
t[14],
|
||||
t[15],
|
||||
t[16] // No Fairy type
|
||||
};
|
||||
return new[]
|
||||
{
|
||||
t[00], // Normal
|
||||
|
@ -1054,6 +1097,35 @@ namespace PKHeX
|
|||
return strdata;
|
||||
}
|
||||
|
||||
public static string array2strG4BE(byte[] strdata)
|
||||
{
|
||||
string s = "";
|
||||
for (int i = 0; i < strdata.Length; i += 2)
|
||||
{
|
||||
ushort val = Util.SwapEndianness(BitConverter.ToUInt16(strdata, i));
|
||||
if (val == 0xFFFF) break;
|
||||
ushort chr = val2charG4(val);
|
||||
if (chr == 0xFFFF) break;
|
||||
s += (char)chr;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
public static byte[] str2arrayG4BE(string str)
|
||||
{
|
||||
byte[] strdata = new byte[str.Length * 2 + 2]; // +2 for 0xFFFF
|
||||
for (int i = 0; i < str.Length; i++)
|
||||
{
|
||||
ushort chr = str[i];
|
||||
ushort val = char2valG4(chr);
|
||||
if (val == 0xFFFF || chr == 0xFFFF)
|
||||
{ Array.Resize(ref strdata, i * 2); break; }
|
||||
BitConverter.GetBytes(Util.SwapEndianness(val)).CopyTo(strdata, i * 2);
|
||||
}
|
||||
BitConverter.GetBytes((ushort)0xFFFF).CopyTo(strdata, strdata.Length - 2);
|
||||
return strdata;
|
||||
}
|
||||
|
||||
// Gen3 && 3->4 Conversion has two character tables, and translates to the same character map.
|
||||
public static ushort getG4Val(byte val, bool jp) { return jp ? G34_4J[val] : G34_4E[val]; }
|
||||
public static ushort getG3Char(byte val, bool jp) { return val2charG4(getG4Val(val, jp)); }
|
||||
|
|
|
@ -159,7 +159,7 @@ namespace PKHeX
|
|||
public int SIZE_STOREDBOX => PokemonList1.GetDataLength(Japanese ? PokemonList1.CapacityType.StoredJP : PokemonList1.CapacityType.Stored, Japanese);
|
||||
|
||||
public override PKM BlankPKM => new PK1(null, null, Japanese);
|
||||
protected override Type PKMType => typeof(PK1);
|
||||
public override Type PKMType => typeof(PK1);
|
||||
|
||||
public override int MaxMoveID => 165;
|
||||
public override int MaxSpeciesID => 151;
|
||||
|
|
|
@ -208,7 +208,7 @@ namespace PKHeX
|
|||
public int SIZE_STOREDBOX => PokemonList2.GetDataLength(Japanese ? PokemonList2.CapacityType.StoredJP : PokemonList2.CapacityType.Stored, Japanese);
|
||||
|
||||
public override PKM BlankPKM => new PK2(null, null, Japanese);
|
||||
protected override Type PKMType => typeof(PK2);
|
||||
public override Type PKMType => typeof(PK2);
|
||||
|
||||
public override int MaxMoveID => 251;
|
||||
public override int MaxSpeciesID => 251;
|
||||
|
|
|
@ -157,7 +157,7 @@ namespace PKHeX
|
|||
public override int SIZE_STORED => PKX.SIZE_3STORED;
|
||||
public override int SIZE_PARTY => PKX.SIZE_3PARTY;
|
||||
public override PKM BlankPKM => new PK3();
|
||||
protected override Type PKMType => typeof(PK3);
|
||||
public override Type PKMType => typeof(PK3);
|
||||
|
||||
public override int MaxMoveID => 354;
|
||||
public override int MaxSpeciesID => 386;
|
||||
|
|
|
@ -108,7 +108,7 @@ namespace PKHeX
|
|||
public override int SIZE_STORED => PKX.SIZE_3CSTORED;
|
||||
public override int SIZE_PARTY => PKX.SIZE_3CSTORED; // unused
|
||||
public override PKM BlankPKM => new CK3();
|
||||
protected override Type PKMType => typeof(CK3);
|
||||
public override Type PKMType => typeof(CK3);
|
||||
|
||||
public override int MaxMoveID => 354;
|
||||
public override int MaxSpeciesID => 386;
|
||||
|
|
|
@ -71,7 +71,7 @@ namespace PKHeX
|
|||
public override int SIZE_STORED => PKX.SIZE_3STORED + 4;
|
||||
public override int SIZE_PARTY => PKX.SIZE_3PARTY; // unused
|
||||
public override PKM BlankPKM => new PK3();
|
||||
protected override Type PKMType => typeof(PK3);
|
||||
public override Type PKMType => typeof(PK3);
|
||||
|
||||
public override int MaxMoveID => 354;
|
||||
public override int MaxSpeciesID => 386;
|
||||
|
|
|
@ -88,7 +88,7 @@ namespace PKHeX
|
|||
public override int SIZE_STORED => PKX.SIZE_3XSTORED;
|
||||
public override int SIZE_PARTY => PKX.SIZE_3XSTORED; // unused
|
||||
public override PKM BlankPKM => new XK3();
|
||||
protected override Type PKMType => typeof(XK3);
|
||||
public override Type PKMType => typeof(XK3);
|
||||
|
||||
public override int MaxMoveID => 354;
|
||||
public override int MaxSpeciesID => 386;
|
||||
|
|
|
@ -44,7 +44,7 @@ namespace PKHeX
|
|||
public override int SIZE_STORED => PKX.SIZE_4STORED;
|
||||
public override int SIZE_PARTY => PKX.SIZE_4PARTY;
|
||||
public override PKM BlankPKM => new PK4();
|
||||
protected override Type PKMType => typeof(PK4);
|
||||
public override Type PKMType => typeof(PK4);
|
||||
|
||||
public override int BoxCount => 18;
|
||||
public override int MaxEV => 255;
|
||||
|
|
306
PKHeX/Saves/SAV4BR.cs
Normal file
306
PKHeX/Saves/SAV4BR.cs
Normal file
|
@ -0,0 +1,306 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace PKHeX
|
||||
{
|
||||
public sealed class SAV4BR : SaveFile
|
||||
{
|
||||
public override string BAKName => $"{FileName} [{Version} #{SaveCount.ToString("0000")}].bak";
|
||||
public override string Filter => "PbrSaveData|*";
|
||||
public override string Extension => "";
|
||||
|
||||
public SAV4BR(byte[] data = null)
|
||||
{
|
||||
Data = data == null ? new byte[SaveUtil.SIZE_G4BR] : (byte[])data.Clone();
|
||||
BAK = (byte[])Data.Clone();
|
||||
Exportable = !Data.SequenceEqual(new byte[Data.Length]);
|
||||
|
||||
if (SaveUtil.getIsG4BRSAV(Data) != GameVersion.BATREV)
|
||||
return;
|
||||
|
||||
Data = DecryptPBRSaveData(data);
|
||||
|
||||
// Detect active save
|
||||
if (Util.SwapEndianness(BitConverter.ToUInt32(Data, 0x1C004C)) >
|
||||
Util.SwapEndianness(BitConverter.ToUInt32(Data, 0x4C)))
|
||||
{
|
||||
byte[] tempData = new byte[0x1C0000];
|
||||
Array.Copy(Data, 0, tempData, 0, 0x1C0000);
|
||||
Array.Copy(Data, 0x1C0000, Data, 0, 0x1C0000);
|
||||
tempData.CopyTo(Data, 0x1C0000);
|
||||
}
|
||||
|
||||
SaveSlots = new List<int>();
|
||||
SaveNames = new string[4];
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
if (BitConverter.ToUInt16(Data, 0x390 + 0x6FF00*i) != 0)
|
||||
{
|
||||
SaveSlots.Add(i);
|
||||
SaveNames[i] = Encoding.BigEndianUnicode.GetString(Data, 0x390 + 0x6FF00*i, 0x10);
|
||||
}
|
||||
}
|
||||
|
||||
CurrentSlot = SaveSlots.First();
|
||||
|
||||
Personal = PersonalTable.DP;
|
||||
HeldItems = Legal.HeldItems_DP;
|
||||
|
||||
if (!Exportable)
|
||||
resetBoxes();
|
||||
}
|
||||
|
||||
private readonly int SaveCount;
|
||||
public override byte[] Write(bool dsv = false)
|
||||
{
|
||||
setChecksums();
|
||||
return EncryptPBRSaveData(Data);
|
||||
}
|
||||
|
||||
// Configuration
|
||||
public override SaveFile Clone() { return new SAV4BR(Write()); }
|
||||
|
||||
public List<int> SaveSlots;
|
||||
public string[] SaveNames;
|
||||
public int CurrentSlot;
|
||||
protected override int Box {
|
||||
get { return 0x978 + 0x6FF00*CurrentSlot; }
|
||||
set { }
|
||||
}
|
||||
|
||||
public override int SIZE_STORED => PKX.SIZE_4STORED;
|
||||
public override int SIZE_PARTY => PKX.SIZE_4PARTY - 0x10; // PBR has a party
|
||||
public override PKM BlankPKM => new BK4();
|
||||
public override Type PKMType => typeof(BK4);
|
||||
|
||||
public override int MaxMoveID => 467;
|
||||
public override int MaxSpeciesID => 493;
|
||||
public override int MaxAbilityID => 123;
|
||||
public override int MaxItemID => 536;
|
||||
public override int MaxBallID => 0x18;
|
||||
public override int MaxGameID => 15;
|
||||
|
||||
public override int MaxEV => 255;
|
||||
public override int Generation => 4;
|
||||
protected override int GiftCountMax => 1;
|
||||
public override int OTLength => 8;
|
||||
public override int NickLength => 10;
|
||||
public override int MaxMoney => 999999;
|
||||
|
||||
public override int BoxCount => 18;
|
||||
public override bool HasParty => false;
|
||||
|
||||
// Checksums
|
||||
protected override void setChecksums()
|
||||
{
|
||||
SetChecksum(Data, 0, 0x100, 8);
|
||||
SetChecksum(Data, 0, 0x1C0000, 0x1BFF80);
|
||||
SetChecksum(Data, 0x1C0000, 0x100, 0x1C0008);
|
||||
SetChecksum(Data, 0x1C0000, 0x1C0000, 0x1BFF80 + 0x1C0000);
|
||||
}
|
||||
public override bool ChecksumsValid
|
||||
{
|
||||
get {
|
||||
bool valid = VerifyChecksum(Data, 0, 0x1C0000, 0x1BFF80);
|
||||
valid &= VerifyChecksum(Data, 0, 0x100, 8);
|
||||
valid &= VerifyChecksum(Data, 0x1C0000, 0x1C0000, 0x1BFF80 + 0x1C0000);
|
||||
valid &= VerifyChecksum(Data, 0x1C0000, 0x100, 0x1C0008);
|
||||
return valid;
|
||||
}
|
||||
}
|
||||
public override string ChecksumInfo
|
||||
{
|
||||
get
|
||||
{
|
||||
return $"Checksums valid: {ChecksumsValid}.";
|
||||
}
|
||||
}
|
||||
|
||||
// Trainer Info
|
||||
public override GameVersion Version { get { return GameVersion.BATREV; } protected set { } }
|
||||
|
||||
// Storage
|
||||
public override int getPartyOffset(int slot)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
public override int getBoxOffset(int box)
|
||||
{
|
||||
return Box + SIZE_STORED * box * 30;
|
||||
}
|
||||
public override int CurrentBox
|
||||
{
|
||||
get { return 0; }
|
||||
set { /* This isn't a real field. */ }
|
||||
}
|
||||
public override int getBoxWallpaper(int box)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
public override string getBoxName(int box)
|
||||
{
|
||||
return $"BOX {box + 1}";
|
||||
}
|
||||
public override void setBoxName(int box, string value)
|
||||
{
|
||||
/* No custom box names here. */
|
||||
}
|
||||
public override PKM getPKM(byte[] data)
|
||||
{
|
||||
byte[] pkm = data.Take(SIZE_STORED).ToArray();
|
||||
PKM bk = new BK4(pkm);
|
||||
return bk;
|
||||
}
|
||||
public override byte[] decryptPKM(byte[] data)
|
||||
{
|
||||
return data;
|
||||
}
|
||||
|
||||
protected override void setDex(PKM pkm) { }
|
||||
|
||||
public override void setStoredSlot(PKM pkm, int offset, bool? trade = null, bool? dex = null)
|
||||
{
|
||||
if (pkm == null) return;
|
||||
if (pkm.GetType() != PKMType)
|
||||
throw new InvalidCastException($"PKM Format needs to be {PKMType} when setting to a Battle Revolution Save File.");
|
||||
if (trade ?? SetUpdatePKM)
|
||||
setPKM(pkm);
|
||||
if (dex ?? SetUpdateDex)
|
||||
setDex(pkm);
|
||||
byte[] data = pkm.EncryptedBoxData;
|
||||
setData(data, offset);
|
||||
|
||||
Edited = true;
|
||||
}
|
||||
|
||||
public static byte[] DecryptPBRSaveData(byte[] input)
|
||||
{
|
||||
byte[] output = new byte[input.Length];
|
||||
for (int base_ofs = 0; base_ofs < SaveUtil.SIZE_G4BR; base_ofs += 0x1C0000)
|
||||
{
|
||||
|
||||
Array.Copy(input, base_ofs, output, base_ofs, 8);
|
||||
|
||||
ushort[] keys = new ushort[4];
|
||||
for (int i = 0; i < keys.Length; i++)
|
||||
keys[i] = Util.SwapEndianness(BitConverter.ToUInt16(input, base_ofs + i * 2));
|
||||
|
||||
for (int ofs = base_ofs + 8; ofs < base_ofs + 0x1C0000; ofs += 8)
|
||||
{
|
||||
for (int i = 0; i < keys.Length; i++)
|
||||
{
|
||||
ushort val = Util.SwapEndianness(BitConverter.ToUInt16(input, ofs + i*2));
|
||||
val -= keys[i];
|
||||
BitConverter.GetBytes(Util.SwapEndianness(val)).CopyTo(output, ofs + i*2);
|
||||
}
|
||||
ushort[] oldKeys = (ushort[])keys.Clone();
|
||||
oldKeys[0] += 0x43;
|
||||
oldKeys[1] += 0x29;
|
||||
oldKeys[2] += 0x17;
|
||||
oldKeys[3] += 0x13;
|
||||
keys[0] = (ushort)((oldKeys[0] & 0xf) | ((oldKeys[1] << 4) & 0xf0) | ((oldKeys[2] << 8) & 0xf00) | ((oldKeys[3] << 12) & 0xf000));
|
||||
keys[1] = (ushort)(((oldKeys[0] >> 4) & 0xf) | (oldKeys[1] & 0xf0) | ((oldKeys[2] << 4) & 0xf00) | ((oldKeys[3] << 8) & 0xf000));
|
||||
keys[2] = (ushort)((oldKeys[2] & 0xf00) | ((oldKeys[1] & 0xf00) >> 4) | ((oldKeys[0] & 0xf00) >> 8) | ((oldKeys[3] << 4) & 0xf000));
|
||||
keys[3] = (ushort)(((oldKeys[0] >> 12) & 0xf) | ((oldKeys[1] >> 8) & 0xf0) | ((oldKeys[2] >> 4) & 0xf00) | (oldKeys[3] & 0xf000));
|
||||
}
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
||||
public static byte[] EncryptPBRSaveData(byte[] input)
|
||||
{
|
||||
byte[] output = new byte[input.Length];
|
||||
for (int base_ofs = 0; base_ofs < SaveUtil.SIZE_G4BR; base_ofs += 0x1C0000)
|
||||
{
|
||||
|
||||
Array.Copy(input, base_ofs, output, base_ofs, 8);
|
||||
|
||||
ushort[] keys = new ushort[4];
|
||||
for (int i = 0; i < keys.Length; i++)
|
||||
keys[i] = Util.SwapEndianness(BitConverter.ToUInt16(input, base_ofs + i * 2));
|
||||
|
||||
for (int ofs = base_ofs + 8; ofs < base_ofs + 0x1C0000; ofs += 8)
|
||||
{
|
||||
for (int i = 0; i < keys.Length; i++)
|
||||
{
|
||||
ushort val = Util.SwapEndianness(BitConverter.ToUInt16(input, ofs + i * 2));
|
||||
val += keys[i];
|
||||
BitConverter.GetBytes(Util.SwapEndianness(val)).CopyTo(output, ofs + i * 2);
|
||||
}
|
||||
ushort[] oldKeys = (ushort[])keys.Clone();
|
||||
oldKeys[0] += 0x43;
|
||||
oldKeys[1] += 0x29;
|
||||
oldKeys[2] += 0x17;
|
||||
oldKeys[3] += 0x13;
|
||||
keys[0] = (ushort)((oldKeys[0] & 0xf) | ((oldKeys[1] << 4) & 0xf0) | ((oldKeys[2] << 8) & 0xf00) | ((oldKeys[3] << 12) & 0xf000));
|
||||
keys[1] = (ushort)(((oldKeys[0] >> 4) & 0xf) | (oldKeys[1] & 0xf0) | ((oldKeys[2] << 4) & 0xf00) | ((oldKeys[3] << 8) & 0xf000));
|
||||
keys[2] = (ushort)((oldKeys[2] & 0xf00) | ((oldKeys[1] & 0xf00) >> 4) | ((oldKeys[0] & 0xf00) >> 8) | ((oldKeys[3] << 4) & 0xf000));
|
||||
keys[3] = (ushort)(((oldKeys[0] >> 12) & 0xf) | ((oldKeys[1] >> 8) & 0xf0) | ((oldKeys[2] >> 4) & 0xf00) | (oldKeys[3] & 0xf000));
|
||||
}
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
||||
public static bool VerifyChecksum(byte[] input, int offset, int len, int checksum_offset)
|
||||
{
|
||||
uint[] storedChecksums = new uint[16];
|
||||
for (int i = 0; i < storedChecksums.Length; i++)
|
||||
{
|
||||
storedChecksums[i] = Util.SwapEndianness(BitConverter.ToUInt32(input, checksum_offset + i*4));
|
||||
BitConverter.GetBytes((uint) 0).CopyTo(input, checksum_offset + i*4);
|
||||
}
|
||||
|
||||
uint[] checksums = new uint[16];
|
||||
|
||||
for (int i = 0; i < len; i += 2)
|
||||
{
|
||||
ushort val = Util.SwapEndianness(BitConverter.ToUInt16(input, offset + i));
|
||||
for (int j = 0; j < 16; j++)
|
||||
{
|
||||
checksums[j] += (uint)((val >> j) & 1);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < storedChecksums.Length; i++)
|
||||
{
|
||||
BitConverter.GetBytes(Util.SwapEndianness(storedChecksums[i])).CopyTo(input, checksum_offset + i*4);
|
||||
}
|
||||
|
||||
return checksums.SequenceEqual(storedChecksums);
|
||||
}
|
||||
|
||||
public static void SetChecksum(byte[] input, int offset, int len, int checksum_offset)
|
||||
{
|
||||
uint[] storedChecksums = new uint[16];
|
||||
for (int i = 0; i < storedChecksums.Length; i++)
|
||||
{
|
||||
storedChecksums[i] = Util.SwapEndianness(BitConverter.ToUInt32(input, checksum_offset + i * 4));
|
||||
BitConverter.GetBytes((uint)0).CopyTo(input, checksum_offset + i * 4);
|
||||
}
|
||||
|
||||
uint[] checksums = new uint[16];
|
||||
|
||||
for (int i = 0; i < len; i += 2)
|
||||
{
|
||||
ushort val = Util.SwapEndianness(BitConverter.ToUInt16(input, offset + i));
|
||||
for (int j = 0; j < 16; j++)
|
||||
{
|
||||
checksums[j] += (uint)((val >> j) & 1);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < checksums.Length; i++)
|
||||
{
|
||||
BitConverter.GetBytes(Util.SwapEndianness(checksums[i])).CopyTo(input, checksum_offset + i * 4);
|
||||
}
|
||||
}
|
||||
|
||||
private void SwapBytes(byte[] input, int offset, int num_bytes)
|
||||
{
|
||||
input.Skip(offset).Take(num_bytes).Reverse().ToArray().CopyTo(input, offset);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -98,7 +98,7 @@ namespace PKHeX
|
|||
public override int SIZE_STORED => PKX.SIZE_5STORED;
|
||||
public override int SIZE_PARTY => PKX.SIZE_5PARTY;
|
||||
public override PKM BlankPKM => new PK5();
|
||||
protected override Type PKMType => typeof(PK5);
|
||||
public override Type PKMType => typeof(PK5);
|
||||
|
||||
public override int BoxCount => 24;
|
||||
public override int MaxEV => 255;
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace PKHeX
|
|||
public override int SIZE_STORED => PKX.SIZE_6STORED;
|
||||
public override int SIZE_PARTY => PKX.SIZE_6PARTY;
|
||||
public override PKM BlankPKM => new PK6();
|
||||
protected override Type PKMType => typeof(PK6);
|
||||
public override Type PKMType => typeof(PK6);
|
||||
|
||||
public override int BoxCount => 31;
|
||||
public override int MaxEV => 252;
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace PKHeX
|
|||
public bool GetJapanese => Japanese;
|
||||
|
||||
// General PKM Properties
|
||||
protected abstract Type PKMType { get; }
|
||||
public abstract Type PKMType { get; }
|
||||
public abstract PKM getPKM(byte[] data);
|
||||
public abstract PKM BlankPKM { get; }
|
||||
public abstract byte[] decryptPKM(byte[] data);
|
||||
|
@ -111,7 +111,7 @@ namespace PKHeX
|
|||
public virtual int MaxMoney { get; } = 9999999;
|
||||
|
||||
// Offsets
|
||||
protected int Box { get; set; } = int.MinValue;
|
||||
protected virtual int Box { get; set; } = int.MinValue;
|
||||
protected int Party { get; set; } = int.MinValue;
|
||||
protected int Trainer1 { get; set; } = int.MinValue;
|
||||
protected int Daycare { get; set; } = int.MinValue;
|
||||
|
|
|
@ -9,8 +9,9 @@ namespace PKHeX
|
|||
public enum GameVersion
|
||||
{
|
||||
/* I don't want to assign Gen I/II... */
|
||||
XD = -7,
|
||||
COLO = -6,
|
||||
XD = -11,
|
||||
COLO = -10,
|
||||
BATREV = -7,
|
||||
RSBOX = -5,
|
||||
GS = -4,
|
||||
C = -3,
|
||||
|
@ -48,6 +49,7 @@ namespace PKHeX
|
|||
internal const int SIZE_G5RAW = 0x80000;
|
||||
internal const int SIZE_G5BW = 0x24000;
|
||||
internal const int SIZE_G5B2W2 = 0x26000;
|
||||
internal const int SIZE_G4BR = 0x380000;
|
||||
internal const int SIZE_G4RAW = 0x80000;
|
||||
internal const int SIZE_G3BOX = 0x76000;
|
||||
internal const int SIZE_G3BOXGCI = 0x76040; // +64 if has GCI data
|
||||
|
@ -87,6 +89,8 @@ namespace PKHeX
|
|||
return (int)GameVersion.RSBOX;
|
||||
if (getIsG4SAV(data) != GameVersion.Invalid)
|
||||
return 4;
|
||||
if (getIsG4BRSAV(data) != GameVersion.Invalid)
|
||||
return (int) GameVersion.BATREV;
|
||||
if (getIsG5SAV(data) != GameVersion.Invalid)
|
||||
return 5;
|
||||
if (getIsG6SAV(data) != GameVersion.Invalid)
|
||||
|
@ -314,6 +318,23 @@ namespace PKHeX
|
|||
|
||||
return GameVersion.Invalid;
|
||||
}
|
||||
/// <summary>Determines the type of 4th gen Battle Revolution</summary>
|
||||
/// <param name="data">Save data of which to determine the type</param>
|
||||
/// <returns>Version Identifier or Invalid if type cannot be determined.</returns>
|
||||
public static GameVersion getIsG4BRSAV(byte[] data)
|
||||
{
|
||||
if (data.Length != SIZE_G4BR)
|
||||
return GameVersion.Invalid;
|
||||
|
||||
byte[] sav = SAV4BR.DecryptPBRSaveData(data);
|
||||
|
||||
bool valid = SAV4BR.VerifyChecksum(sav, 0, 0x1C0000, 0x1BFF80);
|
||||
valid &= SAV4BR.VerifyChecksum(sav, 0, 0x100, 8);
|
||||
valid &= SAV4BR.VerifyChecksum(sav, 0x1C0000, 0x1C0000, 0x1BFF80 + 0x1C0000);
|
||||
valid &= SAV4BR.VerifyChecksum(sav, 0x1C0000, 0x100, 0x1C0008);
|
||||
|
||||
return valid ? GameVersion.BATREV : GameVersion.Invalid;
|
||||
}
|
||||
/// <summary>Determines the type of 5th gen save</summary>
|
||||
/// <param name="data">Save data of which to determine the type</param>
|
||||
/// <returns>Version Identifier or Invalid if type cannot be determined.</returns>
|
||||
|
@ -436,6 +457,8 @@ namespace PKHeX
|
|||
return new SAV3XD(data);
|
||||
case 4:
|
||||
return new SAV4(data);
|
||||
case (int)GameVersion.BATREV:
|
||||
return new SAV4BR(data);
|
||||
case 5:
|
||||
return new SAV5(data);
|
||||
case 6:
|
||||
|
|
|
@ -239,7 +239,7 @@ namespace PKHeX
|
|||
PKM temp = mg != null ? mg.convertToPKM(SAV) : PKMConverter.getPKMfromBytes(data);
|
||||
string c;
|
||||
|
||||
PKM pk = PKMConverter.convertToFormat(temp, SAV.Generation, out c);
|
||||
PKM pk = PKMConverter.convertToFormat(temp, SAV.PKMType, out c);
|
||||
if (pk == null)
|
||||
{ Util.Error(c); Console.WriteLine(c); return; }
|
||||
|
||||
|
|
Loading…
Reference in a new issue