MountainFarmer-Medic icon

Medic

[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.

Last updated 3 days ago
Total downloads 13914
Total rating 2 
Categories Mods Misc Server-side
Dependency string MountainFarmer-Medic-1.1.3
Dependants 4 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

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.3
  • 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+): Sends a configurable chat line when you try to revive without enough HP, with a built-in cooldown to prevent spam.
  • 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.
  • Mixed lobby friendly: Players without the mod can still be revived. (They just won’t emit the chat line unless they’re running the mod.)
  • 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/configfallback list in config.
    • Hot reload: press Ctrl+P to reload the phrases file at runtime.

What’s new in 1.1.3

  • Added: Configurable failed revive chat messages with cooldown and rate-limited deny sound.

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.
  • 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.

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


Installation

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

Usage

  1. Pick up a fallen teammate’s PlayerDeathHead.
  2. Press H to spend HP and attempt a revive.
    • If you don’t have enough HP, you’ll hear an audio warning and nothing happens.
  3. On success, the revived player posts a global chat line (same pipeline as normal chat), visible to everyone if chat is enabled and the revivee is running the mod.

Configuration

A BepInEx/config/com.callmehill.medic.cfg file is created on first run.

  • General/HealthTransferAmount (float, default 20)
    How much HP the reviver gives to the revivee.
  • Chat/EnableGratitude (bool, default true)
    Toggle to enable/disable the revive gratitude chat line globally on your client.
  • Chat/PhrasesFile (string, default gratitude_phrases.txt)
    File to load phrases from (plugin directory → BepInEx/config).
  • Chat/FallbackPhrases (string, default Wow! Thank you, friend!|You saved me!|I owe you one!|Back in the fight!|That was clutch!) Pipe-separated fallback phrases used if the file is missing or empty.
  • Chat/EnableFailedReviveMessage (bool, default true) Toggle the chat line when a revive fails due to low health.
  • Chat/FailedReviveMessage (string, default I don't have enough health to revive you!|Need more health to revive!|Can't revive - low on health!|Not enough HP to help you up!|Too weak to revive you right now!) Pipe-separated messages randomly chosen on a failed revive.
  • Chat/ChatCooldownDuration (float, default 1) Seconds between failed revive chat messages.
  • Performance/DenyActionCooldown (float, default 0.5) Cooldown between deny actions when health is insufficient.
  • Sound/DeniedSoundNativeName (string, default soundDeny) Native AudioClip name used for the deny sound.
  • Phrase length guard (behavior): Phrases longer than 160 characters are trimmed during load to avoid chat overflow.

Compatibility

  • BepInEx 5 (5.4.x).
  • Works in mixed lobbies; only the chat line requires the revivee to be running the mod.
  • No extra keybinds or admin controls are introduced.

Troubleshooting

  • H does nothing: Make sure you are holding a PlayerDeathHead and have at least HealthTransferAmount + 1 HP. You should hear an audio warning if you lack sufficient health.
  • Client didn’t lose HP when reviving host: Update to v1.0.2 or later on all modded players to ensure the reviver’s HP cost is synced (SyncReviverHealth).
  • No chat line appears: The revive succeeded, but either EnableGratitude is off or the revivee isn’t running the mod (chat is emitted locally on the revivee).
  • Phrases not changing: Edit gratitude_phrases.txt and press Ctrl+P to reload.
  • Audio warning missing: Ensure Sound/DeniedSoundNativeName matches a loaded clip in the game.
  • Log spam on vanilla clients: Expected; harmless “RPC not found” messages when they don’t have the custom component.

Changelog

See CHANGELOG.md for full history.


Credits

  • Author: callmehill