-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Just a draft to describe current problems and ideas. Subject to change to better logic.
Currently there are three damage events:
MAKE_DAMAGE: triggers first after a damage, and contains damage info lists. Each item in the list is aReceiveDamageEventArguments, which will be described below. This event is triggered before dealing with character defeated, damage received, etc. Most important handler with this event is to revive the character, which must before character defeated. However, currently many objects use this handler, maybe many of them is unnecessary to use this, butAFTER_MAKE_DAMAGEis OK?RECEIVE_DAMAGE: for each damage, aReceiveDamageEventArgumentsis generated. During one damage action, it will be triggered multiple times, and one character may receive multiple this event, e.g. swirl and then triggers two superconduct, all characters will receive at least 2 such events. Many objects that have effects when receiving damage / element reaction, will create a handler on this event, e.g. Tenacity of the Millelith, Seed of Skandha, Gilded Dreams.AFTER_MAKE_DAMAGE, its structre is the same asMAKE_DAMAGE, but triggers afterRECEIVE_DAMAGE. Most important handler is the system handler to deal with character defeated. As system handlers are triggered as the last, all events will trigger before dealing with defeated.
Current problem is:
- For Tenacity of the Millelith, Heart of Khvarena's Brilliance, ..., they will be triggered before handing character defeated, but as this character is defeated, their effects should not be triggered. Currently we add condition check in their event handlers, but it is not a good practice.
RECEIVE_DAMAGEwill trigger multiple times when a character receive multiple-step damages within one action, e.g. Veteran's Visage will be triggered twice. This is not consistent with official results.
For P1, A better way may be disable triggering an object that is on a dying character (but should consider exceptions such as Seed of Skandha).
For P2, maybe we need to refactor current event structure. It seems that we only need MAKE_DAMAGE and AFTER_MAKE_DAMAGE, and MAKE_DAMAGE is only serving revive (and mark a character as defeated? maybe not needed). In AFTER_MAKE_DAMAGE, all other objects are listening this event, and objects on a defeated character (or character currently with 0 HP) will not be triggered (unless explicitly indicated), and the last handler for this event is system event, that will really do CharacterDefeatedAction for defeated characters.
We may check, is there contains two event timing, on receiving damage, and after making damage.