Add on_entity_damage_absorbed event and/or expand on_entity_damaged event

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
User avatar
Muppet9010
Filter Inserter
Filter Inserter
Posts: 278
Joined: Sat Dec 09, 2017 6:01 pm
Contact:

Add on_entity_damage_absorbed event and/or expand on_entity_damaged event

Post by Muppet9010 »

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.

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.
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

User avatar
Muppet9010
Filter Inserter
Filter Inserter
Posts: 278
Joined: Sat Dec 09, 2017 6:01 pm
Contact:

Re: Add on_entity_damage_absorbed event and/or expand on_entity_damaged event

Post by Muppet9010 »

largely done in the fixes for: viewtopic.php?f=30&t=71218

the separation of damage absorbed by armour resistances vs damage then absorbed by shields isn't included in the event.

Post Reply

Return to “Modding interface requests”