I. Business logic
- When an entity (unit or structure) is destroyed - either by damage or by the user hitting DELETE button - the destruction causes damage ("death damage") to nearby entities.
- Death damage is configurable in the entity template.
- Death damage configuration can be affected by upgrades (ApplyValueModificationsToEntity).
Technical consideration
- Proposed structure in template (outside of Attack):
<?xml version="1.0" encoding="utf-8"?> <Entity parent="template_unit_mechanical_ship"> <Attack> <Melee> <Hack>10.0</Hack> ... </Melee> </Attack> <DeathDamage> <Shape>Circular</Shape> <Range>30</Range> <FriendlyFire>true</FriendlyFire> <Hack>300.0</Hack> <Pierce>300.0</Pierce> <Crush>300.0</Crush> </DeathDamage> <Cost> ...
- A new component DeathDamage is introduced to extract death damage logic from attack component.