Class PulledByAbility

java.lang.Object
com.hypixel.hytale.builtin.abilities.trigger.PulledByAbility
All Implemented Interfaces:
Component<EntityStore>, Cloneable

public class PulledByAbility extends Object implements Component<EntityStore>
Marks an entity being reeled toward a caster (e.g. by a chain ability). Consumed by AbilityPullSystem: after an optional hooked delay, the victim is dragged for a FIXED reel time — the required speed is recomputed every tick from the remaining distance and time, so a far victim arrives as fast as a near one and per-role knockback scaling or AI fighting the cable cannot stretch the trip.
  • Constructor Details

    • PulledByAbility

      public PulledByAbility(@Nonnull Ref<EntityStore> casterRef, float reelTimeS, float arc, float stopRange, float delayS)
  • Method Details

    • getComponentType

      public static ComponentType<EntityStore, PulledByAbility> getComponentType()
    • getCasterRef

      @Nonnull public Ref<EntityStore> getCasterRef()
    • getStopRange

      public float getStopRange()
    • getArcOffset

      public double getArcOffset(double horizontalDistance)
      Resolves the upward bow of the aim point this tick. The easing runs on HORIZONTAL progress — height gained must not keep the bow alive, or lifting feeds back into more lifting — and the offset is capped by the horizontal distance left, so the approach can never turn mostly vertical.
    • advance

      public boolean advance(float dt)
      Counts the reel down toward its overall timeout.
      Returns:
      true while the pull may keep running.
    • advanceDelay

      public boolean advanceDelay(float dt)
      Counts the hooked delay down.
      Returns:
      true while the reel has not started yet.
    • tickReelSpeed

      public float tickReelSpeed(double distance, float dt)
      Advances the reel clock and returns the speed this tick needs: the remaining distance over the remaining reel time. Losses (role knockback scaling, AI walking against the cable, friction) leave more distance for less time, so the next tick demands proportionally more — arrival stays on schedule up to the speed cap.
    • clone

      @Nullable public Component<EntityStore> clone()
      Specified by:
      clone in interface Component<EntityStore>
      Returns:
      a clone instance of the original component instance.