

This API was originally created for my personal mod projects, but separating it as a standalone module made development easier, so I decided to publish it in case others find it useful.
If you need to reach me, I'm available in the R.E.P.O Modding Server on Discord: https://discord.gg/vPJtKhYAFe
REPOUpgradeAPI is a lightweight framework that provides a clean and safe way to synchronize player upgrades across host and clients. It handles RPC dispatching, synchronization logic, and UI refresh internally, so mods can focus only on calling simple API methods.
using REPOUpgradeAPI;
public class ExampleMod : BaseUnityPlugin
{
void Start()
{
// Increase Jump upgrade by +1
UpgradeAPI.Add(UpgradeType.Jump, 1);
// Set Sprint upgrade to level 3
UpgradeAPI.Set(UpgradeType.Sprint, 3);
}
}
Only UpgradeAPI.Add() and UpgradeAPI.Set() are needed.
All networking, syncing, and local UI updates are handled internally.
UpgradeAPI.Add(UpgradeType type, int delta);
UpgradeAPI.Add(string typeName, int delta);
UpgradeType … vanilla-like safe enum (Energy, Health, Jump, …)string typeName … Stat dictionary name or internal keyUpgradeAPI.Set(UpgradeType type, int level);
UpgradeAPI.Set(string typeName, int level);
Besides the enum, REPOUpgradeAPI also supports direct dictionary names from StatsManager:
// Directly touch the underlying StatsManager dictionary:
UpgradeAPI.Add("playerUpgradeHealth", 1);
UpgradeAPI.Add("playerUpgradeStaminaRegen", 1);
UpgradeAPI.Add("playerUpgradeUnstableCore", 1);
Internally, the API:
StatsManager.dictionaryOfDictionaries[typeName])"energy", "jump")playerUpgrade* dictionariesThis makes the API compatible with:
For debugging or exploring new keys, the API can dump upgrade dictionaries:
// Log all playerUpgrade* dictionaries in StatsManager
UpgradeAPI.LogAllUpgradeDictionaries();
// Enumerate dictionary names (e.g. "playerUpgradeHealth", "playerUpgradeUnstableCore", ...)
foreach (var key in UpgradeAPI.ListUpgradeKeys())
Logger.LogInfo($"Key: {key}");
These names can then be passed directly into UpgradeAPI.Add/Set.
UpgradeNet handles RPC and dispatchUpgradeManager applies local and networked changesUpgradeAPI日本語側も同じノリで「基本+拡張」を足した版。
このAPIはもともと私自身のMODプロジェクト向けに作ったものですが、 前提MODとして切り出して公開したほうが扱いやすく、 必要な方にも使いやすいと考え公開しています。
連絡が必要な場合は Discord の R.E.P.O. Modding Server へどうぞ: https://discord.gg/vPJtKhYAFe
REPOUpgradeAPI は、プレイヤーアップグレードを簡単かつ安全に同期できる軽量APIです。 ホスト・クライアント間の同期や RPC、Stats UI の更新などはすべて内部で自動処理されます。 MOD 側は「どのステータスをどれだけ増減させるか」だけ指定すれば OK です。
using REPOUpgradeAPI;
public class ExampleMod : BaseUnityPlugin
{
void Start()
{
// ジャンプレベルを +1
UpgradeAPI.Add(UpgradeType.Jump, 1);
// スプリントレベルを 3 に設定
UpgradeAPI.Set(UpgradeType.Sprint, 3);
}
}
MOD 開発者側で必要なのは
UpgradeAPI.Add / UpgradeAPI.Set の 2 つだけ です。
内部で RPC や同期処理はすべて完了します。
UpgradeAPI.Add(UpgradeType type, int delta);
UpgradeAPI.Add(string typeName, int delta);
UpgradeType … バニラ準拠の安全な enum(Energy, Health, Jump など)string typeName … StatsManager の辞書名 or 内部キー文字列UpgradeAPI.Set(UpgradeType type, int level);
UpgradeAPI.Set(string typeName, int level);
enum だけでなく、StatsManager.dictionaryOfDictionaries の辞書名をそのまま指定して操作できます。
// StatsManager 内部の辞書を直接いじる例
UpgradeAPI.Add("playerUpgradeHealth", 1);
UpgradeAPI.Add("playerUpgradeStaminaRegen", 1);
UpgradeAPI.Add("playerUpgradeUnstableCore", 1);
内部では、以下の優先順で解釈されます:
StatsManager.dictionaryOfDictionaries[typeName])playerUpgrade* 系辞書を動的に探索これにより:
を、同じ API から扱える ようになっています。
新しく追加されたキーや辞書名を確認したい場合は、ログに一覧を出すこともできます。
// StatsManager 内の playerUpgrade* 辞書を全部ログ出力
UpgradeAPI.LogAllUpgradeDictionaries();
// 辞書名の列挙(例: "playerUpgradeHealth", "playerUpgradeUnstableCore", ...)
foreach (var key in UpgradeAPI.ListUpgradeKeys())
Logger.LogInfo($"Key: {key}");
ここで出力された 辞書名そのものを UpgradeAPI.Add/Set に渡せば、そのまま操作できます。
UpgradeNet が RPC を受信・配信UpgradeManager がローカル処理と同期ロジックを実行PunManager に自動でコンポーネントを付与&RPC登録UpgradeAPI のみを参照すればよい設計