예제 #1
0
        internal void TryClimb(ClimbMoves move, WorldObjects.NPC.ClimbingLedge ledge)
        {
            if (Host.IsDead || Host.Environment.InAir)
            {
                return;
            }

            if (Host.ModelInst.IsInAnimation())
            {
                return;
            }

            if (!jumpLockTimer.IsReady) // don't spam
            {
                return;
            }

            Host.DoClimb(move, ledge);
        }
예제 #2
0
        public void DoClimb(ClimbMoves move, NPC.ClimbingLedge ledge)
        {
            ScriptAniJob job;

            switch (move)
            {
            case ClimbMoves.High:
                job = AniCatalog.Climbs.High;
                break;

            case ClimbMoves.Mid:
                job = AniCatalog.Climbs.Mid;
                break;

            case ClimbMoves.Low:
                job = AniCatalog.Climbs.Low;
                break;

            default:
                Logger.Log("Not existing climb move: " + move);
                return;
            }

            if (job == null)
            {
                return;
            }


            var stream = BaseInst.GetScriptVobStream();

            stream.Write((byte)ScriptVobMessageIDs.Climb);
            ledge.WriteStream(stream);
            BaseInst.SendScriptVobStream(stream);

            IsClimbing = true;
            ModelInst.StartAniJob(job, () => IsClimbing = false);
        }