EnergyCrystalAutoRefill
【Host Only MOD】Automatically refills depleted energy crystals by spending savings when a player tries to charge an item.エナジークリスタル切れの状態で充電しようとすると貯金を消費して自動補充しますEnergyCrystalAutoRefill
COMPATIBLE WITH COSMETICS UPDATE V0.4.0.
This mod is a host-only mod that automatically refills depleted Charging Station energy crystals by spending savings when a player tries to charge an item.
https://youtube.com/shorts/fbXCNESAH6g
Features
- Works with host installation only.
- Triggers only when the Charging Station is depleted and a chargeable item is placed in the charge area.
- Spends run savings and refills the Charging Station automatically.
- Refills the configured number of energy crystals accurately.
- Limits forced public chat to the nearest players around the charged item, up to 3 players.
- Keeps the original refill flow:
- Announces refill cost in k$.
- Checks savings before starting the countdown.
- Waits 5 seconds.
- Counts down 5, 4, 3, 2, 1.
- Rechecks that the station is still depleted and the item is still trying to charge.
- Spends savings.
- Refills the Charging Station.
- Announces current savings after refill.
- Keeps cooldown after refill.
- Sends a cooldown notice only once when someone tries to charge during cooldown while the station is depleted.
Configuration
The config file is created under BepInEx/config.
| Setting | Description | Default | Minimum | Maximum |
|---|---|---|---|---|
| EnableMod | Enables or disables this mod. | true | false | true |
| CostPerRefill | Cost per refill in k$. | 10 | 0 | 100 |
| PowerCrystalsToAdd | Number of energy crystals to add per refill. | 1 | 1 | 10 |
| CooldownSeconds | Cooldown seconds after a refill. | 10 | 1 | 300 |
Behavior Notes
- The mod does nothing when the Charging Station is not depleted.
- If savings are insufficient, it announces the shortage and requires the item to be removed and inserted again after savings increase.
- If the item is removed or the depleted condition is resolved during the wait or countdown, the sequence cancels silently.
- Forced public chat is intentionally limited to nearby players to avoid excessive chat spam in large groups.
- The chat limit only affects forced chat output. It does not change the refill result.
For Developers
- The refill process is executed only by the host or in singleplayer.
- The refill amount is calculated as accurate energy crystal units for R.E.P.O. v0.4.0 Charging Station behavior.
- The charged item position is used as the distance origin for selecting forced chat speakers.
- The nearest valid players inside the truck are selected, up to 3 players.
- The refill sequence keeps a lock to avoid duplicate refill execution and duplicate forced chat during the same process.
※Mod created by AI
EnergyCrystalAutoRefill
COSMETICS UPDATE V0.4.0対応済み.
REPOが好きな日本人のための日本人のみのREPOのDiscordサーバーあります! 参加は以下のリンクから! https://discord.gg/h5ATY4m5bZ
このMODは、ホスト専用の、プレイヤーが充電しようとした時にエナジークリスタル切れの充電所へ貯金を消費して自動補充するMODです。
https://youtube.com/shorts/fbXCNESAH6g
機能
- ホストのみの導入で動作します。
- 充電所が枯渇していて、充電可能なアイテムが充電エリア内にある場合のみ動作します。
- ラン中の貯金を消費して充電所を自動補充します。
- 設定したエナジークリスタル数ぶんを正確に補充します。
- 強制公開チャットの対象を、充電対象アイテムに近い最大3人までに制限します。
- 既存の補充フローを維持します。
- 補充コスト(k$)を告知
- カウントダウン開始前に残高確認
- 5秒待機
- 5, 4, 3, 2, 1 のカウントダウン
- まだ枯渇していて、まだ充電しようとしているか再確認
- 貯金を消費
- 充電所を補充
- 補充後の残高を告知
- 補充後クールダウンを維持します。
- クールダウン中に枯渇状態で充電しようとした場合、クールダウン通知を1回だけ送信します。
設定項目
Configファイルは BepInEx/config 配下に作成されます。
| 設定値名 | 設定内容説明 | 初期値 | 設定可能最小値 | 設定可能最大値 |
|---|---|---|---|---|
| EnableMod | MODの有効無効 | true | false | true |
| CostPerRefill | 1回の補充コスト(k$) | 10 | 0 | 100 |
| PowerCrystalsToAdd | 1回で補充するエナジークリスタル数 | 1 | 1 | 10 |
| CooldownSeconds | 補充後のクールダウン秒数 | 10 | 1 | 300 |
挙動メモ
- 充電所が枯渇していない場合は動作しません。
- 残高不足の場合は不足を告知し、残高増加後に一度アイテムを抜いて再投入するまで処理を開始しません。
- 待機中またはカウントダウン中にアイテムが抜かれたり、枯渇条件が解消された場合は無言でキャンセルします。
- 大人数プレイ時のチャット連打を避けるため、強制公開チャットの対象は近くのプレイヤーに限定しています。
- チャット対象制限は発言者の制限のみです。補充結果には影響しません。
開発者向け
- 補充処理はホストまたはシングルプレイ時のみ実行されます。
- 補充量は R.E.P.O. v0.4.0 の充電所挙動に合わせ、正確なエナジークリスタル単位で計算されます。
- 強制チャット対象の距離基準には充電対象アイテムの位置を使用します。
- トラック内にいる有効なプレイヤーから近い順に最大3人を選択します。
- 同一補充処理中の重複補充や重複発言を避けるため、補充シーケンスにロックを入れています。
※AI生成MOD
