Beispiel #1
0
        /// <summary>
        ///     Starts an uncontrolled jump animation, throws the npc with velocity.
        /// </summary>
        /// <param name="move"></param>
        /// <param name="velocity"></param>
        public void DoJump(JumpMoves move, Vec3f velocity)
        {
            ScriptAniJob job;

            switch (move)
            {
            case JumpMoves.Fwd:
                job = AniCatalog.Jumps.Fwd;
                break;

            case JumpMoves.Run:
                job = AniCatalog.Jumps.Run;
                break;

            case JumpMoves.Up:
                job = AniCatalog.Jumps.Up;
                break;

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

            if (job == null)
            {
                return;
            }

            ModelInst.StartAniJobUncontrolled(job);
            Throw(velocity);
        }
Beispiel #2
0
        public void TryJump(JumpMoves move)
        {
            if (Host.IsDead || Host.Environment.InAir)
            {
                return;
            }

            if (Host.ModelInst.GetActiveAniFromLayer(1) != null)
            {
                return;
            }

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

            Host.DoJump(move, new Vec3f(0, move == JumpMoves.Fwd ? 300 : 250, 0));
        }