0.6.8 • Published 7 years ago

rngwarecore v0.6.8

Weekly downloads
-
License
Apache 2.0
Repository
github
Last release
7 years ago

RNGWareCore

Gen 3, 4, and 6 RNG Backend written in JavaScript

Better Readme to come soon and maybe some API documentation, but for now, just know it's a neato thing.

Installation

npm install --save rngwarecore

Usage

Import the module with Gen3RNG, Gen6RNG, and/or Gen6Egg.

import { Gen3RNG, Gen6Egg } from 'rngwarecore';

Both Gen3RNG and Gen6RNG have the same basic functions. The first argument is a seed (defaults to 0) with the second argument being the number of max frames you'll need (defaults to 100,000).

The simplest way to use this would be:

var g3 = new Gen3RNG();

However, you can also do this:

var g3 = new Gen3RNG(0xAABBCCDD, 1000);

From there, you can get one Pokemon using the pokeFrame method (requires one argument for the frame you'd like to see the Pokemon of):

g3.pokeFrame(22);

For Gen 3, you can also specify the RNG Method used.

Valid RNG Methods are:

  • "Method 1"
  • "Method 2"
  • "Method 4"
  • "Method H-1"
  • "Method H-2"
  • "Method H-4"
  • "Method J" (Which is for Diamond, Pearl, and Platinum, but uses the same mechanics as Gen 3)
  • "Method K" (Which is for Heart Gold and Soul Silver, but uses the same mechanics as Gen 3)

Example:

g3.pokeFrame(22, "Method H-2");

The pokeFrame method also has third and fourth arguments for filters and extra generation specific arguments - you can check out the examples for specific use cases.

pokeFrame methods are meant to be uniform - they all accept the same arguments. For something like Gen6Egg that needs additional arguments like parent Pokemon details and egg seeds, the fourth argument of pokeFrame is used.

Each rng type has a "clear" method. This is used in between searches to clear any remaining data from old searches. For example, looping the pokeFrame method for Gen 6 Eggs will still have the last egg seed stored as a property. The clear method will remove this.

Contributing

See here.

Credits

  • Shiny_Sylveon - Supporting this, me, and making sure I get rest when needed.
  • Admiral_Fish - His work in optimizing RNG Reporter and knowledge from that has helped with past gen methods including fixing PSV calculations, adding Method K, and more.
  • wwwwwwzx - His 3DSRNGTool was laid out nicely - He's done a great job with 3DSRNGTool and it's been very simple to port current gen methods to JavaScript.
  • The founders of RNG Reporter - your work inspired the RNG scene and gave a great tool to port to JavaScript.
  • bumba and Admiral_Fish - Comedic Relief
0.6.8

7 years ago

0.6.7

7 years ago

0.6.6

7 years ago

0.6.5

7 years ago

0.6.4

7 years ago

0.6.3

7 years ago

0.6.2

7 years ago

0.6.1

7 years ago

0.5.7

7 years ago

0.5.6

7 years ago

0.5.5

7 years ago

0.5.4

7 years ago

0.5.3

7 years ago

0.5.2

7 years ago

0.5.1

7 years ago

0.5.0

7 years ago

0.4.1

7 years ago

0.4.0

7 years ago

0.3.0

7 years ago

0.2.0

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago