mirror of
https://github.com/kwsch/PKHeX
synced 2025-02-17 05:48:44 +00:00
Better way to generate final IVs
- HP IV isn't fixed
This commit is contained in:
parent
cf29c912be
commit
c0338dfaaf
2 changed files with 6 additions and 8 deletions
|
@ -381,11 +381,10 @@ namespace PKHeX.Core
|
|||
switch (IVs[0])
|
||||
{
|
||||
case 0xFE:
|
||||
finalIVs[0] = 31;
|
||||
do { // 31 HP IV, 2 other 31s
|
||||
for (int i = 1; i < 6; i++)
|
||||
do { // 3 Perfect IVs
|
||||
for (int i = 0; i < 6; i++)
|
||||
finalIVs[i] = IVs[i] > 31 ? (int)(Util.rnd32() & 0x1F) : IVs[i];
|
||||
} while (finalIVs.Count(r => r == 31) < 3); // 31 + 2*31
|
||||
} while (finalIVs.Count(r => r == 31) < 3); // 3*31
|
||||
break;
|
||||
case 0xFD:
|
||||
do { // 2 other 31s
|
||||
|
|
|
@ -408,11 +408,10 @@ namespace PKHeX.Core
|
|||
switch (IVs[0])
|
||||
{
|
||||
case 0xFE:
|
||||
finalIVs[0] = 31;
|
||||
do { // 31 HP IV, 2 other 31s
|
||||
for (int i = 1; i < 6; i++)
|
||||
do { // 3 Perfect IVs
|
||||
for (int i = 0; i < 6; i++)
|
||||
finalIVs[i] = IVs[i] > 31 ? (int)(Util.rnd32() & 0x1F) : IVs[i];
|
||||
} while (finalIVs.Count(r => r == 31) < 3); // 31 + 2*31
|
||||
} while (finalIVs.Count(r => r == 31) < 3); // 3*31
|
||||
break;
|
||||
case 0xFD:
|
||||
do { // 2 other 31s
|
||||
|
|
Loading…
Add table
Reference in a new issue