public SeedRecipe(PseudoRNG random, uint seed) { Seed = seed; Random = random; PickMaterials(Liquids, 3); PickMaterials(Alchemy, 1); ShuffleMaterials(); Random.Get(); Random.Get(); }
private void ShuffleMaterials() { PseudoRNG random = new PseudoRNG((Seed >> 1) + 12534); for (int i = Materials.Count - 1; i >= 0; i--) { int rand = (int)(random.Get() * (i + 1)); var tmp = Materials[i]; Materials[i] = Materials[rand]; Materials[rand] = tmp; } }
public static SeedRecipeData GetRecipesForSeed(uint seed) { var random = new PseudoRNG(seed * 0.17127 + 1323.5903); for (int i = 0; i < 5; i++) { random.Get(); } return(new SeedRecipeData { LivelyConcoction = (new SeedRecipe(random, seed)).GetMaterials(), AlchemicalPrecursor = (new SeedRecipe(random, seed)).GetMaterials() }); }