Table of Contents

Class CasterRushAction

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

Rushes the caster forward: a charge. How far and how fast follow the charge stage the cast was released at (ChargeStages).

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

Remarks

Wire it to the ability's OnSpawn. The rush itself is the caster's movement (BeginMotion(Vector3, float, float, float)): predicted on the owner, authoritative on the server, reconciled as motor state. The way it goes is the caster's movement heading for this tick (the replicated aim turned onto the body), which both peers hold.

Re-applied on a replayed tick (ReappliesOnReplay). A correction for a tick before the cast takes the rush back with the rest of the motor state, and the replay of the cast's tick must start it again or the owner stands still for a round trip and then jumps. This is the case BaseAction's warning about teleports does not cover: the effect lives in state the correction restores.

Players only: an NPC is moved by its NavMesh agent, not a motor, so an NPC casting this strikes from where it stands. Refused while rooted or incapacitated.

Fields

StageDistances

Metres rushed at each charge stage, from stage 1.

[Tooltip("Metres rushed at each charge stage, from stage 1.")]
public float[] StageDistances

Field Value

float[]

StageSeconds

Seconds each stage's rush takes, from stage 1 (distance รท seconds is its speed).

[Tooltip("Seconds each stage's rush takes, from stage 1. Distance / seconds is its speed.")]
public float[] StageSeconds

Field Value

float[]

Properties

ReappliesOnReplay

True when this action must run again on a REPLAYED tick for an effect on the caster itself to survive a correction: what it changes is state the correction has just set back (a resource, a buff), and running it again from that state gives what the prediction had.

public override bool ReappliesOnReplay { get; }

Property Value

bool

Remarks

Asked only for an event marked TickEventData.ReapplyOnly (a self-cast ability's effects, re-dispatched on replay by AbilityObject.RunSelfTargetEffects). False by default, and that is the safe answer: an action whose effect a correction does NOT take back (it grants an item, summons, teleports, plays something) would do it a second time.

Methods

Execute(ICharacter, EventData)

Executes the action. Must be implemented by derived classes.

public override void Execute(ICharacter initiator, EventData eventData)

Parameters

initiator ICharacter

The character initiating the action.

eventData EventData

Event data for the action.