mirror of
https://github.com/kwsch/PKHeX
synced 2025-02-17 05:48:44 +00:00
Added verbosity to export and internal arrays
Also finished implementation of PKRS strain/days hiding depending on infected/cured status.
This commit is contained in:
parent
12a022cd38
commit
bc1776f8a2
4 changed files with 78 additions and 69 deletions
|
@ -27,7 +27,7 @@ namespace PKHeX
|
|||
534,535,
|
||||
752,753,754,755,756,757,758,759,760,761,762,763,764,767,768,769,770,
|
||||
};
|
||||
internal static readonly int[] Items_Ball = { 4, 3, 2, 7, 576, 13, 492, 497, 14, 495, 493, 496, 494, 11, 498, 8, 6, 12, 15, 9, 5, 499, 10, 1, 16 };
|
||||
internal static readonly int[] Items_Ball = { 000, 001, 002, 003, 004, 005, 006, 007, 008, 009, 010, 011, 012, 013, 014, 015, 016, 492, 493, 494, 495, 496, 497, 498, 499, 576, };
|
||||
internal static readonly int[] Items_CommonBall = { 4, 3, 2, 1};
|
||||
internal static readonly int[] Items_UncommonBall = { 7, 576, 13, 492, 497, 14, 495, 493, 496, 494, 11, 498, 8, 6, 12, 15, 9, 5, 499, 10, 16 };
|
||||
#endregion
|
||||
|
|
22
Misc/PKX.cs
22
Misc/PKX.cs
|
@ -555,14 +555,14 @@ namespace PKHeX
|
|||
mMove1N, mMove2N, mMove3N, mMove4N, mhelditemN,
|
||||
mRMove1N, mRMove2N, mRMove3N, mRMove4N,
|
||||
mMetLocN, mEggLocN,
|
||||
mcountryID, mregionID;
|
||||
mcountryID, mregionID, mGameN, mBallN, mdsregIDN, motlangN;
|
||||
|
||||
private int
|
||||
mability, mabilitynum, mnature, mfeflag, mgenderflag, maltforms, mPKRS_Strain, mPKRS_Duration,
|
||||
mability, mabilitynum, mnature, mgenderflag, maltforms, mPKRS_Strain, mPKRS_Duration,
|
||||
mmetlevel, motgender;
|
||||
|
||||
private bool
|
||||
misegg, misnick, misshiny;
|
||||
misegg, misnick, misshiny, mfeflag;
|
||||
|
||||
private ushort
|
||||
mhelditem, mspecies, mTID, mSID, mTSV, mESV,
|
||||
|
@ -595,9 +595,13 @@ namespace PKHeX
|
|||
public string HeldItem { get { return mhelditemN; } }
|
||||
public string MetLoc { get { return mMetLocN; } }
|
||||
public string EggLoc { get { return mEggLocN; } }
|
||||
public string Ball { get { return mBallN; } }
|
||||
public string OT { get { return mot; } }
|
||||
public string Version { get { return mGameN; } }
|
||||
public string OTLang { get { return motlangN; } }
|
||||
public string CountryID { get { return mcountryID; } }
|
||||
public string RegionID { get { return mregionID; } }
|
||||
public string DSRegionID { get { return mdsregIDN; } }
|
||||
|
||||
#region Extraneous
|
||||
public string EC { get { return mEC.ToString("X8"); } }
|
||||
|
@ -626,7 +630,6 @@ namespace PKHeX
|
|||
public string NotOT { get { return mnotOT; } }
|
||||
|
||||
public int AbilityNum { get { return mabilitynum; } }
|
||||
public int FatefulFlag { get { return mfeflag; } }
|
||||
public int GenderFlag { get { return mgenderflag; } }
|
||||
public int AltForms { get { return maltforms; } }
|
||||
public int PKRS_Strain { get { return mPKRS_Strain; } }
|
||||
|
@ -634,6 +637,7 @@ namespace PKHeX
|
|||
public int MetLevel { get { return mmetlevel; } }
|
||||
public int OT_Gender { get { return motgender; } }
|
||||
|
||||
public bool FatefulFlag { get { return mfeflag; } }
|
||||
public bool IsEgg { get { return misegg; } }
|
||||
public bool IsNicknamed { get { return misnick; } }
|
||||
public bool IsShiny { get { return misshiny; } }
|
||||
|
@ -662,11 +666,7 @@ namespace PKHeX
|
|||
public ushort Met_Year { get { return mmet_year; } }
|
||||
public ushort Met_Day { get { return mmet_month; } }
|
||||
public ushort Met_Month { get { return mmet_day; } }
|
||||
public ushort Ball { get { return mball; } }
|
||||
public ushort Encounter { get { return mencountertype; } }
|
||||
public ushort GameVersion { get { return mgamevers; } }
|
||||
public ushort DSRegionID { get { return mdsregID; } }
|
||||
public ushort OTLang { get { return motlang; } }
|
||||
|
||||
#endregion
|
||||
public PKX(byte[] pkx, string ident)
|
||||
|
@ -687,7 +687,7 @@ namespace PKHeX
|
|||
// 0x16, 0x17 - Training bag
|
||||
mPID = BitConverter.ToUInt32(pkx, 0x18);
|
||||
mnature = pkx[0x1C];
|
||||
mfeflag = pkx[0x1D] % 2;
|
||||
mfeflag = (pkx[0x1D] % 2) == 1;
|
||||
mgenderflag = (pkx[0x1D] >> 1) & 0x3;
|
||||
maltforms = (pkx[0x1D] >> 3);
|
||||
mHP_EV = pkx[0x1E];
|
||||
|
@ -847,6 +847,10 @@ namespace PKHeX
|
|||
mRMove4N = Form1.movelist[meggmove4];
|
||||
mMetLocN = PKX.getLocation(false, mgamevers, mmetloc);
|
||||
mEggLocN = PKX.getLocation(true, mgamevers, meggloc);
|
||||
mGameN = Form1.gamelist[mgamevers];
|
||||
mBallN = Form1.balllist[mball];
|
||||
motlangN = Form1.gamelanguages[motlang];
|
||||
mdsregIDN = Form1.consoleregions[mdsregID];
|
||||
}
|
||||
catch { return; }
|
||||
}
|
||||
|
|
122
PKX/f1-Main.cs
122
PKX/f1-Main.cs
|
@ -224,6 +224,9 @@ namespace PKHeX
|
|||
public static string[] trainingstage = { };
|
||||
public static string[] wallpapernames = { };
|
||||
public static string[] encountertypelist = { };
|
||||
public static string[] gamelanguages = { };
|
||||
public static string[] consoleregions = { };
|
||||
public static string[] balllist = { };
|
||||
public static string[] gamelist = { };
|
||||
public static string[] puffs = { };
|
||||
public static string[] itempouch = { };
|
||||
|
@ -642,7 +645,13 @@ namespace PKHeX
|
|||
itempouch = Util.getStringList("ItemPouch", l);
|
||||
encountertypelist = Util.getStringList("EncounterType", l);
|
||||
gamelist = Util.getStringList("Games", l);
|
||||
|
||||
gamelanguages = Util.getSimpleStringList("languages");
|
||||
consoleregions = Util.getSimpleStringList("regions3ds");
|
||||
|
||||
balllist = new string[Legal.Items_Ball.Length];
|
||||
for (int i = 0; i < balllist.Length; i++)
|
||||
balllist[i] = itemlist[Legal.Items_Ball[i]];
|
||||
|
||||
if ((l != "zh") || (l == "zh" && !init)) // load initial binaries
|
||||
{
|
||||
forms = Util.getStringList("Forms", l);
|
||||
|
@ -993,20 +1002,14 @@ namespace PKHeX
|
|||
TB_MetLevel.Text = metlevel.ToString();
|
||||
|
||||
// Reset
|
||||
CHK_Cured.Checked = false;
|
||||
CHK_Infected.Checked = false;
|
||||
|
||||
CB_PKRSStrain.SelectedIndex = PKRS_Strain;
|
||||
CB_PKRSDays.SelectedIndex = Math.Min((PKRS_Duration & 0x7),4); // to strip out bad hacked 'rus
|
||||
if (PKRS_Strain > 0)
|
||||
Label_PKRS.Visible = CB_PKRSStrain.Visible = CHK_Infected.Checked = !(PKRS_Strain == 0);
|
||||
Label_PKRSdays.Visible = CB_PKRSDays.Visible = !(PKRS_Duration == 0);
|
||||
{
|
||||
CHK_Infected.Checked = true;
|
||||
if (PKRS_Duration == 0)
|
||||
CHK_Cured.Checked = true;
|
||||
CHK_Cured.Checked = (PKRS_Strain > 0 && PKRS_Duration == 0);
|
||||
}
|
||||
// Do it again now that our comboboxes should be properly set?
|
||||
CB_PKRSStrain.SelectedIndex = PKRS_Strain;
|
||||
CB_PKRSDays.SelectedIndex = Math.Min((PKRS_Duration & 0x7),4); // to strip out bad hacked 'rus
|
||||
CB_PKRSDays.SelectedIndex = Math.Min((PKRS_Duration & 0x7), 4); // to strip out bad hacked 'rus
|
||||
|
||||
TB_Cool.Text = cnt_cool.ToString();
|
||||
TB_Beauty.Text = cnt_beauty.ToString();
|
||||
|
@ -1069,6 +1072,8 @@ namespace PKHeX
|
|||
CB_EncounterType.SelectedValue = 0;
|
||||
|
||||
init = true;
|
||||
updatePKRSInfected(null, null);
|
||||
updatePKRSCured(null, null);
|
||||
|
||||
if (HaX) // DEV Illegality
|
||||
{
|
||||
|
@ -1787,6 +1792,51 @@ namespace PKHeX
|
|||
else CHK_Cured.Checked = true;
|
||||
}
|
||||
}
|
||||
private void updatePKRSCured(object sender, EventArgs e)
|
||||
{
|
||||
if (!init) return;
|
||||
// Cured PokeRus is toggled
|
||||
if (CHK_Cured.Checked)
|
||||
{
|
||||
// Has Had PokeRus
|
||||
Label_PKRSdays.Visible = CB_PKRSDays.Visible = false;
|
||||
CB_PKRSDays.SelectedIndex = 0;
|
||||
|
||||
Label_PKRS.Visible = CB_PKRSStrain.Visible = true;
|
||||
CHK_Infected.Checked = true;
|
||||
|
||||
// If we're cured we have to have a strain infection.
|
||||
if (CB_PKRSStrain.SelectedIndex == 0)
|
||||
CB_PKRSStrain.SelectedIndex = 1;
|
||||
}
|
||||
else if (!CHK_Infected.Checked)
|
||||
{
|
||||
// Not Infected, Disable the other
|
||||
Label_PKRS.Visible = CB_PKRSStrain.Visible = false;
|
||||
CB_PKRSStrain.SelectedIndex = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Still Infected for a duration
|
||||
Label_PKRSdays.Visible = CB_PKRSDays.Visible = true;
|
||||
CB_PKRSDays.SelectedValue = 1;
|
||||
}
|
||||
// if not cured yet, days > 0
|
||||
if (!CHK_Cured.Checked && CHK_Infected.Checked && CB_PKRSDays.SelectedIndex == 0)
|
||||
CB_PKRSDays.SelectedIndex++;
|
||||
|
||||
setMarkings();
|
||||
}
|
||||
private void updatePKRSInfected(object sender, EventArgs e)
|
||||
{
|
||||
if (!init) return;
|
||||
Label_PKRS.Visible = CB_PKRSStrain.Visible = CHK_Infected.Checked;
|
||||
if (!CHK_Infected.Checked) { CB_PKRSStrain.SelectedIndex = 0; CB_PKRSDays.SelectedIndex = 0; Label_PKRSdays.Visible = CB_PKRSDays.Visible = false; }
|
||||
else if (CB_PKRSStrain.SelectedIndex == 0) CB_PKRSStrain.SelectedIndex++;
|
||||
|
||||
// if not cured yet, days > 0
|
||||
if (!CHK_Cured.Checked && CHK_Infected.Checked && CB_PKRSDays.SelectedIndex == 0) CB_PKRSDays.SelectedIndex++;
|
||||
}
|
||||
private void updateCountry(object sender, EventArgs e)
|
||||
{
|
||||
if (Util.getIndex(sender as ComboBox) > 0)
|
||||
|
@ -1980,50 +2030,6 @@ namespace PKHeX
|
|||
else if (Label_CTGender.Text == "")
|
||||
Label_CTGender.Text = gendersymbols[0];
|
||||
}
|
||||
private void updatePKRSCured(object sender, EventArgs e)
|
||||
{
|
||||
// Cured PokeRus is toggled
|
||||
if (CHK_Cured.Checked)
|
||||
{
|
||||
// Has Had PokeRus
|
||||
Label_PKRSdays.Visible = CB_PKRSDays.Visible = false;
|
||||
CB_PKRSDays.SelectedIndex = 0;
|
||||
|
||||
Label_PKRS.Visible = CB_PKRSStrain.Visible = true;
|
||||
CHK_Infected.Checked = true;
|
||||
|
||||
// If we're cured we have to have a strain infection.
|
||||
if (CB_PKRSStrain.SelectedIndex == 0)
|
||||
CB_PKRSStrain.SelectedIndex = 1;
|
||||
}
|
||||
else if (!CHK_Infected.Checked)
|
||||
{
|
||||
// Not Infected, Disable the other
|
||||
Label_PKRS.Visible = CB_PKRSStrain.Visible = false;
|
||||
CB_PKRSStrain.SelectedIndex = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Still Infected for a duration
|
||||
Label_PKRSdays.Visible = CB_PKRSDays.Visible = true;
|
||||
CB_PKRSDays.SelectedValue = 1;
|
||||
}
|
||||
// if not cured yet, days > 0
|
||||
if (!CHK_Cured.Checked && CHK_Infected.Checked && CB_PKRSDays.SelectedIndex == 0)
|
||||
CB_PKRSDays.SelectedIndex++;
|
||||
|
||||
setMarkings();
|
||||
}
|
||||
private void updatePKRSInfected(object sender, EventArgs e)
|
||||
{
|
||||
Label_PKRSdays.Visible = CB_PKRSDays.Visible = Label_PKRS.Visible = CB_PKRSStrain.Visible = CHK_Infected.Checked;
|
||||
if (!CHK_Infected.Checked) { CB_PKRSStrain.SelectedIndex = CB_PKRSDays.SelectedIndex = 0; }
|
||||
else if (CB_PKRSStrain.SelectedIndex == 0) CB_PKRSStrain.SelectedIndex++;
|
||||
|
||||
CB_PKRSDays.SelectedValue = CB_PKRSStrain.SelectedValue = Convert.ToInt32(CHK_Infected.Checked);
|
||||
// if not cured yet, days > 0
|
||||
if (!CHK_Cured.Checked && CHK_Infected.Checked && CB_PKRSDays.SelectedIndex == 0) CB_PKRSDays.SelectedIndex++;
|
||||
}
|
||||
private void updateIsEgg(object sender, EventArgs e)
|
||||
{
|
||||
if (CHK_IsEgg.Checked)
|
||||
|
@ -4146,8 +4152,6 @@ namespace PKHeX
|
|||
uint unk4 = BitConverter.ToUInt16(savefile, r_offset + 0x54);
|
||||
byte region = savefile[r_offset + 0x56];
|
||||
byte country = savefile[r_offset + 0x57];
|
||||
byte _3dsreg = savefile[r_offset + 0x58];
|
||||
byte _lang = savefile[r_offset + 0x59];
|
||||
byte game = savefile[r_offset + 0x5A];
|
||||
ulong outfit = BitConverter.ToUInt64(savefile, r_offset + 0x5C);
|
||||
int favpkm = BitConverter.ToUInt16(savefile, r_offset + 0x9C) & 0x7FF;
|
||||
|
@ -4167,8 +4171,8 @@ namespace PKHeX
|
|||
"OT: " + otname + Environment.NewLine +
|
||||
"Message: " + message + Environment.NewLine +
|
||||
"Game: " + gamename + Environment.NewLine +
|
||||
"Country ID: " + cr[0] + Environment.NewLine +
|
||||
"Region ID: " + cr[1] + Environment.NewLine +
|
||||
"Country: " + cr[0] + Environment.NewLine +
|
||||
"Region: " + cr[1] + Environment.NewLine +
|
||||
"Favorite: " + specieslist[favpkm] + Environment.NewLine;
|
||||
|
||||
result += Environment.NewLine;
|
||||
|
|
|
@ -37,6 +37,7 @@ namespace PKHeX
|
|||
byte[] slotdata = new byte[0xE8];
|
||||
Array.Copy(SaveData, offset, slotdata, 0, 0xE8);
|
||||
byte[] dslotdata = PKX.decryptArray(slotdata);
|
||||
if (BitConverter.ToUInt16(dslotdata, 0x8) == 0) continue;
|
||||
string Identifier = String.Format("B{0}:{1}",BoxNum.ToString("00"),SlotNum.ToString("00"));
|
||||
PKX pkm = new PKX(dslotdata, Identifier);
|
||||
if ((pkm.EC == "00000000") && (pkm.Species == "---")) continue;
|
||||
|
|
Loading…
Add table
Reference in a new issue