mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-26 22:10:21 +00:00
Force shiny state of raids
Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com>
This commit is contained in:
parent
5636e1ef4a
commit
64039b4070
2 changed files with 20 additions and 10 deletions
|
@ -110,6 +110,9 @@ namespace PKHeX.Core
|
|||
if (pk.Nature != pk.StatNature && ((Nature)pk.StatNature).IsNeutral())
|
||||
pk.StatNature = (int)Nature.Serious;
|
||||
}
|
||||
var pid = pk.PID;
|
||||
RaidRNG.ForceShinyState(pk, Shiny == Shiny.Always, ref pid);
|
||||
pk.PID = pid;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace PKHeX.Core
|
||||
{
|
||||
|
@ -59,16 +60,7 @@ namespace PKHeX.Core
|
|||
isShiny = shiny == Shiny.Always;
|
||||
}
|
||||
|
||||
if (isShiny)
|
||||
{
|
||||
if (!GetIsShiny(pk.TID, pk.SID, pid))
|
||||
pid = GetShinyPID(pk.TID, pk.SID, pid, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (GetIsShiny(pk.TID, pk.SID, pid))
|
||||
pid ^= 0x1000_0000;
|
||||
}
|
||||
ForceShinyState(pk, isShiny, ref pid);
|
||||
|
||||
if (pk.PID != pid)
|
||||
return false;
|
||||
|
@ -181,6 +173,21 @@ namespace PKHeX.Core
|
|||
return true;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static void ForceShinyState(PKM pk, bool isShiny, ref uint pid)
|
||||
{
|
||||
if (isShiny)
|
||||
{
|
||||
if (!GetIsShiny(pk.TID, pk.SID, pid))
|
||||
pid = GetShinyPID(pk.TID, pk.SID, pid, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (GetIsShiny(pk.TID, pk.SID, pid))
|
||||
pid ^= 0x1000_0000;
|
||||
}
|
||||
}
|
||||
|
||||
private static bool ApplyDetailsTo(PKM pk, ulong seed, int[] ivs, int iv_count, int ability_param, int gender_ratio, sbyte nature_param = -1, Shiny shiny = Shiny.Random)
|
||||
{
|
||||
var rng = new Xoroshiro128Plus(seed);
|
||||
|
|
Loading…
Reference in a new issue