コード例 #1
0
        public Animation GetAction(JXAction action)
        {
            Animation ani = new Animation();

            Animation currentHead = head.getAction(action.BodyID);
            Animation currentBody = body.getAction(action.BodyID);
            Animation currentLeftHand = leftHand.getAction(action.BodyID);
            Animation currentRightHand = rightHand.getAction(action.BodyID);

            if (action.HorseID == 0)// no horse
            {
                if (action.OneHandWeaponID == 0 && action.TwoHandWeaponID == 0 && action.DoubleWeaponID == 0)
                    // no weapon
                {
                    for (int j = 0; j < 8; j++)
                    {
                        for (int i = 0; i < action.FrameCount; i++)
                        {
                            int index = j * action.FrameCount + i;
                            List<Bitmap> lstBMP = new List<Bitmap>();
                            if (j == 0)
                            {
                                lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                                lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                            }
                            else if (j == 1 || j == 2 || j == 3)
                            {
                                lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                                lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                            }
                            else if (j == 4)
                            {
                                lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                                lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                                lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                lstBMP.Add(currentHead.GetFrameWithOffset(index));
                            }
                            else// if (j == 5 || j == 6 || j == 7)
                            {
                                lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                                lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                            }
                            Bitmap bmp = combine(lstBMP);
                            ani.AddBitmap(bmp);
                        }
                    }
                }
                else
                {
                    if (action.DoubleWeaponID == 0)// one or two hand weapon
                    {
                        Animation currentWeapon;
                        if (action.OneHandWeaponID != 0)
                        {
                            currentWeapon = oneHandWeapon.getAction(action.OneHandWeaponID);
                        }
                        else
                        {
                            currentWeapon = twoHandWeapon.getAction(action.TwoHandWeaponID);
                        }
                        for (int j = 0; j < 8; j++)
                        {
                            for (int i = 0; i < action.FrameCount; i++)
                            {
                                int index = j * action.FrameCount + i;
                                List<Bitmap> lstBMP = new List<Bitmap>();
                                if (j == 0)
                                {
                                    lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                    lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentWeapon.GetFrameWithOffset(index));
                                }
                                else if (j == 1 || j == 2 || j == 3)
                                {
                                    lstBMP.Add(currentWeapon.GetFrameWithOffset(index));
                                    lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                    lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                                }
                                else if (j == 4)
                                {
                                    lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentWeapon.GetFrameWithOffset(index));
                                    lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                }
                                else// if (j == 5 || j == 6 || j == 7)
                                {
                                    lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                    lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentWeapon.GetFrameWithOffset(index));
                                }
                                Bitmap bmp = combine(lstBMP);
                                ani.AddBitmap(bmp);
                            }
                        }
                    }
                    else// double weapon
                    {
                        Animation currentWeaponLeft = doubleWeaponLeft.getAction(action.DoubleWeaponID);
                        Animation currentWeaponRight = doubleWeaponRight.getAction(action.DoubleWeaponID);
                        for (int j = 0; j < 8; j++)
                        {
                            for (int i = 0; i < action.FrameCount; i++)
                            {
                                int index = j * action.FrameCount + i;
                                List<Bitmap> lstBMP = new List<Bitmap>();
                                if (j == 0)
                                {
                                    lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                    lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentWeaponLeft.GetFrameWithOffset(index));
                                    lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentWeaponRight.GetFrameWithOffset(index));
                                }
                                else if (j == 1 || j == 2 || j == 3)
                                {
                                    lstBMP.Add(currentWeaponRight.GetFrameWithOffset(index));
                                    lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                    lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentWeaponLeft.GetFrameWithOffset(index));
                                }
                                else if (j == 4)
                                {
                                    lstBMP.Add(currentWeaponLeft.GetFrameWithOffset(index));
                                    lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentWeaponRight.GetFrameWithOffset(index));
                                    lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                }
                                else// if (j == 5 || j == 6 || j == 7)
                                {
                                    lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentWeaponLeft.GetFrameWithOffset(index));
                                    lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                    lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentWeaponRight.GetFrameWithOffset(index));
                                }
                                Bitmap bmp = combine(lstBMP);
                                ani.AddBitmap(bmp);
                            }
                        }
                    }
                }
            }
            else// horse
            {
                Animation currentHorseHead = horseHead.getAction(action.HorseID);
                Animation currentHorseBack = horseBack.getAction(action.HorseID);
                Animation currentHorseTail = horseTail.getAction(action.HorseID);
                if (action.OneHandWeaponID == 0 && action.TwoHandWeaponID == 0 && action.DoubleWeaponID == 0)
                    // no weapon, horse
                {
                    for (int j = 0; j < 8; j++)
                    {
                        for (int i = 0; i < action.FrameCount; i++)
                        {
                            int index = j * action.FrameCount + i;
                            List<Bitmap> lstBMP = new List<Bitmap>();
                            if (j == 0)
                            {
                                lstBMP.Add(currentHorseTail.GetFrameWithOffset(index));
                                lstBMP.Add(currentHorseBack.GetFrameWithOffset(index));
                                lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                                lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                                lstBMP.Add(currentHorseHead.GetFrameWithOffset(index));
                            }
                            else if (j == 1 || j == 2 || j == 3)
                            {
                                lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                                lstBMP.Add(currentHorseTail.GetFrameWithOffset(index));
                                lstBMP.Add(currentHorseBack.GetFrameWithOffset(index));
                                lstBMP.Add(currentHorseHead.GetFrameWithOffset(index));
                                lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                            }
                            else if (j == 4)
                            {
                                lstBMP.Add(currentHorseBack.GetFrameWithOffset(index));
                                lstBMP.Add(currentHorseHead.GetFrameWithOffset(index));
                                lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                                lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                                lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                lstBMP.Add(currentHorseTail.GetFrameWithOffset(index));
                            }
                            else// if (j == 5 || j == 6 || j == 7)
                            {
                                lstBMP.Add(currentHorseTail.GetFrameWithOffset(index));
                                lstBMP.Add(currentHorseBack.GetFrameWithOffset(index));
                                lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                                lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                lstBMP.Add(currentHorseHead.GetFrameWithOffset(index));
                                lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                            }
                            Bitmap bmp = combine(lstBMP);
                            ani.AddBitmap(bmp);
                        }
                    }
                }
                else
                {
                    if (action.DoubleWeaponID == 0)// one or two hand weapon, horse
                    {
                        Animation currentWeapon;
                        if (action.OneHandWeaponID != 0)
                        {
                            currentWeapon = oneHandWeapon.getAction(action.OneHandWeaponID);
                        }
                        else
                        {
                            currentWeapon = twoHandWeapon.getAction(action.TwoHandWeaponID);
                        }
                        for (int j = 0; j < 8; j++)
                        {
                            for (int i = 0; i < action.FrameCount; i++)
                            {
                                int index = j * action.FrameCount + i;
                                List<Bitmap> lstBMP = new List<Bitmap>();
                                if (j == 0)
                                {
                                    lstBMP.Add(currentHorseTail.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHorseBack.GetFrameWithOffset(index));
                                    lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                    lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentWeapon.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHorseHead.GetFrameWithOffset(index));
                                }
                                else if (j == 1 || j == 2 || j == 3)
                                {
                                    lstBMP.Add(currentWeapon.GetFrameWithOffset(index));
                                    lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHorseTail.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHorseBack.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHorseHead.GetFrameWithOffset(index));
                                    lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                    lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                                }
                                else if (j == 4)
                                {
                                    lstBMP.Add(currentHorseBack.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHorseHead.GetFrameWithOffset(index));
                                    lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentWeapon.GetFrameWithOffset(index));
                                    lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHorseTail.GetFrameWithOffset(index));
                                }
                                else// if (j == 5 || j == 6 || j == 7)
                                {
                                    lstBMP.Add(currentHorseTail.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHorseBack.GetFrameWithOffset(index));
                                    lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHorseHead.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                    lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentWeapon.GetFrameWithOffset(index));
                                }
                                Bitmap bmp = combine(lstBMP);
                                ani.AddBitmap(bmp);
                            }
                        }
                    }
                    else// double weapon, horse
                    {
                        Animation currentWeaponLeft = doubleWeaponLeft.getAction(action.DoubleWeaponID);
                        Animation currentWeaponRight = doubleWeaponRight.getAction(action.DoubleWeaponID);
                        for (int j = 0; j < 8; j++)
                        {
                            for (int i = 0; i < action.FrameCount; i++)
                            {
                                int index = j * action.FrameCount + i;
                                List<Bitmap> lstBMP = new List<Bitmap>();
                                if (j == 0)
                                {
                                    lstBMP.Add(currentHorseTail.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHorseBack.GetFrameWithOffset(index));
                                    lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                    lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentWeaponLeft.GetFrameWithOffset(index));
                                    lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentWeaponRight.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHorseHead.GetFrameWithOffset(index));

                                }
                                else if (j == 1 || j == 2 || j == 3)
                                {
                                    lstBMP.Add(currentWeaponRight.GetFrameWithOffset(index));
                                    lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHorseTail.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHorseBack.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHorseHead.GetFrameWithOffset(index));
                                    lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                    lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentWeaponLeft.GetFrameWithOffset(index));
                                }
                                else if (j == 4)
                                {
                                    lstBMP.Add(currentHorseHead.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHorseBack.GetFrameWithOffset(index));
                                    lstBMP.Add(currentWeaponLeft.GetFrameWithOffset(index));
                                    lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentWeaponRight.GetFrameWithOffset(index));
                                    lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHorseTail.GetFrameWithOffset(index));
                                }
                                else// if (j == 5 || j == 6 || j == 7)
                                {
                                    lstBMP.Add(currentHorseTail.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHorseBack.GetFrameWithOffset(index));
                                    lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentWeaponLeft.GetFrameWithOffset(index));
                                    lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHorseHead.GetFrameWithOffset(index));
                                    lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentWeaponRight.GetFrameWithOffset(index));

                                }
                                Bitmap bmp = combine(lstBMP);
                                ani.AddBitmap(bmp);
                            }
                        }
                    }
                }
            }

            return ani;
        }
