public Hollow GenerateHollow(uint[] rngArray, uint rngStart) { var hollow = new Hollow { SubSlot = (ushort)Functions.RNGRange(rngArray[rngStart++], 4) }; uint rslot = Functions.RNGRange(rngArray[rngStart++], 100) + 1; ushort slot = 0; for (uint sum = 0; slot < 10; ++slot) { sum += slots[slot]; if (sum >= rslot) { break; } } // in the game there is a check here and if slot = 2 // is possible to loop up to 2 more times // however it looks like that actually never happens // so we are skipping it hollow.Slot = slot; hollow.Gender = Functions.RNGRange(rngArray[rngStart], 100); return(hollow); }
public Hollow GenerateHollow(uint[] rngArray, uint rngStart) { var hollow = new Hollow {SubSlot = (ushort) Functions.RNGRange(rngArray[rngStart++], 4)}; uint rslot = Functions.RNGRange(rngArray[rngStart++], 100) + 1; ushort slot = 0; for (uint sum = 0; slot < 10; ++slot) { sum += slots[slot]; if (sum >= rslot) break; } // in the game there is a check here and if slot = 2 // is possible to loop up to 2 more times // however it looks like that actually never happens // so we are skipping it hollow.Slot = slot; hollow.Gender = Functions.RNGRange(rngArray[rngStart], 100); return hollow; }
public List <Hollow> Generate(ulong seed) { var hollows = new List <Hollow>(); uint startingFrame = Functions.initialPIDRNGBW2(seed); uint[] rngArray = FillRNGArray(startingFrame, seed); for (uint i = 0; i <= MaxAdvances; ++i) { uint offset = i; for (ushort h = 0; h < OpenHollows; ++h) { // hollow check if (Functions.RNGRange(rngArray[offset++], 100) >= 5) { continue; } Hollow hollow = GenerateHollow(rngArray, offset); // if it's not what we're searching for skip it, null = show all if (Hollows != null && !Hollows.Contains(h)) { continue; } if ((Slots != null && !Slots.Contains(hollow.Slot)) || (SubSlots != null && !SubSlots.Contains(hollow.SubSlot))) { continue; } // gender filter goes here switch (GenderRatio) { case 60: if (hollow.Female60 != Gender) { continue; } break; case 30: if (hollow.Female30 != Gender) { continue; } break; case 10: if (hollow.Female10 != Gender) { continue; } break; case 5: if (hollow.Female5 != Gender) { continue; } break; } hollow.Seed = seed; hollow.StartingFrame = startingFrame; hollow.Frame = startingFrame + i; hollow.HollowNumber = h; hollows.Add(hollow); } } return(hollows); }