Exemplo n.º 1
0
        private void UpdatePlayerMP(PlayerObj player)
        {
            var num  = (int)(player.MaxMana - player.BaseMana);
            var num2 = player.CurrentMana / player.MaxMana;
            var num3 = (int)(88f + num / 5f);

            if (num3 > m_maxBarLength)
            {
                num3 = m_maxBarLength;
            }
            var scaleX = (num3 - 28 - 28) / 32f;

            m_mpBarContainer.GetChildAt(1).ScaleX = scaleX;
            m_mpBarContainer.GetChildAt(2).X      = m_mpBarContainer.GetChildAt(1).Bounds.Right;
            m_mpBarContainer.CalculateBounds();
            m_mpBar.ScaleX = 1f;
            m_mpBar.ScaleX = (m_mpBarContainer.Width - 8) / (float)m_mpBar.Width * num2;
        }
Exemplo n.º 2
0
        private void ChangeParts(PlayerObj player)
        {
            string[] strArrays = (m_playerInAir = CDGMath.RandomInt(0, 1) == 0)
                ? new[] { "Jumping", "Falling", "AirAttack" }
                : new[] { "Idle", "Walking", "LevelUp", "Dash", "FrontDash", "Attacking3" };

            int max = strArrays.Length - 1;

            if (Game.PlayerStats.Class == 16)
            {
                max--;
            }

            string animationType = strArrays[CDGMath.RandomInt(0, max)];

            //SetPlayerStyle(strArrays[CDGMath.RandomInt(0, strArrays.Length - 1)]);

            m_playerSprite.ChangeSprite("Player" + animationType + "_Character");
            m_playerSprite.Scale         = player.Scale;
            m_playerSprite.OutlineColour = player.OutlineColour;

            for (int i = 0; i < m_playerSprite.NumChildren; i++)
            {
                var src = player.GetChildAt(i);
                var dst = m_playerSprite.GetChildAt(i);

                dst.TextureColor = src.TextureColor;
                dst.Visible      = src.Visible;
            }

            m_playerSprite.CalculateBounds();
            m_playerSprite.Y = 435f - (m_playerSprite.Bounds.Bottom - m_playerSprite.Y);

            //for (int i = 0; i < player.NumChildren; i++)
            //{
            //    SpriteObj childAt = player.GetChildAt(i) as SpriteObj;
            //    SpriteObj textureColor = m_playerSprite.GetChildAt(i) as SpriteObj;
            //    textureColor.TextureColor = childAt.TextureColor;
            //}


            //string spriteName = (m_playerSprite.GetChildAt(12) as IAnimateableObj).SpriteName;
            //int num = spriteName.IndexOf("_") - 1;
            //spriteName = spriteName.Remove(num, 1);
            //if (Game.PlayerStats.Class != 16)
            //{
            //    spriteName = (Game.PlayerStats.Class != 17 ? spriteName.Replace("_", string.Concat(Game.PlayerStats.HeadPiece, "_")) : spriteName.Replace("_", string.Concat(7, "_")));
            //}
            //else
            //{
            //    spriteName = spriteName.Replace("_", string.Concat(6, "_"));
            //}
            //m_playerSprite.GetChildAt(12).ChangeSprite(spriteName);

            //string str = (m_playerSprite.GetChildAt(4) as IAnimateableObj).SpriteName;
            //num = str.IndexOf("_") - 1;
            //str = str.Remove(num, 1);
            //str = str.Replace("_", string.Concat(Game.PlayerStats.ChestPiece, "_"));
            //m_playerSprite.GetChildAt(4).ChangeSprite(str);

            //string spriteName1 = (m_playerSprite.GetChildAt(9) as IAnimateableObj).SpriteName;
            //num = spriteName1.IndexOf("_") - 1;
            //spriteName1 = spriteName1.Remove(num, 1);
            //spriteName1 = spriteName1.Replace("_", string.Concat(Game.PlayerStats.ShoulderPiece, "_"));
            //m_playerSprite.GetChildAt(9).ChangeSprite(spriteName1);

            //string str1 = (m_playerSprite.GetChildAt(3) as IAnimateableObj).SpriteName;
            //num = str1.IndexOf("_") - 1;
            //str1 = str1.Remove(num, 1);
            //str1 = str1.Replace("_", string.Concat(Game.PlayerStats.ShoulderPiece, "_"));
            //m_playerSprite.GetChildAt(3).ChangeSprite(str1);
        }
