2016-07-27 03:18:48 +00:00
|
|
|
|
using System;
|
2020-11-12 05:01:41 +00:00
|
|
|
|
using System.Collections.Generic;
|
2022-01-03 05:35:59 +00:00
|
|
|
|
using static System.Buffers.Binary.BinaryPrimitives;
|
2016-07-27 03:18:48 +00:00
|
|
|
|
|
2017-01-08 07:54:09 +00:00
|
|
|
|
namespace PKHeX.Core
|
2016-07-27 03:18:48 +00:00
|
|
|
|
{
|
2017-10-24 06:12:58 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Pokemon Link Data Storage
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// This Template object is very similar to the <see cref="PCD"/> structure in that it stores more data than just the gift.
|
|
|
|
|
/// This template object is only present in Generation 6 save files.
|
|
|
|
|
/// </remarks>
|
2019-10-04 02:09:02 +00:00
|
|
|
|
public sealed class PL6
|
2016-07-27 03:18:48 +00:00
|
|
|
|
{
|
2017-01-08 07:54:09 +00:00
|
|
|
|
public const int Size = 0xA47;
|
|
|
|
|
public const string Filter = "Pokémon Link Data|*.pl6|All Files (*.*)|*.*";
|
2016-07-27 03:18:48 +00:00
|
|
|
|
|
2017-01-08 08:14:34 +00:00
|
|
|
|
public readonly byte[] Data;
|
2018-08-10 04:53:39 +00:00
|
|
|
|
|
2019-03-17 01:23:50 +00:00
|
|
|
|
public PL6() => Data = new byte[Size];
|
|
|
|
|
public PL6(byte[] data) => Data = data;
|
2018-08-10 04:53:39 +00:00
|
|
|
|
|
2017-10-24 06:12:58 +00:00
|
|
|
|
/// <summary>
|
2018-05-12 19:28:48 +00:00
|
|
|
|
/// Pokémon Link Flag
|
2017-10-24 06:12:58 +00:00
|
|
|
|
/// </summary>
|
2021-07-16 03:39:53 +00:00
|
|
|
|
public byte Flags
|
|
|
|
|
{
|
|
|
|
|
get => Data[0x00];
|
|
|
|
|
set => Data[0x00] = value;
|
2017-05-13 03:32:36 +00:00
|
|
|
|
}
|
2018-08-10 04:53:39 +00:00
|
|
|
|
|
2021-07-16 03:39:53 +00:00
|
|
|
|
public bool Enabled { get => (Flags & 0x80) != 0; set => Flags = value ? (byte)(1 << 7) : (byte)0; }
|
2017-10-24 06:12:58 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Name of data source
|
|
|
|
|
/// </summary>
|
2022-01-03 05:35:59 +00:00
|
|
|
|
public string Origin { get => StringConverter6.GetString(Data.AsSpan(0x01, 110)); set => StringConverter6.SetString(Data.AsSpan(0x01, 110), value.AsSpan(), 54, StringConverterOption.ClearZero); }
|
2018-08-10 04:53:39 +00:00
|
|
|
|
|
|
|
|
|
// Pokemon transfer flags?
|
2022-01-03 05:35:59 +00:00
|
|
|
|
public uint Flags_1 { get => ReadUInt32LittleEndian(Data.AsSpan(0x099)); set => WriteUInt32LittleEndian(Data.AsSpan(0x099), value); }
|
|
|
|
|
public uint Flags_2 { get => ReadUInt32LittleEndian(Data.AsSpan(0x141)); set => WriteUInt32LittleEndian(Data.AsSpan(0x141), value); }
|
|
|
|
|
public uint Flags_3 { get => ReadUInt32LittleEndian(Data.AsSpan(0x1E9)); set => WriteUInt32LittleEndian(Data.AsSpan(0x1E9), value); }
|
|
|
|
|
public uint Flags_4 { get => ReadUInt32LittleEndian(Data.AsSpan(0x291)); set => WriteUInt32LittleEndian(Data.AsSpan(0x291), value); }
|
|
|
|
|
public uint Flags_5 { get => ReadUInt32LittleEndian(Data.AsSpan(0x339)); set => WriteUInt32LittleEndian(Data.AsSpan(0x339), value); }
|
|
|
|
|
public uint Flags_6 { get => ReadUInt32LittleEndian(Data.AsSpan(0x3E1)); set => WriteUInt32LittleEndian(Data.AsSpan(0x3E1), value); }
|
2018-08-10 04:53:39 +00:00
|
|
|
|
|
|
|
|
|
// Pokémon
|
2020-12-22 01:17:56 +00:00
|
|
|
|
public PL6_PKM Poke_1 { get => new(Data.Slice(0x09D, PL6_PKM.Size)); set => value.Data.CopyTo(Data, 0x09D); }
|
|
|
|
|
public PL6_PKM Poke_2 { get => new(Data.Slice(0x145, PL6_PKM.Size)); set => value.Data.CopyTo(Data, 0x145); }
|
|
|
|
|
public PL6_PKM Poke_3 { get => new(Data.Slice(0x1ED, PL6_PKM.Size)); set => value.Data.CopyTo(Data, 0x1ED); }
|
|
|
|
|
public PL6_PKM Poke_4 { get => new(Data.Slice(0x295, PL6_PKM.Size)); set => value.Data.CopyTo(Data, 0x295); }
|
|
|
|
|
public PL6_PKM Poke_5 { get => new(Data.Slice(0x33D, PL6_PKM.Size)); set => value.Data.CopyTo(Data, 0x33D); }
|
|
|
|
|
public PL6_PKM Poke_6 { get => new(Data.Slice(0x3E5, PL6_PKM.Size)); set => value.Data.CopyTo(Data, 0x3E5); }
|
2018-08-10 04:53:39 +00:00
|
|
|
|
|
|
|
|
|
// Item Properties
|
2022-01-03 05:35:59 +00:00
|
|
|
|
public int Item_1 { get => ReadUInt16LittleEndian(Data.AsSpan(0x489)); set => WriteUInt16LittleEndian(Data.AsSpan(0x489), (ushort)value); }
|
|
|
|
|
public int Quantity_1 { get => ReadUInt16LittleEndian(Data.AsSpan(0x48B)); set => WriteUInt16LittleEndian(Data.AsSpan(0x48B), (ushort)value); }
|
|
|
|
|
public int Item_2 { get => ReadUInt16LittleEndian(Data.AsSpan(0x48D)); set => WriteUInt16LittleEndian(Data.AsSpan(0x48D), (ushort)value); }
|
|
|
|
|
public int Quantity_2 { get => ReadUInt16LittleEndian(Data.AsSpan(0x48F)); set => WriteUInt16LittleEndian(Data.AsSpan(0x48F), (ushort)value); }
|
|
|
|
|
public int Item_3 { get => ReadUInt16LittleEndian(Data.AsSpan(0x491)); set => WriteUInt16LittleEndian(Data.AsSpan(0x491), (ushort)value); }
|
|
|
|
|
public int Quantity_3 { get => ReadUInt16LittleEndian(Data.AsSpan(0x493)); set => WriteUInt16LittleEndian(Data.AsSpan(0x493), (ushort)value); }
|
|
|
|
|
public int Item_4 { get => ReadUInt16LittleEndian(Data.AsSpan(0x495)); set => WriteUInt16LittleEndian(Data.AsSpan(0x495), (ushort)value); }
|
|
|
|
|
public int Quantity_4 { get => ReadUInt16LittleEndian(Data.AsSpan(0x497)); set => WriteUInt16LittleEndian(Data.AsSpan(0x497), (ushort)value); }
|
|
|
|
|
public int Item_5 { get => ReadUInt16LittleEndian(Data.AsSpan(0x499)); set => WriteUInt16LittleEndian(Data.AsSpan(0x499), (ushort)value); }
|
|
|
|
|
public int Quantity_5 { get => ReadUInt16LittleEndian(Data.AsSpan(0x49B)); set => WriteUInt16LittleEndian(Data.AsSpan(0x49B), (ushort)value); }
|
|
|
|
|
public int Item_6 { get => ReadUInt16LittleEndian(Data.AsSpan(0x49D)); set => WriteUInt16LittleEndian(Data.AsSpan(0x49D), (ushort)value); }
|
|
|
|
|
public int Quantity_6 { get => ReadUInt16LittleEndian(Data.AsSpan(0x49F)); set => WriteUInt16LittleEndian(Data.AsSpan(0x49F), (ushort)value); }
|
|
|
|
|
|
|
|
|
|
public int BattlePoints { get => ReadUInt16LittleEndian(Data.AsSpan(0x4A1)); set => WriteUInt16LittleEndian(Data.AsSpan(0x4A1), (ushort)value); }
|
|
|
|
|
public int Pokemiles { get => ReadUInt16LittleEndian(Data.AsSpan(0x4A3)); set => WriteUInt16LittleEndian(Data.AsSpan(0x4A3), (ushort)value); }
|
2017-02-21 03:40:50 +00:00
|
|
|
|
}
|
2016-07-27 03:18:48 +00:00
|
|
|
|
|
2017-10-24 06:12:58 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Pokemon Link Gift Template
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// This Template object is very similar to the <see cref="WC6"/> structure and similar objects, in that the structure offsets are ordered the same.
|
|
|
|
|
/// This template object is only present in Generation 6 save files.
|
|
|
|
|
/// </remarks>
|
2021-07-16 03:39:53 +00:00
|
|
|
|
public sealed class PL6_PKM : IRibbonSetEvent3, IRibbonSetEvent4, IEncounterInfo
|
2016-07-27 03:18:48 +00:00
|
|
|
|
{
|
|
|
|
|
internal const int Size = 0xA0;
|
|
|
|
|
|
|
|
|
|
public readonly byte[] Data;
|
2018-08-10 04:53:39 +00:00
|
|
|
|
|
PKHeX.Core Nullable cleanup (#2401)
* Handle some nullable cases
Refactor MysteryGift into a second abstract class (backed by a byte array, or fake data)
Make some classes have explicit constructors instead of { } initialization
* Handle bits more obviously without null
* Make SaveFile.BAK explicitly readonly again
* merge constructor methods to have readonly fields
* Inline some properties
* More nullable handling
* Rearrange box actions
define straightforward classes to not have any null properties
* Make extrabyte reference array immutable
* Move tooltip creation to designer
* Rearrange some logic to reduce nesting
* Cache generated fonts
* Split mystery gift album purpose
* Handle more tooltips
* Disallow null setters
* Don't capture RNG object, only type enum
* Unify learnset objects
Now have readonly properties which are never null
don't new() empty learnsets (>800 Learnset objects no longer created,
total of 2400 objects since we also new() a move & level array)
optimize g1/2 reader for early abort case
* Access rewrite
Initialize blocks in a separate object, and get via that object
removes a couple hundred "might be null" warnings since blocks are now readonly getters
some block references have been relocated, but interfaces should expose all that's needed
put HoF6 controls in a groupbox, and disable
* Readonly personal data
* IVs non nullable for mystery gift
* Explicitly initialize forced encounter moves
* Make shadow objects readonly & non-null
Put murkrow fix in binary data resource, instead of on startup
* Assign dex form fetch on constructor
Fixes legality parsing edge cases
also handle cxd parse for valid; exit before exception is thrown in FrameGenerator
* Remove unnecessary null checks
* Keep empty value until init
SetPouch sets the value to an actual one during load, but whatever
* Readonly team lock data
* Readonly locks
Put locked encounters at bottom (favor unlocked)
* Mail readonly data / offset
Rearrange some call flow and pass defaults
Add fake classes for SaveDataEditor mocking
Always party size, no need to check twice in stat editor
use a fake save file as initial data for savedata editor, and for
gamedata (wow i found a usage)
constrain eventwork editor to struct variable types (uint, int, etc),
thus preventing null assignment errors
2019-10-17 01:47:31 +00:00
|
|
|
|
public PL6_PKM() : this(new byte[Size]) { }
|
|
|
|
|
public PL6_PKM(byte[] data) => Data = data;
|
2016-07-27 03:18:48 +00:00
|
|
|
|
|
2022-01-03 05:35:59 +00:00
|
|
|
|
public int TID { get => ReadUInt16LittleEndian(Data.AsSpan(0x00)); set => WriteUInt16LittleEndian(Data.AsSpan(0x00), (ushort)value); }
|
|
|
|
|
public int SID { get => ReadUInt16LittleEndian(Data.AsSpan(0x02)); set => WriteUInt16LittleEndian(Data.AsSpan(0x02), (ushort)value); }
|
2018-08-10 04:53:39 +00:00
|
|
|
|
public int OriginGame { get => Data[0x04]; set => Data[0x04] = (byte)value; }
|
2022-01-03 05:35:59 +00:00
|
|
|
|
public uint EncryptionConstant { get => ReadUInt32LittleEndian(Data.AsSpan(0x08)); set => WriteUInt32LittleEndian(Data.AsSpan(0x08), value); }
|
2018-08-10 04:53:39 +00:00
|
|
|
|
public int Pokéball { get => Data[0xE]; set => Data[0xE] = (byte)value; }
|
2022-01-03 05:35:59 +00:00
|
|
|
|
public int HeldItem { get => ReadUInt16LittleEndian(Data.AsSpan(0x10)); set => WriteUInt16LittleEndian(Data.AsSpan(0x10), (ushort)value); }
|
|
|
|
|
public int Move1 { get => ReadUInt16LittleEndian(Data.AsSpan(0x12)); set => WriteUInt16LittleEndian(Data.AsSpan(0x12), (ushort)value); }
|
|
|
|
|
public int Move2 { get => ReadUInt16LittleEndian(Data.AsSpan(0x14)); set => WriteUInt16LittleEndian(Data.AsSpan(0x14), (ushort)value); }
|
|
|
|
|
public int Move3 { get => ReadUInt16LittleEndian(Data.AsSpan(0x16)); set => WriteUInt16LittleEndian(Data.AsSpan(0x16), (ushort)value); }
|
|
|
|
|
public int Move4 { get => ReadUInt16LittleEndian(Data.AsSpan(0x18)); set => WriteUInt16LittleEndian(Data.AsSpan(0x18), (ushort)value); }
|
|
|
|
|
public int Species { get => ReadUInt16LittleEndian(Data.AsSpan(0x1A)); set => WriteUInt16LittleEndian(Data.AsSpan(0x1A), (ushort)value); }
|
2018-08-10 04:53:39 +00:00
|
|
|
|
public int Form { get => Data[0x1C]; set => Data[0x1C] = (byte)value; }
|
|
|
|
|
public int Language { get => Data[0x1D]; set => Data[0x1D] = (byte)value; }
|
|
|
|
|
|
|
|
|
|
public string Nickname
|
|
|
|
|
{
|
2022-01-03 05:35:59 +00:00
|
|
|
|
get => StringConverter6.GetString(Data.AsSpan(0x1E, 0x1A));
|
|
|
|
|
set => StringConverter6.SetString(Data.AsSpan(0x1E, 0x1A), value.AsSpan(), 12, StringConverterOption.ClearZero);
|
2018-08-10 04:53:39 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int Nature { get => Data[0x38]; set => Data[0x38] = (byte)value; }
|
|
|
|
|
public int Gender { get => Data[0x39]; set => Data[0x39] = (byte)value; }
|
|
|
|
|
public int AbilityType { get => Data[0x3A]; set => Data[0x3A] = (byte)value; }
|
|
|
|
|
public int PIDType { get => Data[0x3B]; set => Data[0x3B] = (byte)value; }
|
2022-01-03 05:35:59 +00:00
|
|
|
|
public int EggLocation { get => ReadUInt16LittleEndian(Data.AsSpan(0x3C)); set => WriteUInt16LittleEndian(Data.AsSpan(0x3C), (ushort)value); }
|
|
|
|
|
public int MetLocation { get => ReadUInt16LittleEndian(Data.AsSpan(0x3E)); set => WriteUInt16LittleEndian(Data.AsSpan(0x3E), (ushort)value); }
|
2022-03-07 07:25:47 +00:00
|
|
|
|
public byte MetLevel { get => Data[0x40]; set => Data[0x40] = value; }
|
2016-07-27 03:18:48 +00:00
|
|
|
|
|
2017-05-13 03:32:36 +00:00
|
|
|
|
public int CNT_Cool { get => Data[0x41]; set => Data[0x41] = (byte)value; }
|
|
|
|
|
public int CNT_Beauty { get => Data[0x42]; set => Data[0x42] = (byte)value; }
|
|
|
|
|
public int CNT_Cute { get => Data[0x43]; set => Data[0x43] = (byte)value; }
|
|
|
|
|
public int CNT_Smart { get => Data[0x44]; set => Data[0x44] = (byte)value; }
|
|
|
|
|
public int CNT_Tough { get => Data[0x45]; set => Data[0x45] = (byte)value; }
|
|
|
|
|
public int CNT_Sheen { get => Data[0x46]; set => Data[0x46] = (byte)value; }
|
2016-07-27 03:18:48 +00:00
|
|
|
|
|
2017-05-13 03:32:36 +00:00
|
|
|
|
public int IV_HP { get => Data[0x47]; set => Data[0x47] = (byte)value; }
|
|
|
|
|
public int IV_ATK { get => Data[0x48]; set => Data[0x48] = (byte)value; }
|
|
|
|
|
public int IV_DEF { get => Data[0x49]; set => Data[0x49] = (byte)value; }
|
|
|
|
|
public int IV_SPE { get => Data[0x4A]; set => Data[0x4A] = (byte)value; }
|
|
|
|
|
public int IV_SPA { get => Data[0x4B]; set => Data[0x4B] = (byte)value; }
|
|
|
|
|
public int IV_SPD { get => Data[0x4C]; set => Data[0x4C] = (byte)value; }
|
2016-07-27 03:18:48 +00:00
|
|
|
|
|
2017-05-13 03:32:36 +00:00
|
|
|
|
public int OTGender { get => Data[0x4D]; set => Data[0x4D] = (byte)value; }
|
2018-08-10 04:53:39 +00:00
|
|
|
|
|
|
|
|
|
public string OT
|
|
|
|
|
{
|
2022-01-03 05:35:59 +00:00
|
|
|
|
get => StringConverter6.GetString(Data.AsSpan(0x4E, 0x1A));
|
|
|
|
|
set => StringConverter6.SetString(Data.AsSpan(0x4E, 0x1A), value.AsSpan(), 12, StringConverterOption.ClearZero);
|
2018-08-10 04:53:39 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-05-13 03:32:36 +00:00
|
|
|
|
public int Level { get => Data[0x68]; set => Data[0x68] = (byte)value; }
|
2021-03-29 07:14:44 +00:00
|
|
|
|
public bool IsEgg { get => Data[0x69] == 1; set => Data[0x69] = value ? (byte)1 : (byte)0; }
|
2022-01-03 05:35:59 +00:00
|
|
|
|
public uint PID { get => ReadUInt32LittleEndian(Data.AsSpan(0x6C)); set => WriteUInt32LittleEndian(Data.AsSpan(0x6C), value); }
|
|
|
|
|
public int RelearnMove1 { get => ReadUInt16LittleEndian(Data.AsSpan(0x70)); set => WriteUInt16LittleEndian(Data.AsSpan(0x70), (ushort)value); }
|
|
|
|
|
public int RelearnMove2 { get => ReadUInt16LittleEndian(Data.AsSpan(0x72)); set => WriteUInt16LittleEndian(Data.AsSpan(0x72), (ushort)value); }
|
|
|
|
|
public int RelearnMove3 { get => ReadUInt16LittleEndian(Data.AsSpan(0x74)); set => WriteUInt16LittleEndian(Data.AsSpan(0x74), (ushort)value); }
|
|
|
|
|
public int RelearnMove4 { get => ReadUInt16LittleEndian(Data.AsSpan(0x76)); set => WriteUInt16LittleEndian(Data.AsSpan(0x76), (ushort)value); }
|
2017-05-13 03:32:36 +00:00
|
|
|
|
public int OT_Intensity { get => Data[0x78]; set => Data[0x78] = (byte)value; }
|
|
|
|
|
public int OT_Memory { get => Data[0x79]; set => Data[0x79] = (byte)value; }
|
2022-01-03 05:35:59 +00:00
|
|
|
|
public int OT_TextVar { get => ReadUInt16LittleEndian(Data.AsSpan(0x7A)); set => WriteUInt16LittleEndian(Data.AsSpan(0x7A), (ushort)value); }
|
2017-05-13 03:32:36 +00:00
|
|
|
|
public int OT_Feeling { get => Data[0x7C]; set => Data[0x7C] = (byte)value; }
|
2016-07-27 03:18:48 +00:00
|
|
|
|
|
2017-05-13 03:32:36 +00:00
|
|
|
|
private byte RIB0 { get => Data[0x0C]; set => Data[0x0C] = value; }
|
|
|
|
|
private byte RIB1 { get => Data[0x0D]; set => Data[0x0D] = value; }
|
2018-08-10 04:53:39 +00:00
|
|
|
|
|
|
|
|
|
public bool RibbonChampionBattle { get => (RIB0 & (1 << 0)) == 1 << 0; set => RIB0 = (byte)((RIB0 & ~(1 << 0)) | (value ? 1 << 0 : 0)); }
|
|
|
|
|
public bool RibbonChampionRegional { get => (RIB0 & (1 << 1)) == 1 << 1; set => RIB0 = (byte)((RIB0 & ~(1 << 1)) | (value ? 1 << 1 : 0)); }
|
|
|
|
|
public bool RibbonChampionNational { get => (RIB0 & (1 << 2)) == 1 << 2; set => RIB0 = (byte)((RIB0 & ~(1 << 2)) | (value ? 1 << 2 : 0)); }
|
|
|
|
|
public bool RibbonCountry { get => (RIB0 & (1 << 3)) == 1 << 3; set => RIB0 = (byte)((RIB0 & ~(1 << 3)) | (value ? 1 << 3 : 0)); }
|
|
|
|
|
public bool RibbonNational { get => (RIB0 & (1 << 4)) == 1 << 4; set => RIB0 = (byte)((RIB0 & ~(1 << 4)) | (value ? 1 << 4 : 0)); }
|
|
|
|
|
public bool RibbonEarth { get => (RIB0 & (1 << 5)) == 1 << 5; set => RIB0 = (byte)((RIB0 & ~(1 << 5)) | (value ? 1 << 5 : 0)); }
|
|
|
|
|
public bool RibbonWorld { get => (RIB0 & (1 << 6)) == 1 << 6; set => RIB0 = (byte)((RIB0 & ~(1 << 6)) | (value ? 1 << 6 : 0)); }
|
|
|
|
|
public bool RibbonEvent { get => (RIB0 & (1 << 7)) == 1 << 7; set => RIB0 = (byte)((RIB0 & ~(1 << 7)) | (value ? 1 << 7 : 0)); }
|
|
|
|
|
public bool RibbonChampionWorld { get => (RIB1 & (1 << 0)) == 1 << 0; set => RIB1 = (byte)((RIB1 & ~(1 << 0)) | (value ? 1 << 0 : 0)); }
|
|
|
|
|
public bool RibbonBirthday { get => (RIB1 & (1 << 1)) == 1 << 1; set => RIB1 = (byte)((RIB1 & ~(1 << 1)) | (value ? 1 << 1 : 0)); }
|
|
|
|
|
public bool RibbonSpecial { get => (RIB1 & (1 << 2)) == 1 << 2; set => RIB1 = (byte)((RIB1 & ~(1 << 2)) | (value ? 1 << 2 : 0)); }
|
|
|
|
|
public bool RibbonSouvenir { get => (RIB1 & (1 << 3)) == 1 << 3; set => RIB1 = (byte)((RIB1 & ~(1 << 3)) | (value ? 1 << 3 : 0)); }
|
|
|
|
|
public bool RibbonWishing { get => (RIB1 & (1 << 4)) == 1 << 4; set => RIB1 = (byte)((RIB1 & ~(1 << 4)) | (value ? 1 << 4 : 0)); }
|
|
|
|
|
public bool RibbonClassic { get => (RIB1 & (1 << 5)) == 1 << 5; set => RIB1 = (byte)((RIB1 & ~(1 << 5)) | (value ? 1 << 5 : 0)); }
|
|
|
|
|
public bool RibbonPremier { get => (RIB1 & (1 << 6)) == 1 << 6; set => RIB1 = (byte)((RIB1 & ~(1 << 6)) | (value ? 1 << 6 : 0)); }
|
|
|
|
|
public bool RIB1_7 { get => (RIB1 & (1 << 7)) == 1 << 7; set => RIB1 = (byte)((RIB1 & ~(1 << 7)) | (value ? 1 << 7 : 0)); }
|
|
|
|
|
|
2022-03-07 07:25:47 +00:00
|
|
|
|
public byte LevelMin => MetLevel;
|
|
|
|
|
public byte LevelMax => MetLevel;
|
2016-07-27 03:18:48 +00:00
|
|
|
|
|
2020-11-12 05:01:41 +00:00
|
|
|
|
public IReadOnlyList<int> Moves
|
2016-07-27 03:18:48 +00:00
|
|
|
|
{
|
2017-05-13 03:32:36 +00:00
|
|
|
|
get => new[] { Move1, Move2, Move3, Move4 };
|
2016-07-27 03:18:48 +00:00
|
|
|
|
set
|
|
|
|
|
{
|
2020-11-12 05:01:41 +00:00
|
|
|
|
if (value.Count > 0) Move1 = value[0];
|
|
|
|
|
if (value.Count > 1) Move2 = value[1];
|
|
|
|
|
if (value.Count > 2) Move3 = value[2];
|
|
|
|
|
if (value.Count > 3) Move4 = value[3];
|
2016-07-27 03:18:48 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2018-08-10 04:53:39 +00:00
|
|
|
|
|
2020-11-12 05:01:41 +00:00
|
|
|
|
public IReadOnlyList<int> RelearnMoves
|
2016-07-27 03:18:48 +00:00
|
|
|
|
{
|
2017-05-13 03:32:36 +00:00
|
|
|
|
get => new[] { RelearnMove1, RelearnMove2, RelearnMove3, RelearnMove4 };
|
2016-07-27 03:18:48 +00:00
|
|
|
|
set
|
|
|
|
|
{
|
2020-11-12 05:01:41 +00:00
|
|
|
|
if (value.Count > 0) RelearnMove1 = value[0];
|
|
|
|
|
if (value.Count > 1) RelearnMove2 = value[1];
|
|
|
|
|
if (value.Count > 2) RelearnMove3 = value[2];
|
|
|
|
|
if (value.Count > 3) RelearnMove4 = value[3];
|
2016-07-27 03:18:48 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2021-07-16 03:39:53 +00:00
|
|
|
|
|
|
|
|
|
public int Generation => 6;
|
|
|
|
|
public bool IsShiny => false;
|
|
|
|
|
public bool EggEncounter => false;
|
|
|
|
|
public GameVersion Version => GameVersion.Gen6;
|
|
|
|
|
|
|
|
|
|
public PKM ConvertToPKM(ITrainerInfo sav) => ConvertToPKM(sav, EncounterCriteria.Unrestricted);
|
|
|
|
|
|
|
|
|
|
public PKM ConvertToPKM(ITrainerInfo sav, EncounterCriteria criteria)
|
|
|
|
|
{
|
|
|
|
|
var wc6 = new WC6();
|
|
|
|
|
Data.CopyTo(wc6.Data, 0x68);
|
|
|
|
|
return wc6.ConvertToPKM(sav, criteria);
|
|
|
|
|
}
|
2016-07-27 03:18:48 +00:00
|
|
|
|
}
|
2021-07-16 03:39:53 +00:00
|
|
|
|
}
|