Add on_pre_entity_damaged event
Posted: Sun Nov 18, 2018 5:17 pm
this event could include the same attributes as the on_entity_damaged, minus the final damage:
- entity :: LuaEntity
- damage_type :: LuaDamagePrototype
- damage_amount :: float
- cause :: LuaEntity (optional): The entity that did the attacking if available.
- force :: LuaForce (optional): The force that did the attacking if any.
Would allow mods to get any entity details prior to the damage being done. But not interfere in the game's calculation of damage as I know other events don't offer interference in core game mechanics.
For example in a Nuke Immunity mod, it would get a player's shield level and health before they suffer 10,000 damage from a nuke. Then the mod could return their health and shield to the exact previous level.
- entity :: LuaEntity
- damage_type :: LuaDamagePrototype
- damage_amount :: float
- cause :: LuaEntity (optional): The entity that did the attacking if available.
- force :: LuaForce (optional): The force that did the attacking if any.
Would allow mods to get any entity details prior to the damage being done. But not interfere in the game's calculation of damage as I know other events don't offer interference in core game mechanics.
For example in a Nuke Immunity mod, it would get a player's shield level and health before they suffer 10,000 damage from a nuke. Then the mod could return their health and shield to the exact previous level.