Geck Volant Marin : Luck Based RNG

This is a simple yet complete and balanced .dll library that adds random functions based on luck.

What is luck?

Luck is a double value that enchance probabilies.

Positive luck effect:

  • Increase the chances of getting a big number when using getRandomNumber_InRange()
  • Increase the chances of returning true when using getRandomBool_FromFraction()
  • Increase the small weights and decrease the big weights of every elements of a weights array when using generateNewWeights()
  • Have higher chances of generating a rare outcome when using getRandomThings_FromArray<Type>()

Negative luck effect:

  • Increase the chances of getting a small number when using getRandomNumber_InRange()
  • Increase the chances of returning false when using getRandomBool_FromFraction()
  • Increase the big weights and decrease the small weights of every elements of a weights array when using generateNewWeights()
  • Have higher chances of generating a common outcome when using getRandomThings_FromArray<Type>()

Neutral luck:

  • Don't change anything and generate as if there was no luck.

Available functions and methods:

  • void GeckVolantMarin.RNG.setSeed(int seed)
  • void GeckVolantMarin.RNG.reSeed()
  • double GeckVolantMarin.RNG.getRandomNumber_InRange(double min, double max, double luck = 0.0d)
  • bool GeckVolantMarin.RNG.getRandomBool_FromFraction(double numerator, double denominator = 1.0d, double luck = 0.0d)
  • double GeckVolantMarin.RNG.getTotalWeight_FromArray(double[] weights)
  • void GeckVolantMarin.RNG.generateNewWeights(ref double[] weights, double luck = 0.0d)
  • Type GeckVolantMarin.RNG.getRandomThings_FromArray<Type>(Type[] array, double[] weights, double luck = 0.0d)

Source code

The source code is available in the plugin folder, in SourceCode.zip.

Thanks To:

  • The modding community
  • ILSpy developers (For unpacking the code base game)
  • AssetStudio developers (For unpacking the assets of the base game)

Credits

@Heartslot

Thunderstore development is made possible with ads. Please consider making an exception to your adblock.
Thunderstore development is made possible with ads. Please consider making an exception to your adblock.
Thunderstore development is made possible with ads. Please consider making an exception to your adblock.