Add on_entity_damage_absorbed event and/or expand on_entity_damaged event
Posted: Fri Apr 26, 2019 4:52 pm
at present damage that is reduced by armor or absorbed by equipment (shields) is not accounted for in the on_entity_damaged event.
Looking to add an event on_entity_damage_absorbed that is triggered when a character or vehicle absorbs all damage by equipment (shields). So not duplicating the on_entity_damaged_event.
Expand the character and vehicle entities to capture the original damage, damage after armor reduction and damage after equipment reductions. This should then be included in the current on_entity_damaged event along with the result after entity resistances are removed.
This will also "fix" the fact the current origional_damage_amount property on the on_entity_damaged event isn't the real original damage done by the attacker.
This is to try and enable the possibilities, but without an additional frequently triggered event from viewtopic.php?f=221&t=63529
Looking to add an event on_entity_damage_absorbed that is triggered when a character or vehicle absorbs all damage by equipment (shields). So not duplicating the on_entity_damaged_event.
Code: Select all
//? Called when an entities equipmen absorbs all damage inflicted on it.
//? $param(entity, LuaEntity)
//? $param(damage_type, LuaDamagePrototype)
//? $param(original_damage_amount, float) Origional damage to be applied.
//? $param(armor_damage_reduced, float) Amount of damage reduced by any armor.
//? $param(equipment_damage_absorbed, float) Amount of damage absorbed by any equipment.
//? $param(final_damage_amount, float) Damage not absorbed passed on to entity.
//? $param(cause, LuaEntity, $optional) The entity that did the attacking if available.
//? $param(force, LuaForce, $optional) The force that did the attacking if any.
//? $note This is not called when an entities health is set directly by another mod.
This will also "fix" the fact the current origional_damage_amount property on the on_entity_damaged event isn't the real original damage done by the attacker.
This is to try and enable the possibilities, but without an additional frequently triggered event from viewtopic.php?f=221&t=63529