mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-08-17 07:19:21 -05:00
Exclude same gender rival in PokeGear callers for HGSS (#4848)
Added functionality to exclude the opposite-gender rival (self) from PokeGear callers. * Remove Bike Shop from Pokegear callers list: It's not legally obtainable you only get called once you've used the Bike enough you never get to save it. * Exclude bike shop in caller list logic Updated logic to exclude both the rival and bike shop from the caller list.
This commit is contained in:
@@ -221,10 +221,27 @@ public Span<PokegearNumber> GetPokeGearRoloDex()
|
||||
|
||||
public void SetPokeGearRoloDex(ReadOnlySpan<PokegearNumber> value) => value.CopyTo(GetPokeGearRoloDex());
|
||||
|
||||
/// <summary>
|
||||
/// Returns the player's own on-screen character (Ethan/Lyra), which should not appear as a phone contact.
|
||||
/// </summary>
|
||||
private PokegearNumber PlayerCharacterRival => Gender == 0 ? PokegearNumber.Ethan : PokegearNumber.Lyra;
|
||||
|
||||
public void PokeGearUnlockAllCallers()
|
||||
{
|
||||
var excluded = PlayerCharacterRival;
|
||||
var dex = GetPokeGearRoloDex();
|
||||
|
||||
int index = 0;
|
||||
for (int i = 0; i < GearCallerCount; i++)
|
||||
SetCallerAtIndex(i, (PokegearNumber)i);
|
||||
{
|
||||
var caller = (PokegearNumber)i;
|
||||
if (caller == excluded || caller == PokegearNumber.Bike_Shop)
|
||||
continue;
|
||||
dex[index++] = caller;
|
||||
}
|
||||
|
||||
// clear remaining callers
|
||||
PokeGearClearAllCallers(index);
|
||||
}
|
||||
|
||||
public void PokeGearClearAllCallers(int start = 0)
|
||||
@@ -244,17 +261,24 @@ public void PokeGearClearAllCallers(int start = 0)
|
||||
PokegearNumber.Daycare_Man,
|
||||
PokegearNumber.Daycare_Lady,
|
||||
PokegearNumber.Bill,
|
||||
PokegearNumber.Bike_Shop,
|
||||
PokegearNumber.Baoba,
|
||||
];
|
||||
|
||||
public void PokeGearUnlockAllCallersNoTrainers()
|
||||
{
|
||||
var excluded = PlayerCharacterRival;
|
||||
var dex = GetPokeGearRoloDex();
|
||||
NotTrainers.CopyTo(dex);
|
||||
|
||||
int index = 0;
|
||||
foreach (var caller in NotTrainers)
|
||||
{
|
||||
if (caller == excluded)
|
||||
continue;
|
||||
dex[index++] = caller;
|
||||
}
|
||||
|
||||
// clear remaining callers
|
||||
PokeGearClearAllCallers(NotTrainers.Length);
|
||||
PokeGearClearAllCallers(index);
|
||||
}
|
||||
|
||||
public Pokeathlon4 Pokeathlon => new(GeneralBuffer.Slice(0xD9D4, Pokeathlon4.SIZE)); // 0xB80
|
||||
|
||||
Reference in New Issue
Block a user