Beispiel #1
0
        private void AddLayer(int bodyID, int hue, bool asMount = false)
        {
            int   facing    = MirrorFacingForDraw(Facing);
            int   animation = 0;
            float frame     = 0;

            if (Entity is Mobile)
            {
                animation = (Entity as Mobile).Animation.ActionIndex;
                if (asMount)
                {
                    animation = patchMountAction(animation);
                }
                frame = (Entity as Mobile).Animation.AnimationFrame;
            }
            else if (Entity is Corpse)
            {
                animation = ActionTranslator.GetActionIndex(Entity, MobileAction.Death);
                frame     = (Entity as Corpse).Frame * BodyConverter.DeathAnimationFrameCount(Body);
            }

            int             frameCount;
            IAnimationFrame animframe = getFrame(bodyID, ref hue, facing, animation, frame, out frameCount);

            m_MobileLayers[m_LayerCount++] = new MobileViewLayer(bodyID, hue, animframe);
            m_FrameCount = frameCount;
        }
Beispiel #2
0
        // ============================================================================================================
        // ctor, pick
        // ============================================================================================================

        public MobileView(AEntity entity)
            : base(entity)
        {
            _mobileLayers       = new MobileViewLayer[(int)EquipLayer.LastUserValid];
            PickType            = PickType.PickObjects;
            IsShadowCastingView = true;
        }
        public MobileView(Mobile mobile)
            : base(mobile)
        {
            m_Animation = new MobileAnimation(mobile);

            m_MobileLayers = new MobileViewLayer[(int)EquipLayer.LastUserValid];
            PickType       = PickType.PickObjects;
        }
Beispiel #4
0
        // ======================================================================
        // Public methods and properties: ctr, update, draw
        // ======================================================================

        public MobileView(AEntity entity)
            : base(entity)
        {
            m_MobileLayers = new MobileViewLayer[(int)EquipLayer.LastUserValid];
            PickType = PickType.PickObjects;

            IsShadowCastingView = true;
        }
        public void AddLayer(int bodyID, int hue)
        {
            int   facing    = MirrorFacingForDraw(Entity.Facing);
            int   animation = m_Animation.ActionIndex;
            float frame     = m_Animation.AnimationFrame;

            m_MobileLayers[m_LayerCount++] = new MobileViewLayer(bodyID, hue, getFrame(bodyID, hue, facing, animation, frame));
            m_FrameCount = IO.Animations.GetAnimationFrameCount(bodyID, animation, facing, hue);
        }
Beispiel #6
0
        public void AddLayer(int bodyID, int hue)
        {
            int facing = MirrorFacingForDraw(Entity.Facing);
            int animation = m_Animation.ActionIndex;
            float frame = m_Animation.AnimationFrame;

            int frameCount;
            m_MobileLayers[m_LayerCount++] = new MobileViewLayer(bodyID, hue, getFrame(bodyID, hue, facing, animation, frame, out frameCount));
            m_FrameCount = frameCount;
        }
Beispiel #7
0
        private void AddLayer(int bodyID, int hue, bool asMount = false)
        {
            int facing = MirrorFacingForDraw(Facing);
            int animation = 0;
            float frame = 0;
            if (Entity is Mobile)
            {
                animation = (Entity as Mobile).Animation.ActionIndex;
                if (asMount)
                    animation = patchMountAction(animation);
                frame = (Entity as Mobile).Animation.AnimationFrame;
            }
            else if (Entity is Corpse)
            {
                animation = ActionTranslator.GetActionIndex(Entity, MobileAction.Death);
                frame = (Entity as Corpse).Frame * BodyConverter.DeathAnimationFrameCount(Body);
            }

            int frameCount;
            IAnimationFrame animframe = getFrame(bodyID, ref hue, facing, animation, frame, out frameCount);
            m_MobileLayers[m_LayerCount++] = new MobileViewLayer(bodyID, hue, animframe);
            m_FrameCount = frameCount;
        }