public static void SetHookRopeUnwinding(HookPair hook, bool unwinding) { if (hook != null && hook.IsValid()) { if (!hook.isUnwinding && unwinding && hook.rope.Length < MaxRopeLength) { Function.Call(Hash.START_ROPE_UNWINDING_FRONT, hook.rope); hook.isUnwinding = true; } else if (hook.isUnwinding && !unwinding) { Function.Call(Hash.STOP_ROPE_UNWINDING_FRONT, hook.rope); hook.isUnwinding = false; } if (hook.isUnwinding && RopeWindingSpeed > 0.0f) { if (hook.rope.Length + RopeWindingSpeed < MaxRopeLength) { hook.rope.Length += RopeWindingSpeed * Game.LastFrameTime * 100.0f; } else { hook.rope.Length = MaxRopeLength; Function.Call(Hash.STOP_ROPE_UNWINDING_FRONT, hook.rope); hook.isUnwinding = false; } } } }
public static void SetHookRopeWinding(HookPair hook, bool winding) { if (hook != null && hook.IsValid()) { if (!hook.isWinding && winding && hook.rope.Length > MinRopeLength) { Function.Call(Hash.START_ROPE_WINDING, hook.rope); hook.isWinding = true; //hook.isUnwinding = false; } else if (hook.isWinding && !winding) { Function.Call(Hash.STOP_ROPE_WINDING, hook.rope); hook.isWinding = false; } if (hook.isWinding && RopeWindingSpeed > 0.0f) { if (hook.rope.Length - RopeWindingSpeed > MinRopeLength) { hook.rope.Length -= RopeWindingSpeed * Game.LastFrameTime * 100.0f;// * Game.GameTime; } else { hook.rope.Length = MinRopeLength; Function.Call(Hash.STOP_ROPE_WINDING, hook.rope); hook.isWinding = false; } } } }