public static string ElmResponses(uint seed, uint count, uint skips) { string responses = ""; var rng = new PokeRng(seed); uint rngCalls = count + skips; if (skips > 0) { responses += "("; } for (int n = 0; n < rngCalls; n++) { ushort response = rng.GetNext16BitNumber(); response %= 3; if (response == 0) { responses += "E"; } if (response == 1) { responses += "K"; } if (response == 2) { responses += "P"; } // Skip the last item if (n != rngCalls - 1) { if (skips != 0 && skips == n + 1) { responses += " skipped) "; } else { responses += ", "; } } } return(responses); }
public static string ElmResponses(uint seed, uint count, uint skips) { string responses = ""; var rng = new PokeRng(seed); uint rngCalls = count + skips; if (skips > 0) { responses += "("; } for (int n = 0; n < rngCalls; n++) { ushort response = rng.GetNext16BitNumber(); response %= 3; if (response == 0) responses += "E"; if (response == 1) responses += "K"; if (response == 2) responses += "P"; // Skip the last item if (n != rngCalls - 1) { if (skips != 0 && skips == n + 1) { responses += " skipped) "; } else { responses += ", "; } } } return responses; }
public static HgSsRoamerInformation GetHgSsRoamerInformation( uint seed, bool rRoaming, bool eRoaming, bool lRoaming, uint rPreviousRoute, uint ePreviousRoute, uint lPreviousRoute) { var information = new HgSsRoamerInformation(); var rng = new PokeRng(seed); uint rngCalls = 0; if (rRoaming) { while (true) { rngCalls++; uint rngReturn = rng.GetNext16BitNumber(); uint route = RouteFromRngJ(rngReturn); if (rPreviousRoute != route) { information.RCurrentRoute = route; break; } } } if (eRoaming) { while (true) { rngCalls++; uint rngReturn = rng.GetNext16BitNumber(); uint route = RouteFromRngJ(rngReturn); if (ePreviousRoute != route) { information.ECurrentRoute = route; break; } } } if (lRoaming) { while (true) { rngCalls++; uint rngReturn = rng.GetNext16BitNumber(); uint route = RouteFromRngK(rngReturn); if (lPreviousRoute != route) { information.LCurrentRoute = route; break; } } } information.RngCalls = rngCalls; return(information); }
public static HgSsRoamerInformation GetHgSsRoamerInformation( uint seed, bool rRoaming, bool eRoaming, bool lRoaming, uint rPreviousRoute, uint ePreviousRoute, uint lPreviousRoute) { var information = new HgSsRoamerInformation(); var rng = new PokeRng(seed); uint rngCalls = 0; if (rRoaming) { while (true) { rngCalls++; ushort rngReturn = rng.GetNext16BitNumber(); uint route = RouteFromRngJ(rngReturn); if (rPreviousRoute != route) { information.RCurrentRoute = route; break; } } } if (eRoaming) { while (true) { rngCalls++; ushort rngReturn = rng.GetNext16BitNumber(); uint route = RouteFromRngJ(rngReturn); if (ePreviousRoute != route) { information.ECurrentRoute = route; break; } } } if (lRoaming) { while (true) { rngCalls++; ushort rngReturn = rng.GetNext16BitNumber(); uint route = RouteFromRngK(rngReturn); if (lPreviousRoute != route) { information.LCurrentRoute = route; break; } } } information.RngCalls = rngCalls; return information; }