コード例 #2
0
        public Animation GetAction(JXAction action)
        {
            Animation ani = new Animation();

            Animation currentHead      = head.getAction(action.BodyID);
            Animation currentBody      = body.getAction(action.BodyID);
            Animation currentLeftHand  = leftHand.getAction(action.BodyID);
            Animation currentRightHand = rightHand.getAction(action.BodyID);

            if (action.HorseID == 0)// no horse
            {
                if (action.OneHandWeaponID == 0 && action.TwoHandWeaponID == 0 && action.DoubleWeaponID == 0)
                // no weapon
                {
                    for (int j = 0; j < 8; j++)
                    {
                        for (int i = 0; i < action.FrameCount; i++)
                        {
                            int           index  = j * action.FrameCount + i;
                            List <Bitmap> lstBMP = new List <Bitmap>();
                            if (j == 0)
                            {
                                lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                                lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                            }
                            else if (j == 1 || j == 2 || j == 3)
                            {
                                lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                                lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                            }
                            else if (j == 4)
                            {
                                lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                                lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                                lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                lstBMP.Add(currentHead.GetFrameWithOffset(index));
                            }
                            else// if (j == 5 || j == 6 || j == 7)
                            {
                                lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                                lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                            }
                            Bitmap bmp = combine(lstBMP);
                            ani.AddBitmap(bmp);
                        }
                    }
                }
                else
                {
                    if (action.DoubleWeaponID == 0)// one or two hand weapon
                    {
                        Animation currentWeapon;
                        if (action.OneHandWeaponID != 0)
                        {
                            currentWeapon = oneHandWeapon.getAction(action.OneHandWeaponID);
                        }
                        else
                        {
                            currentWeapon = twoHandWeapon.getAction(action.TwoHandWeaponID);
                        }
                        for (int j = 0; j < 8; j++)
                        {
                            for (int i = 0; i < action.FrameCount; i++)
                            {
                                int           index  = j * action.FrameCount + i;
                                List <Bitmap> lstBMP = new List <Bitmap>();
                                if (j == 0)
                                {
                                    lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                    lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentWeapon.GetFrameWithOffset(index));
                                }
                                else if (j == 1 || j == 2 || j == 3)
                                {
                                    lstBMP.Add(currentWeapon.GetFrameWithOffset(index));
                                    lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                    lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                                }
                                else if (j == 4)
                                {
                                    lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentWeapon.GetFrameWithOffset(index));
                                    lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                }
                                else// if (j == 5 || j == 6 || j == 7)
                                {
                                    lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                    lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentWeapon.GetFrameWithOffset(index));
                                }
                                Bitmap bmp = combine(lstBMP);
                                ani.AddBitmap(bmp);
                            }
                        }
                    }
                    else// double weapon
                    {
                        Animation currentWeaponLeft  = doubleWeaponLeft.getAction(action.DoubleWeaponID);
                        Animation currentWeaponRight = doubleWeaponRight.getAction(action.DoubleWeaponID);
                        for (int j = 0; j < 8; j++)
                        {
                            for (int i = 0; i < action.FrameCount; i++)
                            {
                                int           index  = j * action.FrameCount + i;
                                List <Bitmap> lstBMP = new List <Bitmap>();
                                if (j == 0)
                                {
                                    lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                    lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentWeaponLeft.GetFrameWithOffset(index));
                                    lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentWeaponRight.GetFrameWithOffset(index));
                                }
                                else if (j == 1 || j == 2 || j == 3)
                                {
                                    lstBMP.Add(currentWeaponRight.GetFrameWithOffset(index));
                                    lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                    lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentWeaponLeft.GetFrameWithOffset(index));
                                }
                                else if (j == 4)
                                {
                                    lstBMP.Add(currentWeaponLeft.GetFrameWithOffset(index));
                                    lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentWeaponRight.GetFrameWithOffset(index));
                                    lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                }
                                else// if (j == 5 || j == 6 || j == 7)
                                {
                                    lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentWeaponLeft.GetFrameWithOffset(index));
                                    lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                    lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentWeaponRight.GetFrameWithOffset(index));
                                }
                                Bitmap bmp = combine(lstBMP);
                                ani.AddBitmap(bmp);
                            }
                        }
                    }
                }
            }
            else// horse
            {
                Animation currentHorseHead = horseHead.getAction(action.HorseID);
                Animation currentHorseBack = horseBack.getAction(action.HorseID);
                Animation currentHorseTail = horseTail.getAction(action.HorseID);
                if (action.OneHandWeaponID == 0 && action.TwoHandWeaponID == 0 && action.DoubleWeaponID == 0)
                // no weapon, horse
                {
                    for (int j = 0; j < 8; j++)
                    {
                        for (int i = 0; i < action.FrameCount; i++)
                        {
                            int           index  = j * action.FrameCount + i;
                            List <Bitmap> lstBMP = new List <Bitmap>();
                            if (j == 0)
                            {
                                lstBMP.Add(currentHorseTail.GetFrameWithOffset(index));
                                lstBMP.Add(currentHorseBack.GetFrameWithOffset(index));
                                lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                                lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                                lstBMP.Add(currentHorseHead.GetFrameWithOffset(index));
                            }
                            else if (j == 1 || j == 2 || j == 3)
                            {
                                lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                                lstBMP.Add(currentHorseTail.GetFrameWithOffset(index));
                                lstBMP.Add(currentHorseBack.GetFrameWithOffset(index));
                                lstBMP.Add(currentHorseHead.GetFrameWithOffset(index));
                                lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                            }
                            else if (j == 4)
                            {
                                lstBMP.Add(currentHorseBack.GetFrameWithOffset(index));
                                lstBMP.Add(currentHorseHead.GetFrameWithOffset(index));
                                lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                                lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                                lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                lstBMP.Add(currentHorseTail.GetFrameWithOffset(index));
                            }
                            else// if (j == 5 || j == 6 || j == 7)
                            {
                                lstBMP.Add(currentHorseTail.GetFrameWithOffset(index));
                                lstBMP.Add(currentHorseBack.GetFrameWithOffset(index));
                                lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                                lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                lstBMP.Add(currentHorseHead.GetFrameWithOffset(index));
                                lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                            }
                            Bitmap bmp = combine(lstBMP);
                            ani.AddBitmap(bmp);
                        }
                    }
                }
                else
                {
                    if (action.DoubleWeaponID == 0)// one or two hand weapon, horse
                    {
                        Animation currentWeapon;
                        if (action.OneHandWeaponID != 0)
                        {
                            currentWeapon = oneHandWeapon.getAction(action.OneHandWeaponID);
                        }
                        else
                        {
                            currentWeapon = twoHandWeapon.getAction(action.TwoHandWeaponID);
                        }
                        for (int j = 0; j < 8; j++)
                        {
                            for (int i = 0; i < action.FrameCount; i++)
                            {
                                int           index  = j * action.FrameCount + i;
                                List <Bitmap> lstBMP = new List <Bitmap>();
                                if (j == 0)
                                {
                                    lstBMP.Add(currentHorseTail.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHorseBack.GetFrameWithOffset(index));
                                    lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                    lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentWeapon.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHorseHead.GetFrameWithOffset(index));
                                }
                                else if (j == 1 || j == 2 || j == 3)
                                {
                                    lstBMP.Add(currentWeapon.GetFrameWithOffset(index));
                                    lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHorseTail.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHorseBack.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHorseHead.GetFrameWithOffset(index));
                                    lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                    lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                                }
                                else if (j == 4)
                                {
                                    lstBMP.Add(currentHorseBack.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHorseHead.GetFrameWithOffset(index));
                                    lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentWeapon.GetFrameWithOffset(index));
                                    lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHorseTail.GetFrameWithOffset(index));
                                }
                                else// if (j == 5 || j == 6 || j == 7)
                                {
                                    lstBMP.Add(currentHorseTail.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHorseBack.GetFrameWithOffset(index));
                                    lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHorseHead.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                    lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentWeapon.GetFrameWithOffset(index));
                                }
                                Bitmap bmp = combine(lstBMP);
                                ani.AddBitmap(bmp);
                            }
                        }
                    }
                    else// double weapon, horse
                    {
                        Animation currentWeaponLeft  = doubleWeaponLeft.getAction(action.DoubleWeaponID);
                        Animation currentWeaponRight = doubleWeaponRight.getAction(action.DoubleWeaponID);
                        for (int j = 0; j < 8; j++)
                        {
                            for (int i = 0; i < action.FrameCount; i++)
                            {
                                int           index  = j * action.FrameCount + i;
                                List <Bitmap> lstBMP = new List <Bitmap>();
                                if (j == 0)
                                {
                                    lstBMP.Add(currentHorseTail.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHorseBack.GetFrameWithOffset(index));
                                    lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                    lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentWeaponLeft.GetFrameWithOffset(index));
                                    lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentWeaponRight.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHorseHead.GetFrameWithOffset(index));
                                }
                                else if (j == 1 || j == 2 || j == 3)
                                {
                                    lstBMP.Add(currentWeaponRight.GetFrameWithOffset(index));
                                    lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHorseTail.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHorseBack.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHorseHead.GetFrameWithOffset(index));
                                    lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                    lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentWeaponLeft.GetFrameWithOffset(index));
                                }
                                else if (j == 4)
                                {
                                    lstBMP.Add(currentHorseHead.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHorseBack.GetFrameWithOffset(index));
                                    lstBMP.Add(currentWeaponLeft.GetFrameWithOffset(index));
                                    lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentWeaponRight.GetFrameWithOffset(index));
                                    lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHorseTail.GetFrameWithOffset(index));
                                }
                                else// if (j == 5 || j == 6 || j == 7)
                                {
                                    lstBMP.Add(currentHorseTail.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHorseBack.GetFrameWithOffset(index));
                                    lstBMP.Add(currentLeftHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentWeaponLeft.GetFrameWithOffset(index));
                                    lstBMP.Add(currentBody.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHead.GetFrameWithOffset(index));
                                    lstBMP.Add(currentHorseHead.GetFrameWithOffset(index));
                                    lstBMP.Add(currentRightHand.GetFrameWithOffset(index));
                                    lstBMP.Add(currentWeaponRight.GetFrameWithOffset(index));
                                }
                                Bitmap bmp = combine(lstBMP);
                                ani.AddBitmap(bmp);
                            }
                        }
                    }
                }
            }

            return(ani);
        }