Exemplo n.º 3
0
        public void SetPlayerStyle(string animationType)
        {
            m_playerSprite.ChangeSprite("Player" + animationType + "_Character");
            PlayerObj player = (ScreenManager as RCScreenManager).Player;

            for (int i = 0; i < m_playerSprite.NumChildren; i++)
            {
                var src = player.GetChildAt(i);
                var dst = m_playerSprite.GetChildAt(i);

                dst.TextureColor = src.TextureColor;
                dst.Visible      = src.Visible;
            }
            m_playerSprite.Scale         = player.Scale;
            m_playerSprite.OutlineColour = player.OutlineColour;


            //m_playerSprite.ChangeSprite("Player" + animationType + "_Character");
            //PlayerObj player = (base.ScreenManager as RCScreenManager).Player;

            //for (int i = 0; i < m_playerSprite.NumChildren; i++)
            //{
            //    m_playerSprite.GetChildAt(i).TextureColor = player.GetChildAt(i).TextureColor;
            //    m_playerSprite.GetChildAt(i).Visible = player.GetChildAt(i).Visible;
            //}

            //m_playerSprite.GetChildAt(16).Visible = false;
            //m_playerSprite.Scale = player.Scale;
            //if (Game.PlayerStats.Traits.X == 8f || Game.PlayerStats.Traits.Y == 8f)
            //{
            //    m_playerSprite.GetChildAt(7).Visible = false;
            //}
            //m_playerSprite.GetChildAt(14).Visible = false;
            //if (Game.PlayerStats.SpecialItem == 8)
            //{
            //    m_playerSprite.GetChildAt(14).Visible = true;
            //}
            //if (Game.PlayerStats.Class == 0 || Game.PlayerStats.Class == 8)
            //{
            //    m_playerSprite.GetChildAt(15).Visible = true;
            //    m_playerSprite.GetChildAt(15).ChangeSprite(string.Concat("Player", animationType, "Shield_Sprite"));
            //}
            //else if (Game.PlayerStats.Class == 5 || Game.PlayerStats.Class == 13)
            //{
            //    m_playerSprite.GetChildAt(15).Visible = true;
            //    m_playerSprite.GetChildAt(15).ChangeSprite(string.Concat("Player", animationType, "Lamp_Sprite"));
            //}
            //else if (Game.PlayerStats.Class == 1 || Game.PlayerStats.Class == 9)
            //{
            //    m_playerSprite.GetChildAt(15).Visible = true;
            //    m_playerSprite.GetChildAt(15).ChangeSprite(string.Concat("Player", animationType, "Beard_Sprite"));
            //}
            //else if (Game.PlayerStats.Class == 4 || Game.PlayerStats.Class == 12)
            //{
            //    m_playerSprite.GetChildAt(15).Visible = true;
            //    m_playerSprite.GetChildAt(15).ChangeSprite(string.Concat("Player", animationType, "Headband_Sprite"));
            //}
            //else if (Game.PlayerStats.Class == 2 || Game.PlayerStats.Class == 10)
            //{
            //    m_playerSprite.GetChildAt(15).Visible = true;
            //    m_playerSprite.GetChildAt(15).ChangeSprite(string.Concat("Player", animationType, "Horns_Sprite"));
            //}
            //else
            //{
            //    m_playerSprite.GetChildAt(15).Visible = false;
            //}
            //m_playerSprite.GetChildAt(0).Visible = false;
            //if (Game.PlayerStats.Class == 16)
            //{
            //    m_playerSprite.GetChildAt(0).Visible = true;
            //    GameObj childAt = m_playerSprite.GetChildAt(12);
            //    object[] objArray = new object[] { "Player", animationType, "Head", 6, "_Sprite" };
            //    childAt.ChangeSprite(string.Concat(objArray));
            //}
            //if (Game.PlayerStats.Class == 17)
            //{
            //    GameObj gameObj = m_playerSprite.GetChildAt(12);
            //    object[] objArray1 = new object[] { "Player", animationType, "Head", 7, "_Sprite" };
            //    gameObj.ChangeSprite(string.Concat(objArray1));
            //}
            //if (Game.PlayerStats.IsFemale)
            //{
            //    m_playerSprite.GetChildAt(5).Visible = true;
            //    m_playerSprite.GetChildAt(13).Visible = true;
            //}
            //else
            //{
            //    m_playerSprite.GetChildAt(5).Visible = false;
            //    m_playerSprite.GetChildAt(13).Visible = false;
            //}
            //if (Game.PlayerStats.Traits.X == 6f || Game.PlayerStats.Traits.Y == 6f)
            //{
            //    m_playerSprite.Scale = new Vector2(3f, 3f);
            //}
            //if (Game.PlayerStats.Traits.X == 7f || Game.PlayerStats.Traits.Y == 7f)
            //{
            //    m_playerSprite.Scale = new Vector2(1.35f, 1.35f);
            //}
            //if (Game.PlayerStats.Traits.X == 10f || Game.PlayerStats.Traits.Y == 10f)
            //{
            //    ObjContainer mPlayerSprite = m_playerSprite;
            //    mPlayerSprite.ScaleX = mPlayerSprite.ScaleX * 0.825f;
            //    ObjContainer scaleY = m_playerSprite;
            //    scaleY.ScaleY = scaleY.ScaleY * 1.25f;
            //}
            //if (Game.PlayerStats.Traits.X == 9f || Game.PlayerStats.Traits.Y == 9f)
            //{
            //    ObjContainer scaleX = m_playerSprite;
            //    scaleX.ScaleX = scaleX.ScaleX * 1.25f;
            //    ObjContainer objContainer = m_playerSprite;
            //    objContainer.ScaleY = objContainer.ScaleY * 1.175f;
            //}
            //if (Game.PlayerStats.Class == 6 || Game.PlayerStats.Class == 14)
            //{
            //    m_playerSprite.OutlineColour = Color.White;
            //    m_playerSprite.GetChildAt(10).Visible = false;
            //    m_playerSprite.GetChildAt(11).Visible = false;
            //}
            //else
            //{
            //    m_playerSprite.OutlineColour = Color.Black;
            //    m_playerSprite.GetChildAt(10).Visible = true;
            //    m_playerSprite.GetChildAt(11).Visible = true;
            //}
            //string spriteName = (m_playerSprite.GetChildAt(12) as IAnimateableObj).SpriteName;
            //int num = spriteName.IndexOf("_") - 1;
            //spriteName = spriteName.Remove(num, 1);
            //if (Game.PlayerStats.Class != 16)
            //{
            //    spriteName = (Game.PlayerStats.Class != 17 ? spriteName.Replace("_", string.Concat(Game.PlayerStats.HeadPiece, "_")) : spriteName.Replace("_", string.Concat(7, "_")));
            //}
            //else
            //{
            //    spriteName = spriteName.Replace("_", string.Concat(6, "_"));
            //}
            //m_playerSprite.GetChildAt(12).ChangeSprite(spriteName);
            //string str = (m_playerSprite.GetChildAt(4) as IAnimateableObj).SpriteName;
            //num = str.IndexOf("_") - 1;
            //str = str.Remove(num, 1);
            //str = str.Replace("_", string.Concat(Game.PlayerStats.ChestPiece, "_"));
            //m_playerSprite.GetChildAt(4).ChangeSprite(str);
            //string spriteName1 = (m_playerSprite.GetChildAt(9) as IAnimateableObj).SpriteName;
            //num = spriteName1.IndexOf("_") - 1;
            //spriteName1 = spriteName1.Remove(num, 1);
            //spriteName1 = spriteName1.Replace("_", string.Concat(Game.PlayerStats.ShoulderPiece, "_"));
            //m_playerSprite.GetChildAt(9).ChangeSprite(spriteName1);
            //string str1 = (m_playerSprite.GetChildAt(3) as IAnimateableObj).SpriteName;
            //num = str1.IndexOf("_") - 1;
            //str1 = str1.Remove(num, 1);
            //str1 = str1.Replace("_", string.Concat(Game.PlayerStats.ShoulderPiece, "_"));
            //m_playerSprite.GetChildAt(3).ChangeSprite(str1);

            m_playerSprite.PlayAnimation(true);
            m_playerSprite.CalculateBounds();
            m_playerSprite.Y = 435f - (m_playerSprite.Bounds.Bottom - m_playerSprite.Y);
        }
