When A enters damage area of B, the area belongs to B and it can do something with the area_enter (basically, process the signal).
There, B will get a reference to A and can directly do A.damage(value) (after checking that can do that to A, looking for groups, types, etc.).
A will decide what to do with damage().
So what your saying is the one that will have the damage code, if A attacked B, will be B
Newby | 2017-10-26 10:42
You can make that the entity that does the damage, applies it, but is usually better to let each entity manages their own properties using a common interface (in this case, damage()).
The flow is:
Attacker attacks
->Area detects a body
->Area notifies the attacker (signaled)
->Attacker validates the body
->Attacker “tells” the body about the action (body.damage(value, etc))
->Body executes its damage() function logic.