Medic

版本 v1.1.4·更新於 2025-09-24

[Inspired by: UltimateRevive by Quilt] Pick up your teammate’s PlayerDeathHead and press H—spend 20 HP to revive them. Players will automatically show gratitude upon revive with a configurable message

模組介紹 作者原文

Medic!

Revive fallen teammates by transferring your own health while holding their PlayerDeathHead.

Press H to spend HP and bring them back. On success (and if enabled), the revived player automatically posts a global chat line using the game’s built‑in chat pipeline so everyone sees it.

  • Author: callmehill
  • Version: 1.1.4
  • BepInEx: 5.x (tested with 5.4.21)

Features

  • Pick‑up revive: Hold a teammate’s PlayerDeathHead and press H to revive.
  • HP transfer: Default cost is 20 HP from the reviver to the revivee.
  • Audio feedback (1.1.1+): Plays a configurable sound when you don’t have enough health to attempt a revive.
  • Failed revive chat (1.1.3+): Posts a clear, configurable chat line (including the downed player’s name) when you try to revive without enough HP.

Anti‑spam: a per‑player shared cooldown gates both the chat and the denial sound (default 12s, configurable).

  • True in‑game chat (toggleable): The revivee sends a chat line via the native chat method—identical to a normal message—only on a successful revive and only if enabled.
  • Randomized gratitude (1.1.0+): On a successful revive, the revivee picks a random phrase from a phrases list loaded at startup.
  • Phrases are read from gratitude_phrases.txt (one per line). Lines starting with # are comments.
  • Search order: plugin folder (next to the DLL) → BepInEx/config → fallback list in config.
  • Hot reload: press Ctrl+P to reload the phrases file at runtime.
  • Event-driven avatar cache (1.1.4+): Player avatars register on spawn/despawn so revive logic hits cached references and

only falls back to a scene scan when needed.

  • Mixed‑lobby friendly: Players without the mod can still be revived. (They just won’t emit the gratitude chat line unless they’re running the mod.)

What’s new in 1.1.4

  • Changed: Hooked into player avatar spawn/despawn so revive lookups reuse cached references instead of repeatedly scanning

the scene during gameplay.

  • Fixed: Scene-wide fallback scans only run when the cache is empty or invalid, reducing GC pressure during revives.

Previously in 1.1.3

  • Added: Configurable failed‑revive chat messages with per‑player shared cooldowns for chat and denial sound (default 12s). Messages include the downed player’s name.
  • Improved: Input handler now avoids frame drops when repeatedly pressing H on low HP.
  • Changed: Centralized denial audio into a single AudioSource and added caching for avatar/health lookups.
  • Config: New keys for cooldowns and message templates (see below).

How it works (tech notes)

  • Pressing H while holding a PlayerDeathHead asks the MasterClient to perform an authoritative revive.
  • If you lack sufficient health, an audible warning plays and the revive is denied (with optional chat notification).
  • The revive triggers the game’s native ReviveRPC for the downed player across all clients.
  • After one frame, only the revivee’s client calls the game’s private PlayerAvatar.ChatMessageSend(...) method locally (and only if EnableGratitude is true), so the chat line is broadcast to everyone just like normal chat.
  • Health sync:
  • Master subtracts HP from the reviver and broadcasts it via SyncReviverHealth (v1.0.2+).
  • The revivee’s new HP is applied and broadcast via SyncRevivedHealth.
  • Gratitude phrases: MedicPlugin.GetRandomGratitude() returns a random entry from the loaded list (or the fallback list) and feeds it into the native chat send.
  • Audio origin (1.1.2+): The deny sound plays from the reviver’s position (not a global/menu source).

Note: Unmodded clients may log “RPC not found” for the custom health/chat RPCs. This is harmless and does not affect gameplay.

Installation

  • Install BepInEx 5 for your game.
  • Drop Medic!.dll into BepInEx/plugins/Medic!/ (create the folder if needed).
  • (Optional) Place icon.png, manifest.json, README.md, and gratitude_phrases.txt in the same plugin folder for mod managers.

Usage

  • Pick up a fallen teammate’s PlayerDeathHead.
  • Press H to spend HP and attempt a revive.
  • If you don’t

安裝與使用 安裝:BepInEx 外掛

  1. 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
  2. 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
  3. 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
  4. 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。

帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。

前置依賴

下面這些內容需要先安裝,否則該模組不會生效:

BepInEx-BepInExPack

檔案與校驗

檔案名稱
Medic-1.1.4.zip
檔案大小
128.8 KiB