Exemplo n.º 4
0
        public void SetPlayerStyle(string animationType)
        {
            m_playerSprite.ChangeSprite("Player" + animationType + "_Character");
            var player = (ScreenManager as RCScreenManager).Player;

            for (var i = 0; i < m_playerSprite.NumChildren; i++)
            {
                m_playerSprite.GetChildAt(i).TextureColor = player.GetChildAt(i).TextureColor;
                m_playerSprite.GetChildAt(i).Visible      = player.GetChildAt(i).Visible;
            }
            m_playerSprite.GetChildAt(16).Visible = false;
            m_playerSprite.Scale = player.Scale;
            if (Game.PlayerStats.Traits.X == 8f || Game.PlayerStats.Traits.Y == 8f)
            {
                m_playerSprite.GetChildAt(7).Visible = false;
            }
            m_playerSprite.GetChildAt(14).Visible = false;
            if (Game.PlayerStats.SpecialItem == 8)
            {
                m_playerSprite.GetChildAt(14).Visible = true;
            }
            if (Game.PlayerStats.Class == 0 || Game.PlayerStats.Class == 8)
            {
                m_playerSprite.GetChildAt(15).Visible = true;
                m_playerSprite.GetChildAt(15).ChangeSprite("Player" + animationType + "Shield_Sprite");
            }
            else if (Game.PlayerStats.Class == 5 || Game.PlayerStats.Class == 13)
            {
                m_playerSprite.GetChildAt(15).Visible = true;
                m_playerSprite.GetChildAt(15).ChangeSprite("Player" + animationType + "Lamp_Sprite");
            }
            else if (Game.PlayerStats.Class == 1 || Game.PlayerStats.Class == 9)
            {
                m_playerSprite.GetChildAt(15).Visible = true;
                m_playerSprite.GetChildAt(15).ChangeSprite("Player" + animationType + "Beard_Sprite");
            }
            else if (Game.PlayerStats.Class == 4 || Game.PlayerStats.Class == 12)
            {
                m_playerSprite.GetChildAt(15).Visible = true;
                m_playerSprite.GetChildAt(15).ChangeSprite("Player" + animationType + "Headband_Sprite");
            }
            else if (Game.PlayerStats.Class == 2 || Game.PlayerStats.Class == 10)
            {
                m_playerSprite.GetChildAt(15).Visible = true;
                m_playerSprite.GetChildAt(15).ChangeSprite("Player" + animationType + "Horns_Sprite");
            }
            else
            {
                m_playerSprite.GetChildAt(15).Visible = false;
            }
            m_playerSprite.GetChildAt(0).Visible = false;
            if (Game.PlayerStats.Class == 16)
            {
                m_playerSprite.GetChildAt(0).Visible = true;
                m_playerSprite.GetChildAt(12).ChangeSprite(string.Concat("Player", animationType, "Head", 6, "_Sprite"));
            }
            if (!Game.PlayerStats.IsFemale)
            {
                m_playerSprite.GetChildAt(5).Visible  = false;
                m_playerSprite.GetChildAt(13).Visible = false;
            }
            else
            {
                m_playerSprite.GetChildAt(5).Visible  = true;
                m_playerSprite.GetChildAt(13).Visible = true;
            }
            if (Game.PlayerStats.Traits.X == 6f || Game.PlayerStats.Traits.Y == 6f)
            {
                m_playerSprite.Scale = new Vector2(3f, 3f);
            }
            if (Game.PlayerStats.Traits.X == 7f || Game.PlayerStats.Traits.Y == 7f)
            {
                m_playerSprite.Scale = new Vector2(1.35f, 1.35f);
            }
            if (Game.PlayerStats.Traits.X == 10f || Game.PlayerStats.Traits.Y == 10f)
            {
                m_playerSprite.ScaleX *= 0.825f;
                m_playerSprite.ScaleY *= 1.25f;
            }
            if (Game.PlayerStats.Traits.X == 9f || Game.PlayerStats.Traits.Y == 9f)
            {
                m_playerSprite.ScaleX *= 1.25f;
                m_playerSprite.ScaleY *= 1.175f;
            }
            if (Game.PlayerStats.Class == 6 || Game.PlayerStats.Class == 14)
            {
                m_playerSprite.OutlineColour = Color.White;
            }
            else
            {
                m_playerSprite.OutlineColour = Color.Black;
            }
            m_playerSprite.CalculateBounds();
            m_playerSprite.Y = 435f - (m_playerSprite.Bounds.Bottom - m_playerSprite.Y);
        }