Merge pull request #9 from kwsch/master

Update from upstream repo kwsch/PKHeX
This commit is contained in:
pokecal 2017-02-27 03:42:47 +09:00 committed by GitHub
commit bd991b7bed
10 changed files with 177 additions and 2 deletions

View file

@ -938,6 +938,7 @@
this.TB_Level.Size = new System.Drawing.Size(22, 20); this.TB_Level.Size = new System.Drawing.Size(22, 20);
this.TB_Level.TabIndex = 8; this.TB_Level.TabIndex = 8;
this.TB_Level.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.TB_Level.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
this.TB_Level.Click += new System.EventHandler(this.clickLevel);
this.TB_Level.TextChanged += new System.EventHandler(this.updateEXPLevel); this.TB_Level.TextChanged += new System.EventHandler(this.updateEXPLevel);
// //
// MT_Level // MT_Level

View file

@ -1714,6 +1714,15 @@ namespace PKHeX.WinForms
else else
TB_Friendship.Text = TB_Friendship.Text == "255" ? SAV.Personal[pkm.Species].BaseFriendship.ToString() : "255"; TB_Friendship.Text = TB_Friendship.Text == "255" ? SAV.Personal[pkm.Species].BaseFriendship.ToString() : "255";
} }
private void clickLevel(object sender, EventArgs e)
{
if (ModifierKeys == Keys.Control)
{
((MaskedTextBox)sender).Text = "100";
}
}
private void clickGender(object sender, EventArgs e) private void clickGender(object sender, EventArgs e)
{ {
// Get Gender Threshold // Get Gender Threshold
@ -2814,6 +2823,8 @@ namespace PKHeX.WinForms
pkm.Nature = CB_Nature.SelectedIndex; pkm.Nature = CB_Nature.SelectedIndex;
updateRandomPID(sender, e); updateRandomPID(sender, e);
} }
if (sender == CB_HeldItem && SAV.Generation == 7)
updateLegality();
} }
updateNatureModification(sender, null); updateNatureModification(sender, null);
updateIVs(null, null); // updating Nature will trigger stats to update as well updateIVs(null, null); // updating Nature will trigger stats to update as well

View file

@ -23,6 +23,8 @@
return GameVersion.RBY; return GameVersion.RBY;
case GameVersion.GS: case GameVersion.GS:
case GameVersion.GD:
case GameVersion.SV:
case GameVersion.C: case GameVersion.C:
return GameVersion.GSC; return GameVersion.GSC;

View file

@ -8,7 +8,6 @@
BATREV = -7, BATREV = -7,
RSBOX = -5, RSBOX = -5,
GS = -4, GS = -4,
C = -3,
// Indicators // Indicators
Invalid = -2, Invalid = -2,
@ -23,6 +22,7 @@
/*Gen7*/ SN = 30, MN = 31, /*Gen7*/ SN = 30, MN = 31,
/* GO */ GO = 34, /* GO */ GO = 34,
/* VC */ RD = 35, GN = 36, BU = 37, YW = 38, // GN = Blue for international release /* VC */ RD = 35, GN = 36, BU = 37, YW = 38, // GN = Blue for international release
GD, SV, C,
// Game Groupings (SaveFile type) // Game Groupings (SaveFile type)
RBY = 98, RBY = 98,

View file

@ -174,6 +174,7 @@ namespace PKHeX.Core
verifyForm(); verifyForm();
verifyMisc(); verifyMisc();
verifyGender(); verifyGender();
verifyItem();
verifyVersionEvolution(); verifyVersionEvolution();
// SecondaryChecked = true; // SecondaryChecked = true;

View file

