You are viewing a potentially older version of this package. View all versions.
Brynzananas-Revive_API-1.3.4 icon

Revive API

API for adding custom revives

Date uploaded a week ago
Version 1.3.4
Download link Brynzananas-Revive_API-1.3.4.zip
Downloads 8524
Dependency string Brynzananas-Revive_API-1.3.4

This mod requires the following mods to function

RiskofThunder-HookGenPatcher-1.2.9 icon
RiskofThunder-HookGenPatcher

MMHOOK generation at runtime.

Preferred version: 1.2.9

README

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.

CHANGELOG

1.3.4

  • Deleted tests class. Please fix

1.3.3

  • Rebuild to hopefully fix a niche issue

1.3.2

  • Fix for 1.4.1 patch

1.3.1

  • Remove unused internal fields.

1.3.0

  • Add a feature to pass information between CanRevive and OnRevive delegates

  • Fix one il hook always logging that it errored

1.2.2

  • Fix for DLC3

  • Remove leftover debug logspam

1.2.1

  • Fix CharacterMaster_IsDeadAndOutOfLivesServer always returning false

  • Rename old CanRevive method to CanReviveAndOrRevive

1.2.0

  • Add priority feature (thanks for @viliger2 for implementing it)

  • Add revive function for IsExtraLifePendingServer (thanks for @viliger2 for implementing it)

1.1.0

  • Add PendingOnRevive feature and its default value

1.0.0

  • Release