Class AbilityCollisionEventData
Event data for an ability hit, carrying the ability object and where the impact landed. The hit character is stored on the base TargetCharacter so all consumers can access it the same way.
public class AbilityCollisionEventData : CollisionEventData
- Inheritance
-
AbilityCollisionEventData
- Inherited Members
Constructors
AbilityCollisionEventData(ICharacter, ICharacter, AbilityObject, DeterministicRNG)
Initializes event data for a hit with no single impact point — a self-target dispatch or an area effect, where the whole overlap resolves at once.
public AbilityCollisionEventData(ICharacter initiator, ICharacter hitCharacter, AbilityObject abilityObject = null, DeterministicRNG rng = null)
Parameters
initiatorICharacterThe character who initiated the ability.
hitCharacterICharacterThe character that was hit by the ability (assigned to base TargetCharacter).
abilityObjectAbilityObjectThe ability object involved in the hit (optional).
rngDeterministicRNGOptional deterministic RNG (assigned to base RNG).
AbilityCollisionEventData(ICharacter, ICharacter, AbilityObject, Vector3, Vector3, DeterministicRNG, bool)
Initializes event data for a hit resolved at a known point — one entry of an AbilityObject's swept query.
public AbilityCollisionEventData(ICharacter initiator, ICharacter hitCharacter, AbilityObject abilityObject, Vector3 hitPoint, Vector3 hitNormal, DeterministicRNG rng = null, bool isAuthoritativeEcho = false)
Parameters
initiatorICharacterThe character who initiated the ability.
hitCharacterICharacterThe character that was hit by the ability (assigned to base TargetCharacter).
abilityObjectAbilityObjectThe ability object involved in the hit.
hitPointVector3World point of impact.
hitNormalVector3Surface normal at the impact.
rngDeterministicRNGOptional deterministic RNG (assigned to base RNG).
isAuthoritativeEchoboolTrue when the server resolved this hit and this peer is being told. See IsAuthoritativeEcho.
Properties
AbilityObject
The ability object involved in the collision (e.g., projectile, area effect).
public AbilityObject AbilityObject { get; }
Property Value
IsAuthoritativeEcho
True when this hit is the SERVER'S answer arriving on a peer that did not resolve it, rather than something this peer worked out for itself.
public bool IsAuthoritativeEcho { get; }
Property Value
Remarks
Set only by ApplyObservedHit(ICharacter, Vector3, Vector3), which is how
AbilityObjectHitBroadcast reaches the OnHit events. Every other producer — the
server's own sweep, the caster's predicted sweep, the area and hitscan queries — leaves
it false, because those peers decided the hit themselves.
What reads it, and why it has to exist. The caster's own client is sent the hit
broadcast as well as everybody else, so that an owner which mispredicted a MISS still
plays its impact. That correction runs the same OnHit events a predicted hit runs, and
ApplyDamageAction could not tell the two apart — so it drew a PREDICTED damage
label for a hit the server had already reported. The server's own
CombatEventBroadcast for that hit is unreliable while the hit broadcast is
reliable, and the two have no ordering relationship, so whenever the unreliable one won
the race PredictedCombatEvents.TryConfirm found nothing pending, the display drew
the server's number, and the prediction drawn moments later became a second label for
one hit.
A flag on the event rather than a check in the display: the display cannot distinguish them either — both arrive as an ordinary prediction — and the number that should not be drawn is better not produced than filtered afterwards.