@ -69,6 +69,14 @@ namespace PKHeX.Core
// return; // return;
} }
} }
private void verifyItem()
{
var unreleasedItems = Legal.getUnreleasedItems(pkm.Format);
if (unreleasedItems.Contains(pkm.HeldItem))
AddLine(Severity.Invalid, "Held item is unreleased.", CheckIdentifier.Form);
}
private void verifyECPID() private void verifyECPID()
{ {
if (pkm.EncryptionConstant == 0) if (pkm.EncryptionConstant == 0)

View file

@ -21,6 +21,8 @@ namespace PKHeX.Core
private static readonly Learnset[] LevelUpGS = Learnset1.getArray(Resources.lvlmove_gs, MaxSpeciesID_2); private static readonly Learnset[] LevelUpGS = Learnset1.getArray(Resources.lvlmove_gs, MaxSpeciesID_2);
private static readonly Learnset[] LevelUpC = Learnset1.getArray(Resources.lvlmove_c, MaxSpeciesID_2); private static readonly Learnset[] LevelUpC = Learnset1.getArray(Resources.lvlmove_c, MaxSpeciesID_2);
private static readonly EvolutionTree Evolves2; private static readonly EvolutionTree Evolves2;
private static readonly EncounterArea[] SlotsGSC;
private static readonly EncounterStatic[] StaticGSC;
// Gen 6 // Gen 6
private static readonly EggMoves[] EggMovesXY = EggMoves6.getArray(Data.unpackMini(Resources.eggmove_xy, "xy")); private static readonly EggMoves[] EggMovesXY = EggMoves6.getArray(Data.unpackMini(Resources.eggmove_xy, "xy"));
@ -46,6 +48,9 @@ namespace PKHeX.Core
{ {
case GameVersion.RBY: case GameVersion.RBY:
return Encounter_RBY; // GameVersion filtering not possible, return immediately return Encounter_RBY; // GameVersion filtering not possible, return immediately
case GameVersion.GSC:
return Encounter_GSC;
case GameVersion.X: case GameVersion.Y: case GameVersion.X: case GameVersion.Y:
table = Encounter_XY; table = Encounter_XY;
break; break;
@ -161,6 +166,10 @@ namespace PKHeX.Core
// Gen 2 // Gen 2
{ {
Evolves2 = new EvolutionTree(new[] { Resources.evos_gsc }, GameVersion.GSC, PersonalTable.C, MaxSpeciesID_2); Evolves2 = new EvolutionTree(new[] { Resources.evos_gsc }, GameVersion.GSC, PersonalTable.C, MaxSpeciesID_2);
SlotsGSC = new EncounterArea[0]; // todo
StaticGSC = getStaticEncounters(GameVersion.GSC);
} }
// Gen 6 // Gen 6
{ {
@ -1072,6 +1081,11 @@ namespace PKHeX.Core
case GameVersion.GN: case GameVersion.YW: case GameVersion.GN: case GameVersion.YW:
return getSlots(pkm, SlotsRBY, lvl); return getSlots(pkm, SlotsRBY, lvl);
case GameVersion.GSC:
case GameVersion.GD: case GameVersion.SV:
case GameVersion.C:
return getSlots(pkm, SlotsGSC, lvl);
case GameVersion.X: case GameVersion.X:
return getSlots(pkm, SlotsX, lvl); return getSlots(pkm, SlotsX, lvl);
case GameVersion.Y: case GameVersion.Y:
@ -1097,6 +1111,11 @@ namespace PKHeX.Core
case GameVersion.GN: case GameVersion.YW: case GameVersion.GN: case GameVersion.YW:
return getStatic(pkm, StaticRBY, lvl); return getStatic(pkm, StaticRBY, lvl);
case GameVersion.GSC:
case GameVersion.GD: case GameVersion.SV:
case GameVersion.C:
return getStatic(pkm, StaticGSC, lvl);
case GameVersion.X: case GameVersion.X:
return getStatic(pkm, StaticX, lvl); return getStatic(pkm, StaticX, lvl);
case GameVersion.Y: case GameVersion.Y:
@ -1346,6 +1365,23 @@ namespace PKHeX.Core
r.AddRange(getTutorMoves(pkm, species, form, specialTutors)); r.AddRange(getTutorMoves(pkm, species, form, specialTutors));
break; break;
} }
case 2:
{
int index = PersonalTable.C.getFormeIndex(species, 0);
var pi_c = (PersonalInfoG1)PersonalTable.C[index];
if (LVL)
{
r.AddRange(LevelUpGS[index].getMoves(lvl));
r.AddRange(LevelUpC[index].getMoves(lvl));
}
if (Machine)
{
r.AddRange(TMHM_GSC.Where((t, m) => pi_c.TMHM[m]));
}
if (moveTutor)
r.AddRange(getTutorMoves(pkm, species, form, specialTutors));
break;
}
case 6: case 6:
switch (ver) switch (ver)
{ {
@ -1457,5 +1493,14 @@ namespace PKHeX.Core
// No tutors in G7 // No tutors in G7
return moves.Distinct(); return moves.Distinct();
} }
public static int[] getUnreleasedItems(int generation)
{
switch (generation)
{
case 7: return UnreleasedItems_7;
default: return new int[0];
}
}
} }
} }

View file

