mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-27 06:20:25 +00:00
Add RTC ResetKey calc
This commit is contained in:
parent
cc70939dc2
commit
caf25efb46
1 changed files with 10 additions and 0 deletions
|
@ -529,6 +529,16 @@ namespace PKHeX.Core
|
|||
return (Data[Offsets.PokedexCaught + ofs] & bitval) != 0;
|
||||
}
|
||||
|
||||
// Misc
|
||||
public ushort ResetKey => GetResetKey();
|
||||
private ushort GetResetKey()
|
||||
{
|
||||
var val = (TID >> 8) + (TID & 0xFF) + (Money >> 8) + (Money & 0xFF);
|
||||
var ot = Data.Skip(Offsets.Trainer1 + 2).TakeWhile((z, i) => i < 5 && z != 0x50);
|
||||
var tr = ot.Sum(z => z);
|
||||
return (ushort)(val + tr);
|
||||
}
|
||||
|
||||
public override string GetString(int Offset, int Count)
|
||||
{
|
||||
if (Korean)
|
||||
|
|
Loading…
Reference in a new issue