mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-27 14:30:56 +00:00
update channel generation
Thanks @admiral-fish !
This commit is contained in:
parent
2a2f5669e4
commit
c61c572f35
2 changed files with 14 additions and 3 deletions
|
@ -209,7 +209,10 @@ namespace PKHeX.Core
|
|||
return false;
|
||||
}
|
||||
|
||||
var channel = GetSeedsFromPID(RNG.XDRNG, bot, top ^ 0x8000);
|
||||
var undo = top ^ 0x8000;
|
||||
if ((undo > 7 ? 0 : 1) != (bot ^ pk.SID ^ 40122))
|
||||
top = undo;
|
||||
var channel = GetSeedsFromPID(RNG.XDRNG, bot, top);
|
||||
foreach (var seed in channel)
|
||||
{
|
||||
var C = RNG.XDRNG.Advance(seed, 3); // held item
|
||||
|
|
|
@ -71,8 +71,16 @@
|
|||
var D = rng.Next(C); // Version
|
||||
var E = rng.Next(D); // OT Gender
|
||||
|
||||
pk.SID = (int)(O >> 16);
|
||||
pk.PID = (A & 0xFFFF0000 | B >> 16) ^ 0x80000000;
|
||||
var TID = 40122;
|
||||
var SID = (int)(O >> 16);
|
||||
var pid1 = A >> 16;
|
||||
var pid2 = B >> 16;
|
||||
pk.TID = TID;
|
||||
pk.SID = SID;
|
||||
var pid = pid1 << 16 | pid2;
|
||||
if ((pid2 > 7 ? 0 : 1) != (pid1 ^ SID ^ TID))
|
||||
pid ^= 0x80000000;
|
||||
pk.PID = pid;
|
||||
pk.HeldItem = (int)(C >> 31) + 169; // 0-Ganlon, 1-Salac
|
||||
pk.Version = (int)(D >> 31) + 1; // 0-Sapphire, 1-Ruby
|
||||
pk.OT_Gender = (int)(E >> 31);
|
||||
|
|
Loading…
Reference in a new issue