Chain Hook
Pulls the player toward enemies.
Pressing the attack button again after connecting performs either a Punch or a Kick, depending on the distance to the target.
Punch slightly knocks enemies back.
Kick launches enemies into the air, causing them to take fall damage when they land.
Implementation
As you might expect, this is a multi-state skill with states such as Hook, Pull, Kick, and Punch.
When the Hook attack collides with an enemy, we use an Effect Pack to send the hook data to ourselves.
HookToActor — Effect Pack
HookToActorLinkHookGrapPositionToTargetPositionChainHook / Vector3 / HookGrapPositionLinkerTemporaryIncreaseEvolutionNo_1ChainHook / IntClamped / SkillEvolutionNo1HookedChainHook / IntClamped / Hooked1Add_IntTemporaryAt the start of the pulling state, we use a Linker to copy the enemy's position to the GrapPosition Stat. This Stat is updated whenever the enemy moves.
The Tweener Stat then uses the Start and GrapPosition Stats to interpolate the player's position toward the enemy.
HookPullTween — Stat (Tweener Vector3)
HookPullTweenChainHook / Tween_Vector3 / HookPullTween0.5truetrue0.5trueHookedOn PositiveIn QuadHookPullTweenTemplateWe also set the Hooked flag to true.
A StateBasedTrigger Stat listens for the Hooked flag and starts the pull tween when the flag is enabled.
TriggerHookedEffects — Stat (StateBasedEffect)
TriggerHookedEffectsChainHook / StateBasedEffect / TriggerHookedEffectsIs1(Int)TriggerHookedEffectsHookPullTweenChainHook / Tween_Vector3 / HookPullTweenTween_Vector3MovementBlockMovement / IntClamped / MovementBlocker1Add_IntTemporaryWe also have a ConditionalModifier assigned to SkillEvolutionNo.
ChainHook_EvolutionNo — Stat (Clamped Int)
ChainHook_EvolutionNoChainHook / IntClamped / SkillEvolutionNo4This modifier checks the distance to the closest enemy and determines which state should be activated next.
If the distance check passes, the modifier adds the result to the incoming Effect value. This effectively skips the Punch state at index 3 and activates the Kick state at index 4.
ConditionalEvolutionNoModifier — Stat (ConditionalModifier Float)
ConditionalEvolutionNoModifierScrapTossers / ConditionalModifier / ConditionalEvolutionNoModifier11NoEnemyInSightThe closest enemy is set when we toggle off the Pull state by pressing the skill button again.
ToggleOff_2 — Effect Pack
ToggleOff_2RemoveCastingBlock_ToggleOffDefault / IntClamped / SkillCastingOnProgress_ModifierRemoverSetClosestEnemyDistance_2ChainHook / Float_EdgeValue / ClosestEnemyInSightDistanceSet_FloatTemporaryRemoveHookedModifiers_State_2ChainHook / IntClamped / HookedModifierRemoverRemoveHookGrapPositionInjectors_State_2ChainHook / Vector3 / HookGrapPositionInjectorRemoverIncreaseEvolutionNo_2_ConditionalThe closest enemy is then assigned using the following Effect:
SetClosestEnemyDistance_2 — Float Stat Effect (BS)
SetClosestEnemyDistance_2Set_FloatEverythingTemporaryClosestEnemyInSightDistancetrueCustomClosestInSighttrueStatValueAdapter_DistanceBetweenSource