Revive API
API for adding custom revives
模組介紹 作者原文
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.
安裝與使用 安裝:BepInEx 外掛
- 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
- 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
- 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
- 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。
帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。
下面這些內容需要先安裝,否則該模組不會生效: