Skip to main content

Value Application

The final part of the combat event sequence, before the logging, is the application of the final spell value to the absorb shields and health of the target.

apply_damage
This function applies damage to the health of the target, and returns the difference between the final spell value and the target's current health before the damage is dealt as overkill. It uses the value to be applied and the target as arguments.

apply_absorb
This function applies damage to the currently active absorb shield on the target, in order of the duration-sorted array of absorbs. It takes the value to be applied, the target, the spell name, the source name and the target name as arguments. The function attempts to deplete all absorb shields in order, until either the remaining damage value reaches zero, or all absorb shields are depleted. For every absorb shield that has damage applied to it, a combat event is logged to display which shield from which source is absorbing how much damage. If a shield is depleted, it is scheduled for removal after the iteration during which the damage is applied. The depleted absorb shields are then removed directly afterwards, as doing so during the iteration leads to unpredictable results. Finally, the remaining damage value is returned. If the remaining value is 0, the combat_event_damage function is exited. Otherwise, it continues with the application of the remaining damage to the target's health.

apply_heal
This function applies healing to the health of the target, and returns the overheal value. It uses the value to be applied and the target as arguments. A min() function is used, as healing cannot heal a target beyond maximum health.