REPO_JP-RechargeHealthPacks icon

RechargeHealthPacks

【Host Only MOD】Restores used health packs at charging stations by consuming charge.使用済みヘルスパックを充電所で充電を消費して再利用可能にします。

By REPO_JP
Last updated a month ago
Total downloads 8064
Total rating 5 
Categories Mods Items Server-side AI Generated
Dependency string REPO_JP-RechargeHealthPacks-4.0.0
Dependants 1 other package depends 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

COSMETICS UPDATE V0.4.0 COMPATIBLE.

RechargeHealthPacks

This mod is a host-only mod that lets used health packs be restored at charging stations by consuming station charge.

Only the host needs to install this mod. Clients can join without installing it, because the host handles the charging station check, restored health pack spawn, used health pack cleanup, and charge synchronization.

Features

  • Restores used health packs placed inside a charging station area.
  • Consumes charging station charge based on health pack size.
  • Supports separate charge costs for small, medium, and large health packs.
  • Spawns a fresh health pack using the original item prefab.
  • Can delete the used health pack after restoration.
  • Can protect used health packs from being destroyed while they are inside the truck or cart area.
  • Does not run in shop levels or while the run is restarting.

How it works

Place a used health pack inside the charging station area. If the host has enough charging station charge, the mod consumes the configured amount of charge and spawns a fresh health pack at the same position.

The size is determined from the health pack heal amount. A heal amount of 25 or less uses the small health pack cost. A heal amount of 50 or less uses the medium health pack cost. A heal amount of 100 or less uses the large health pack cost.

Technical details

The mod patches ChargingStation.Update and periodically scans the station charge area for ItemHealthPack objects. It checks the internal used state of ItemHealthPack, calculates the required charge cost, spawns a restored health pack from ItemAttributes.item.prefab, then updates the charging station charge state.

In multiplayer, the restored item is spawned through PhotonNetwork.InstantiateRoomObject. The charging station segment state is synchronized through the vanilla ChargingStationSegmentChangedRPC flow.

The mod also patches PhysGrabObjectImpactDetector break and destroy flows to prevent used health packs from being destroyed while they are inside the truck or cart area, when that protection setting is enabled.

Configuration

General

Setting Description Default Minimum Maximum
ModEnabled Enables this mod. true false true
CheckInterval Interval in seconds for checking used health packs in the charging station area. 0.5 0.1 5
DestroyUsedPackAfterRecharge Destroys the used health pack after spawning a restored one. true false true
ProtectUsedPackInTruck Protects used health packs from being destroyed while they are inside the truck or cart area. true false true

Charge Cost

Setting Description Default Minimum Maximum
SmallHealthPackChargeCost Charge consumed to restore a used small health pack. 2 0 100
MediumHealthPackChargeCost Charge consumed to restore a used medium health pack. 5 0 100
LargeHealthPackChargeCost Charge consumed to restore a used large health pack. 8 0 100

Debug

Setting Description Default Minimum Maximum
DebugLog Enables detailed debug logs. false false true

Notes

  • This mod targets normal level gameplay and does not process recharge logic in shop levels.
  • This mod restores ItemHealthPack only. It does not change ItemReviveItem or other revive items.
  • If DestroyUsedPackAfterRecharge is disabled, the original used pack is not deleted, but the same original pack is not processed repeatedly during the same session.

※Mod created by AI

COSMETICS UPDATE V0.4.0対応済み.

RechargeHealthPacks

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

このMODは、ホスト専用の、使用済みヘルスパックを充電所で充電を消費して再利用可能にするMODです。

導入が必要なのはホストのみです。 充電所の判定、再利用可能なヘルスパックの生成、使用済みヘルスパックの削除、充電量の同期はホスト側で処理されるため、参加者側の導入は不要です。

機能

  • 充電所エリア内に置かれた使用済みヘルスパックを再利用可能化
  • ヘルスパックのサイズに応じて充電所の充電量を消費
  • 小、中、大ヘルスパックごとに消費充電量を個別設定可能
  • 元アイテムのPrefabを使用して新品ヘルスパックを生成
  • 再利用後に使用済みヘルスパックを削除可能
  • 使用済みヘルスパックがトラック内またはカート内にある間の破壊を抑止可能
  • ショップ階層中やラン再開始中は処理しない設計

動作仕様

使用済みヘルスパックを充電所エリア内に置きます。 ホスト側で充電所の充電量が足りている場合、設定された充電量を消費し、同じ位置に新品ヘルスパックを生成します。

サイズ判定はヘルスパックの回復量を基準にします。 回復量25以下は小ヘルスパックの消費量を使用します。 回復量50以下は中ヘルスパックの消費量を使用します。 回復量100以下は大ヘルスパックの消費量を使用します。

技術仕様

このMODは ChargingStation.Update にPatchし、一定間隔で充電所エリア内の ItemHealthPack を検索します。 ItemHealthPack の内部使用済み状態を確認し、必要な充電量を計算してから、ItemAttributes.item.prefab を基準に再利用可能なヘルスパックを生成し、充電所の充電状態を更新します。

マルチプレイでは、再生成アイテムは PhotonNetwork.InstantiateRoomObject で生成します。 充電所のセグメント状態は、バニラの ChargingStationSegmentChangedRPC の流れで同期します。

また、PhysGrabObjectImpactDetector の破壊・削除処理にもPatchし、保護設定が有効な場合は、使用済みヘルスパックがトラック内またはカート内にある間の破壊を抑止します。

設定項目

General

設定値名 設定内容説明 初期値 設定可能最小値 設定可能最大値
ModEnabled MODを有効化します。 true false true
CheckInterval 充電所エリア内の使用済みヘルスパックを確認する間隔秒。 0.5 0.1 5
DestroyUsedPackAfterRecharge 新品を生成した後に使用済みヘルスパックを削除します。 true false true
ProtectUsedPackInTruck 使用済みヘルスパックがトラック内またはカート内にある間は破壊を抑止します。 true false true

Charge Cost

設定値名 設定内容説明 初期値 設定可能最小値 設定可能最大値
SmallHealthPackChargeCost 使用済み小ヘルスパックの再生成に消費する充電量。 2 0 100
MediumHealthPackChargeCost 使用済み中ヘルスパックの再生成に消費する充電量。 5 0 100
LargeHealthPackChargeCost 使用済み大ヘルスパックの再生成に消費する充電量。 8 0 100

Debug

設定値名 設定内容説明 初期値 設定可能最小値 設定可能最大値
DebugLog 詳細なデバッグログを有効化します。 false false true

注意事項

  • 通常レベル中の使用を想定しており、ショップ階層では充電処理を行いません。
  • 対象は ItemHealthPack のみです。 ItemReviveItem などの蘇生アイテムは変更しません。
  • DestroyUsedPackAfterRecharge を無効にした場合、元の使用済みヘルスパックは削除されませんが、同じ使用済みヘルスパックが同一セッション中に何度も処理されないようにしています。

※AI生成MOD