Exemple #1
0
        /// <summary>
        /// Returns the RunRate that is sent to the client as myRunRate
        /// </summary>
        public float GetRunRate()
        {
            var burden = 0.0f;

            // assuming burden only applies to players...
            if (this is Player player)
            {
                var strength = Strength.Current;

                var capacity = EncumbranceSystem.EncumbranceCapacity((int)strength, player.AugmentationIncreasedCarryingCapacity);
                burden = EncumbranceSystem.GetBurden(capacity, EncumbranceVal ?? 0);

                // TODO: find this exact formula in client
                // technically this would be based on when the player releases / presses the movement key after stamina > 0
                if (player.IsExhausted)
                {
                    burden = 3.0f;
                }
            }

            var runSkill = GetCreatureSkill(Skill.Run).Current;
            var runRate  = MovementSystem.GetRunRate(burden, (int)runSkill, 1.0f);

            return((float)runRate);
        }
Exemple #2
0
        /// <summary>
        /// Returns the RunRate that is sent to the client as myRunRate
        /// </summary>
        public float GetRunRate()
        {
            var runSkill = GetCreatureSkill(Skill.Run).Current;
            var runRate  = MovementSystem.GetRunRate(0.0f, (int)runSkill, 1.0f);

            return((float)runRate);
        }
Exemple #3
0
        public bool InqRunRate(ref float rate)
        {
            // get run skill from WorldObject
            uint runSkill = WorldObject.RunSkill;

            /*var creature = WorldObject as Creature;
             * if (creature != null)
             *  runSkill = creature.GetCreatureSkill(Skill.Run).Current;*/

            //rate = (float)MovementSystem.GetRunRate(0.0f, 300, 1.0f);
            rate = (float)MovementSystem.GetRunRate(0.0f, (int)runSkill, 1.0f);
            //Console.WriteLine($"{WorldObject.Name} ({WorldObject.Guid}) - WeenieObject.InqRunRate: runSkill = {runSkill}, rate = {rate}");
            return(true);
        }
Exemple #4
0
        public void GetMovementSpeed()
        {
            var moveSpeed = MotionTable.GetRunSpeed(MotionTableId);

            if (moveSpeed == 0)
            {
                moveSpeed = 2.5f;
            }
            var scale = ObjScale ?? 1.0f;

            var runSkill = GetCreatureSkill(Skill.Run).Current;

            RunRate   = (float)MovementSystem.GetRunRate(0.0f, (int)runSkill, 1.0f);
            MoveSpeed = moveSpeed * RunRate * scale;

            //Console.WriteLine(Name + " - Run: " + runSkill + " - RunRate: " + RunRate + " - Move: " + MoveSpeed + " - Scale: " + scale);
        }
Exemple #5
0
 public bool InqRunRate(ref float rate)
 {
     // get run skill from WorldObject
     rate = (float)MovementSystem.GetRunRate(0.0f, 300, 1.0f);
     return true;
 }