mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-04-18 21:19:14 -05:00
* Update to .NET 10 * Property fields * API signature updates * Extension method blocks * Completed dark mode support Outside of my control: - vertical tab control (pkm editor) - datetimepicker controls - lgpe event flags (no idea) - some control types having white-borders when they should really be gray Box background is 50% transparency to effectively darken the image. * Custom legality report popup * Event diff dialog, version select dialog * Add quick overwrite popup for export sav * Extension methods * Dark Mode: glow currently editing sprite * Add invalid encounter hint for trade evolutions * Extension properties * Append legality hint on hover card * Slot image loading: clear the screen-reader description if a slot is empty/invalid, rather than retain the previous description. Changing boxes would easily confuse users on this.
31 lines
1004 B
C#
31 lines
1004 B
C#
using System;
|
|
|
|
namespace PKHeX.Core;
|
|
|
|
/// <summary>
|
|
/// Logic to apply a Hidden Power type to a <see cref="PKM"/>.
|
|
/// </summary>
|
|
public static class HiddenPowerApplicator
|
|
{
|
|
extension(PKM pk)
|
|
{
|
|
/// <summary>
|
|
/// Sets the <see cref="PKM.IVs"/> to match a provided <see cref="hiddenPowerType"/>.
|
|
/// </summary>
|
|
/// <param name="hiddenPowerType">Desired Hidden Power typing.</param>
|
|
public void SetHiddenPower(int hiddenPowerType)
|
|
{
|
|
Span<int> IVs = stackalloc int[6];
|
|
pk.GetIVs(IVs);
|
|
HiddenPower.SetIVsForType(hiddenPowerType, IVs, pk.Context);
|
|
pk.SetIVs(IVs);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Sets the <see cref="PKM.IVs"/> to match a provided <see cref="hiddenPowerType"/>.
|
|
/// </summary>
|
|
/// <param name="hiddenPowerType">Desired Hidden Power typing.</param>
|
|
public void SetHiddenPower(MoveType hiddenPowerType) => pk.SetHiddenPower((int)hiddenPowerType);
|
|
}
|
|
}
|