RandomValueLib
It has been supported to REPO v0.4.4 version, communication QQ group 573485890, core random price library, provides deterministic random algorithm, black and white list, cash bag protection and other rules for other modules to call.
About this mod Machine translation
💬 Exchange feedback
QQ group: 573485890, welcome to join the group to discuss and provide feedback.
RandomValueLib
Version: 1.0.5 | License: MIT
📖 Overview
The core random price library provides unified valuable item price randomization logic for the "REPO" module.
✨ Features
- Deterministic random algorithm (based on item ID and optional extra seeds)
- Configurable magnification range, black and white list, cash bag protection, high-priced item exclusion
- Provides two methods of pure calculation and direct modification
- Reflective reading and writing of price fields, compatible with public and non-public environments
📦 Installation
Place RandomValueLib.dll into the BepInEx/plugins folder (automatically installed as a dependency of other modules, generally no manual operation is required).
🔌 Usage examples
using RandomValueLib;
var config = new RandomizationConfig
{
MinMultiplier = 0.5f,
MaxMultiplier = 2.0f,
//Set other rules as needed
};
//Method 1: Apply random price directly
float newPrice = RandomValueService.ApplyRandomPrice(valuableObject, config);
//Method 2: First determine whether it is randomized
if (RandomValueService.ShouldRandomize(obj, config))
{
float price = RandomValueService.GetRandomPrice(instanceID, originalPrice, config);
RandomValueService.SetItemPrice(vo, price);
}
Install & use Install: BepInEx plugin
- The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
- Recommended: use a community mod manager (such as r2modman) — pick this game, import the mod, and the manager sets up BepInEx and its dependencies for you.
- Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
- Launch the game — the BepInEx console logs every plugin it loads; seeing this mod in the log means it is installed.
Mods with listed dependencies need those installed too, or they will not load. Options are usually changed in-game or in the plugin's config file.