Skip to content

Instantly share code, notes, and snippets.

/*
* The Pokemart
*
* This assignment has you working with Objects and Functions/Methods.
* The goal is to create code to represent a pokemart that sells items, and then
* simulate a player purchasing some items from the pokemart.
*
* Requirements [READ CAREFULLY]:
* The pokemart must be an Object containing at least 10 items. You can pick what
* items are sold and at what price.
@Lusamine
Lusamine / Complete IoA Restricted Sparring Sets
Last active July 23, 2020 08:49
Complete IoA Restricted Sparring Sets
All of these sets were dumped directly from the game.
Please note that the Ability and Gender are randomized. Everything else is the same every time.
Yep, there are GMax sets in here, but they don't ever Dynamax/Gigantamax in game.
You can see the distribution of abilities for the sample here:
https://gist.github.com/Lusamine/e93a15312b0d18789fbe807e0d908fcc
Enjoy!
Total Unique Species: 150
Total Pokemon: 801
Total Abilities:
Ability 1: 274
Ability 2: 280
Ability 4: 247
Dex Species Ability (#) Count
012 Butterfree CompoundEyes (1) 2
757 = G-Max Fireball
758 = Max Flutterby, G-Max Befuddle
759 = Max Lightning, G-Max Volt Crash
760 = Max Strike, G-Max Cuddle, G-Max Gold Rush, G-Max Replenish
761 = Max Knuckle, G-Max Chi Strike
765 = Max Geyser, G-Max Cannonade, G-Max Foam Burst, G-Max Hydrosnipe, G-Max Stonesurge, G-Max Rapid Flow
766 = Max Airstream, G-Max Wind Rage
767 = Max Starfall, G-Max Smite, G-Max Finale
772 = Max Darkness, G-Max One Blow
773 = Max Overgrowth, G-Max Vine Lash, G-Max Drum Solo
@Lusamine
Lusamine / Overworld RNG in Gen 8 (SWSH).MD
Last active October 30, 2023 20:14
A hopefully simple-to-understand explanation of how Pokémon Sword/Shield's overworld encounters are generated.

Introduction

Pokémon Sword and Shield carried over wandering overworld Pokémon from the Let's Go games. Unlike LGPE, these overworld wanderers have identifiable origins, and thus it is possible to legality check them by verifying the correlation between certain values in their data similar to gen 3-4 PIDIV.

Overworld data is stored in the save file in the overworld block. This is why you can save in front of a strong spawn or Galarian bird, reset the game, and encounter exactly the same Pokémon.

Can Overworld RNG be abused or manipulated?

It was recently discovered in October 2021 that this is possible to do. Current methods can be done with or without CFW. Additionally, the presence of overworld data allows for the creation of CFW bots that simply scan overworld data for shiny or marked Pokémon without ever engaging in battle.

What Pokémon does Overworld RNG apply to?

The categorization can seem complex, so let me break it down:

Introduction

It's possible to call over two Pokémon in Camp and talk to both to assess their sociability. Messages are sorted into groups. Each combination of sociabilities will sample from particular groups of messages.

Sociability Ranges

Pokémon sociability ranges here are matched to the message groups that are used. It is useful to note that the "best friends" message only appears if both Pokémon have 255 sociability.

  • 0-49: A
  • 50-74: B
  • 75-124: B, C
  • 125-149: C, D
  • 150-199: D, E
@Lusamine
Lusamine / BDSP Mystery Gift Calculator.cs
Last active September 24, 2022 01:06
Go anywhere where the advances go +1 at a time. Delay is 0 on this script, or you can figure it out for yourself.
int FlawlessIVs = 0;
void Main()
{
// Initial state
// s0 should be s1, s0 from CS
// s1 should be s3, s2 from CS
ulong s0 = 0x0123456789ABCDEF;
ulong s1 = 0x0123456789ABCDEF;
@Lusamine
Lusamine / BDSP Roamer Spread Calculator.cs
Last active January 14, 2022 05:36
Ignored nature because lazy and spreads are limited already; you can use Synchronize if you care.
void Main()
{
// Initial state
// s0 should be s1, s0 from CS
// s1 should be s3, s2 from CS
ulong s0 = 0x0123456789ABCDEF;
ulong s1 = 0x0123456789ABCDEF;
// Set this for how far you want to search.
int maxAdvance = 500000;
@Lusamine
Lusamine / BDSP Stationary and Wild Calculator.cs
Last active September 5, 2022 02:28
LINQPad version for quickly searching BDSP stationary and wild spreads. Slots are referenced from Poké Finder but aren't always correct, needs more research.
// Global settings to make things easier.
// Set these values for your gender ratio:
// Fixed gender = -1
// 50 M : 50 F = 127
// 25 M : 75 F = 191
// 75 M : 25 F = 63
// 87.5 M : 12.5 F = 31
// Litleo line doesn't exist in BDSP so we can ignore the last case.
int GenderCompare = -1;
@Lusamine
Lusamine / Use 128-bit state input for BDSP scripts.md
Created December 27, 2021 13:39
If you prefer to use one copy/paste from CopySeed instead of two...

Change

    // Initial state
    // s0 should be s1, s0 from CS
    // s1 should be s3, s2 from CS
    ulong s0 = 0x0123456789ABCDEF;
    ulong s1 = 0x0123456789ABCDEF;

to