REPO_JP-CosmeticTokenPriorityUse icon

CosmeticTokenPriorityUse

【Client MOD】Prioritizes cosmetic token usage by rarity.コスメトークンの使用順をレアリティ優先に変更します

By REPO_JP
Last updated 11 hours ago
Total downloads 494
Total rating 0 
Categories Mods Client-side Cosmetics AI Generated
Dependency string REPO_JP-CosmeticTokenPriorityUse-4.0.0
Dependants 0 other packages depend on this package

This mod requires the following mods to function

BepInEx-BepInExPack-5.4.2100 icon
BepInEx-BepInExPack

BepInEx pack for Mono Unity games. Preconfigured and ready to use.

Preferred version: 5.4.2100

README

COMPATIBLE WITH R.E.P.O. V0.4.3.

Cosmetic Token Priority Use

This mod is a client-only mod that changes cosmetic gacha token consumption to prioritize higher rarity tokens when that rarity still has locked cosmetics.

Overview

Vanilla R.E.P.O. uses the newest cosmetic token first because the gacha machine reads and removes the last token in the saved token list.

This mod changes the token used right before the gacha machine starts. It searches your owned tokens and moves the best eligible token to the end of the list so the vanilla gacha logic can consume it normally.

The default priority order is:

  1. UltraRare
  2. Rare
  3. Uncommon
  4. Common

If all cosmetics in a rarity are already unlocked, that rarity is skipped. For example, if you own an UltraRare token but all UltraRare cosmetics are already unlocked, the mod will try Rare next.

Behavior

  • Only affects the player who installed the mod.
  • Does not change gacha animation, reward unlock logic, save logic, RPC logic, or vanilla token removal logic.
  • Does not permanently sort all tokens.
  • Only moves one selected token to the end of the list when the gacha machine is used.
  • Keeps the remaining token order as close to vanilla as possible.

When all cosmetics are unlocked

When all valid cosmetics are already unlocked, the mod cannot select a token based on locked cosmetics. In that case, the fallback order is controlled by config.

  • Descending: UltraRare, Rare, Uncommon, Common
  • Ascending: Common, Uncommon, Rare, UltraRare

Multiplayer

This is a client-only mod.

Each player has their own local cosmetic tokens and cosmetic unlock data. Because of that, the host cannot control another player's token consumption order with a host-only mod.

If every player wants this behavior, every player needs to install the mod.

Configuration

General.Enabled

Enables this mod.

  • Default: true
  • Minimum: false
  • Maximum: true

General.AllCosmeticsUnlockedOrder

Token order used when all cosmetics are already unlocked.

  • Default: Descending
  • Minimum: Ascending
  • Maximum: Descending
  • Valid values: Descending, Ascending

General.RefreshTokenUIAfterReorder

Updates the token UI after internally moving the selected token.

  • Default: true
  • Minimum: false
  • Maximum: true

Debug.DebugLogSelectedToken

Outputs the selected token rarity and selection reason to the BepInEx log.

  • Default: false
  • Minimum: false
  • Maximum: true

Notes for developers

The mod patches CosmeticShopMachine.Interact() with a Harmony Prefix.

It does not skip the original method. Instead, it prepares MetaManager.cosmeticTokens before vanilla code reads cosmeticTokens[cosmeticTokens.Count - 1].

The selected token is moved to the end of the list so vanilla CosmeticTokenRemove() still removes the correct token. This avoids rewriting the reward, unlock, save, and RPC flow.

※Mod created by AI

R.E.P.O. V0.4.3対応済み.

Cosmetic Token Priority Use

REPOが好きな日本人のための日本人のみのREPOのDiscordサーバーあります! 参加は以下のリンクから! https://discord.gg/h5ATY4m5bZ

このMODは、クライアント専用の、コスメガチャで使用するトークンをレアリティ優先に変更するMODです。

概要

バニラのR.E.P.O.では、コスメガチャ使用時に一番新しく取得したコスメトークンが使用されます。 これは、ガチャ処理が保存済みトークンリストの最後のトークンを参照し、そのまま最後のトークンを削除するためです。

このMODでは、ガチャ開始直前に使用すべきトークンを選択し、そのトークンだけをリスト末尾へ移動します。 そのため、ガチャ本体の処理はバニラのまま安全に動作します。

初期状態の優先順位は以下です。

  1. ウルトラレア
  2. レア
  3. アンコモン
  4. コモン

対象レアリティのコスメをすべて所持している場合、そのレアリティはスキップされます。 例えば、ウルトラレアトークンを持っていてもウルトラレアコスメをすべて所持している場合、次にレアトークンの使用を試みます。

動作内容

  • 導入した本人のガチャだけに反映
  • ガチャ演出、報酬解放、セーブ、RPC、バニラのトークン削除処理は変更しない
  • 所持トークン全体を常時ソートしない
  • ガチャ使用時だけ、選択された1枚のトークンを末尾へ移動
  • 残りのトークン順は可能な限りバニラのまま維持

全コスメ所持済み時

すべての有効なコスメを所持済みの場合、未所持コスメを基準にした選択ができません。 その場合はConfigで指定した順番でトークンを使用します。

  • Descending: ウルトラレア、レア、アンコモン、コモン
  • Ascending: コモン、アンコモン、レア、ウルトラレア

マルチプレイ

このMODはクライアント専用MODです。

コスメトークンとコスメ解放状況は各プレイヤーのローカルデータとして管理されています。 そのため、ホスト専用MODとして参加者のトークン使用順を制御することはできません。

全員に同じ挙動を適用したい場合は、各プレイヤーが導入してください。

設定項目

General.Enabled

このMODを有効化します。

  • 初期値: true
  • 設定可能最小値: false
  • 設定可能最大値: true

General.AllCosmeticsUnlockedOrder

全コスメ所持済み時のトークン使用順です。

  • 初期値: Descending
  • 設定可能最小値: Ascending
  • 設定可能最大値: Descending
  • 設定可能値: Descending, Ascending

General.RefreshTokenUIAfterReorder

選択トークンを内部移動した後にトークンUIを更新します。

  • 初期値: true
  • 設定可能最小値: false
  • 設定可能最大値: true

Debug.DebugLogSelectedToken

選択されたトークンのレアリティと選択理由をBepInExログに出力します。

  • 初期値: false
  • 設定可能最小値: false
  • 設定可能最大値: true

開発者向け詳細

このMODは CosmeticShopMachine.Interact() にHarmony Prefixを当てます。

Prefixでは元処理を止めません。 バニラ処理が cosmeticTokens[cosmeticTokens.Count - 1] を読む直前に、使用対象トークンを MetaManager.cosmeticTokens の末尾へ移動します。

その結果、バニラの CosmeticTokenRemove() がそのまま正しいトークンを削除します。 これにより、報酬解放、保存、RPCなどの処理を書き換えずに済みます。

※AI生成MOD