Table of Contents

Class AbilityHitCountAction

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

Adds to (or subtracts from) an ability object's remaining hit count.

[Serializable]
public sealed class AbilityHitCountAction : BaseAction, IAction
Inheritance
AbilityHitCountAction
Implements
Inherited Members

Remarks

The one action that moves AbilityObject.HitCount, and it covers both directions. A positive amount is a PIERCE — the object survives that many more impacts instead of ending on this one, which is how a projectile is made to pass through its targets. A negative amount consumes hits early, ending the object sooner than its authored count would.

There used to be two of these. AbilityPierceHitAction was a second serialized action type with a byte-identical body under a different field name, so the subclass menu offered a designer two entries that did the same thing and a fix to one silently missed the other. It was deleted rather than kept as an alias: this one already expresses pierce, and the specialised name only described the positive half of what it did.

Runs on every peer, deliberately — the caster's predicted copy of the object and the server's must reach the same hit count or they end at different moments. An observer runs it too, from the server's own hit report, but no longer acts on the result: its copy's end-of-life belongs to AbilityObjectDestroyedBroadcast, so it spends no hit count of its own. See AbilityObject.ResolveSweptHits.

Fields

AmountValue

The value provider that determines the amount to add to the AbilityObject's HitCount. Positive pierces (the object survives that many more impacts); negative consumes hits early.

[Tooltip("Amount to add to the AbilityObject's HitCount. Positive pierces, negative consumes hits early.")]
[SerializeReference]
public IIntValueProvider AmountValue

Field Value

IIntValueProvider

Remarks

Wired to OnHit, an amount of 1 exactly cancels the decrement the impact itself applies, so the object never ends on a hit at all — bound it with a lifetime, or with a provider that runs out.

Methods

Execute(ICharacter, EventData)

Executes the hit count action, applying the hit count logic to the ability.

public override void Execute(ICharacter initiator, EventData eventData)

Parameters

initiator ICharacter

The character initiating the action.

eventData EventData

The event data containing ability information.