Table of Contents

Class AbilityCollisionEventData

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

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

initiator ICharacter

The character who initiated the ability.

hitCharacter ICharacter

The character that was hit by the ability (assigned to base TargetCharacter).

abilityObject AbilityObject

The ability object involved in the hit (optional).

rng DeterministicRNG

Optional 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

initiator ICharacter

The character who initiated the ability.

hitCharacter ICharacter

The character that was hit by the ability (assigned to base TargetCharacter).

abilityObject AbilityObject

The ability object involved in the hit.

hitPoint Vector3

World point of impact.

hitNormal Vector3

Surface normal at the impact.

rng DeterministicRNG

Optional deterministic RNG (assigned to base RNG).

isAuthoritativeEcho bool

True 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

AbilityObject

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

bool

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.