mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-07-16 12:50:55 -05:00
Swap rand call order, rename as overload
This commit is contained in:
parent
ba5cc26e83
commit
467045e95c
|
|
@ -390,8 +390,8 @@ public override PKM ConvertToPKM(ITrainerInfo SAV, EncounterCriteria criteria)
|
|||
SetEggMetData(pk);
|
||||
pk.CurrentFriendship = pk.IsEgg ? pi.HatchCycles : pi.BaseFriendship;
|
||||
|
||||
pk.HeightScalar = PokeSizeExtensions.GetRandomPokeSize();
|
||||
pk.WeightScalar = PokeSizeExtensions.GetRandomPokeSize();
|
||||
pk.HeightScalar = PokeSizeExtensions.GetRandomScalar();
|
||||
pk.WeightScalar = PokeSizeExtensions.GetRandomScalar();
|
||||
|
||||
pk.RefreshChecksum();
|
||||
return pk;
|
||||
|
|
|
|||
|
|
@ -38,10 +38,13 @@ public static int GetRandomScalar(this PokeSize size)
|
|||
PokeSize.AV => (Util.Rand.Next(0xA0) + 0x30),
|
||||
PokeSize.L => (Util.Rand.Next(0x20) + 0xD0),
|
||||
PokeSize.XL => (Util.Rand.Next(0x10) + 0xF0),
|
||||
_ => GetRandomPokeSize() // Official code sums two randoms for triangular distribution.
|
||||
_ => GetRandomScalar()
|
||||
};
|
||||
}
|
||||
|
||||
public static int GetRandomPokeSize() => Util.Rand.Next(0x80) + Util.Rand.Next(0x81);
|
||||
/// <summary>
|
||||
/// Gets a random size scalar with a triangular distribution (copying official implementation).
|
||||
/// </summary>
|
||||
public static int GetRandomScalar() => Util.Rand.Next(0x81) + Util.Rand.Next(0x80);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user