@ -35,15 +35,29 @@ namespace PKHeX.Core
10, 05, 10, 20, 20, 40, 15, 10, 20, 20, 25, 05, 15, 10, 05, 20, 15, 20, 25, 20, 05, 30, 05, 10, 20, 40, 05, 20, 40, 20, 15, 35, 10, 05, 05, 05, 15, 05, 20, 05, 05, 15, 20, 10, 05, 05, 15, 15, 15, 15, 10, 05, 10, 20, 20, 40, 15, 10, 20, 20, 25, 05, 15, 10, 05, 20, 15, 20, 25, 20, 05, 30, 05, 10, 20, 40, 05, 20, 40, 20, 15, 35, 10, 05, 05, 05, 15, 05, 20, 05, 05, 15, 20, 10, 05, 05, 15, 15, 15, 15,
10, 00, 00, 00, 00 10, 00, 00, 00, 00
}; };
internal static readonly int[] TMHM_GSC =
{
223, 029, 174, 205, 046, 092, 192, 249, 244, 237,
241, 230, 173, 059, 063, 196, 182, 240, 202, 203,
218, 076, 231, 225, 087, 089, 216, 091, 094, 247,
189, 104, 008, 207, 214, 188, 201, 126, 129, 111,
009, 138, 197, 156, 213, 168, 211, 007, 210, 171,
015, 019, 057, 070, 148, 250, 127
};
internal static readonly int[] WildPokeBalls2 = { 4 }; internal static readonly int[] WildPokeBalls2 = { 4 };
internal static readonly int[] FutureEvolutionsGen2 = internal static readonly int[] FutureEvolutionsGen2 =
{ {
424,429,430,461,462,463,464,465,466,467,468,469,470,471,472,473,474,700 424,429,430,461,462,463,464,465,466,467,468,469,470,471,472,473,474,700
}; };
internal static readonly EncounterStatic[] Encounter_GSC =
{
// todo
};
internal static readonly EncounterTrade[] TradeGift_GSC = internal static readonly EncounterTrade[] TradeGift_GSC =
{ {
// todo
}; };
} }
} }

View file

@ -1250,5 +1250,97 @@ namespace PKHeX.Core
}; };
#endregion #endregion
#region Unreleased Items
internal static readonly int[] UnreleasedItems_7 =
{
016, // Cherish Ball
064, // Fluffy Tail
065, // Blue Flute
066, // Yellow Flute
067, // Red Flute
068, // Black Flute
069, // White Flute
070, // Shoal Salt
071, // Shoal Shell
099, // Root Fossil
100, // Claw Fossil
101, // Helix Fossil
102, // Dome Fossil
103, // Old Amber
111, // Odd Keystone
164, // Razz Berry
166, // Nanab Berry
167, // Wepear Berry
175, // Cornn Berry
176, // Magost Berry
177, // Rabuta Berry
178, // Nomel Berry
179, // Spelon Berry
180, // Pamtre Berry
181, // Watmel Berry
182, // Durin Berry
183, // Belue Berry
208, // Enigma Berry
209, // Micle Berry
210, // Custap Berry
211, // Jaboca Berry
212, // Rowap Berry
215, // Macho Brace
260, // Red Scarf
261, // Blue Scarf
262, // Pink Scarf
263, // Green Scarf
264, // Yellow Scarf
548, // Fire Gem
549, // Water Gem
550, // Electric Gem
551, // Grass Gem
552, // Ice Gem
553, // Fighting Gem
554, // Poison Gem
555, // Ground Gem
556, // Flying Gem
557, // Psychic Gem
558, // Bug Gem
559, // Rock Gem
560, // Ghost Gem
561, // Dragon Gem
562, // Dark Gem
563, // Steel Gem
657, // Gardevoirite
658, // Ampharosite
662, // Mewtwonite X
663, // Mewtwonite Y
664, // Blazikenite
665, // Medichamite
666, // Houndoominite
667, // Aggronite
668, // Banettite
669, // Tyranitarite
674, // Abomasite
680, // Heracronite
681, // Mawilite
682, // Manectite
684, // Latiasite
685, // Latiosite
710, // Jaw Fossil
711, // Sail Fossil
715, // Fairy Gem
752, // Swamperite
753, // Sceptilite
755, // Altarianite
756, // Galladite
757, // Audinite
761, // Steelixite
762, // Pidgeotite
764, // Diancite
767, // Cameruptite
768, // Lopunnite
770, // Beeddrillite
802, // Marshadium Z
836, // Pikashunium Z
};
#endregion
} }
} }

View file

@ -24,6 +24,7 @@ Control + Click on...
- Randomize EVs: Set all EVs to 0. - Randomize EVs: Set all EVs to 0.
- PP Ups Label: Set all PP Ups to 0. (Click = 3) - PP Ups Label: Set all PP Ups to 0. (Click = 3)
- Friendship Label: Set Friendship to 0. (Click = 255 or Base) - Friendship Label: Set Friendship to 0. (Click = 255 or Base)
- Level box: Set Level to 100.
Alt + Click on... Alt + Click on...
- Preview Sprite to load from a QR url on your clipboard. - Preview Sprite to load from a QR url on your clipboard.