2020-08-01 00:25:14 +00:00
|
|
|
|
namespace PKHeX.Core
|
|
|
|
|
{
|
2020-08-02 22:51:22 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Exposes memory details for the Handling Trainer (not OT).
|
|
|
|
|
/// </summary>
|
2020-08-01 00:25:14 +00:00
|
|
|
|
public interface IMemoryHT
|
|
|
|
|
{
|
2022-03-06 20:01:47 +00:00
|
|
|
|
byte HT_Memory { get; set; }
|
|
|
|
|
ushort HT_TextVar { get; set; }
|
|
|
|
|
byte HT_Feeling { get; set; }
|
|
|
|
|
byte HT_Intensity { get; set; }
|
2020-08-01 00:25:14 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static partial class Extensions
|
|
|
|
|
{
|
2020-08-02 22:51:22 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Sets a Link Trade memory to the <see cref="ht"/>.
|
|
|
|
|
/// </summary>
|
2021-08-29 20:15:45 +00:00
|
|
|
|
public static void SetTradeMemoryHT6(this IMemoryHT ht, bool bank)
|
2020-08-01 00:25:14 +00:00
|
|
|
|
{
|
|
|
|
|
ht.HT_Memory = 4; // Link trade to [VAR: General Location]
|
2022-03-06 20:01:47 +00:00
|
|
|
|
ht.HT_TextVar = bank ? (byte)0 : (byte)9; // Somewhere (Bank) : Pokécenter (Trade)
|
2020-08-01 00:25:14 +00:00
|
|
|
|
ht.HT_Intensity = 1;
|
2021-08-22 23:41:57 +00:00
|
|
|
|
ht.HT_Feeling = MemoryContext6.GetRandomFeeling6(4, bank ? 10 : 20); // 0-9 Bank, 0-19 Trade
|
2020-08-01 00:25:14 +00:00
|
|
|
|
}
|
|
|
|
|
|
2021-08-29 20:15:45 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Sets a Link Trade memory to the <see cref="ht"/>.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static void SetTradeMemoryHT8(this IMemoryHT ht)
|
|
|
|
|
{
|
|
|
|
|
ht.HT_Memory = 4; // Link trade to [VAR: General Location]
|
|
|
|
|
ht.HT_TextVar = 9; // Pokécenter (Trade)
|
|
|
|
|
ht.HT_Intensity = 1;
|
|
|
|
|
ht.HT_Feeling = MemoryContext8.GetRandomFeeling8(4, 20); // 0-19 Trade
|
|
|
|
|
}
|
|
|
|
|
|
2020-08-02 22:51:22 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Sets all values to zero.
|
|
|
|
|
/// </summary>
|
2020-08-01 00:25:14 +00:00
|
|
|
|
public static void ClearMemoriesHT(this IMemoryHT ht)
|
|
|
|
|
{
|
2022-03-06 20:01:47 +00:00
|
|
|
|
ht.HT_TextVar = ht.HT_Memory = ht.HT_Feeling = ht.HT_Intensity = 0;
|
2020-08-01 00:25:14 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|