Revive API
API for adding custom revives
About this mod Author’s original text
How to use
Use these methods:
AddCustomRevive(CanReviveNewDelegate canReviveNewDelegate)
AddCustomRevive(CanReviveNewDelegate canReviveNewDelegate, int priority)
AddCustomRevive(CanReviveNewDelegate canReviveNewDelegate, OnReviveNewDelegate onReviveDelegate)
AddCustomRevive(CanReviveNewDelegate canReviveNewDelegate, OnReviveNewDelegate onReviveDelegate, int priority)
AddCustomRevive(CanReviveNewDelegate canReviveNewDelegate, PendingOnRevive pendingOnRevives)
AddCustomRevive(CanReviveNewDelegate canReviveNewDelegate, PendingOnRevive pendingOnRevives, int priority)
AddCustomRevive(CanReviveNewDelegate canReviveNewDelegate, OnReviveNewDelegate onReviveDelegate, PendingOnRevive pendingOnRevives)
AddCustomRevive(CanReviveNewDelegate canReviveNewDelegate, OnReviveNewDelegate onReviveDelegate, PendingOnRevive pendingOnRevives, int priority)
In CanReviveNewDelegate canReviveNewDelegate parameter put boolean method/delegate with CharacterMaster and out CanReviveInfo parameters that will determine if CharacterMaster is able to respawn on death with your custom condition. A necessary value.
In OnReviveNewDelegate onReviveNewDelegate parameter put void method/delegate with CharacterMaster and CanReviveInfo parameters that will run after death and if CharacterMaster is able to respawn with your custom condition. For example Dio's Best friends takes an item on the begininng of respawn. Put a similar method in this value.
In PendingOnRevive pendingOnRevives parameter put an array of PendingOnRevive classes that will run them after reviving after a specified amount of time. This is for itemless custom revives, otherwise set this parameter to null and do pending stuff via adding CharacterMaster.ExtraLifeServerBehavior component to master object. By default there is a simple revive method and a simple sfx sound maker method in this array.
In int priority parameter put value to determine your revive priority among base and custom revives. Values above zero run before vanilla, values below and equal to zero run after vanilla.
PendingOnRevive has two fields, float timer and OnReviveDelegate onReviveDelegate. float timer will determine after how much time OnReviveDelegate onReviveDelegate will invoke.
CanReviveInfo has just one field, Inventory.ItemTransformation.CanTakeResult canTakeResult. You can check test revives in the Github repository for item based custom revive examples. You can pass any information from CanCheck to OnRevive via creating new class that inherits from CanReviveInfo.
Install & use Install: BepInEx plugin
- The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
- Recommended: use a community mod manager (such as r2modman) — pick this game, import the mod, and the manager sets up BepInEx and its dependencies for you.
- Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
- Launch the game — the BepInEx console logs every plugin it loads; seeing this mod in the log means it is installed.
Mods with listed dependencies need those installed too, or they will not load. Options are usually changed in-game or in the plugin's config file.
Install these first, or the mod will not work: