Exemplo n.º 1
0
    /// <summary>
    /// 玩家持有角色卡牌
    /// </summary>
    /// <param name="card">卡牌集合</param>
    private void setUserCradList(string card)
    {
        if (card == "{}")
        {
            return;
        }
        string[] strs = card.Split(';');
        foreach (string s in strs)
        {
            string data = s.Replace("{", "");
            data = data.Replace("[", "");
            data = data.Replace("]", "");
            data = data.Replace("}", "");
            string[] cardInfo   = data.Split(',');
            int      cardId     = int.Parse(cardInfo[0]);
            int      hero_level = int.Parse(cardInfo[1]);
            //int hero_Star = int.Parse(cardInfo[2]);
            HeroCard c        = cardInfoDic[cardId];
            HeroCard userCard = new HeroCard(c.ToString());
            userCard.Prossive_skill_1 = c.Prossive_skill_1;
            userCard.Prossive_skill_2 = c.Prossive_skill_2;
            userCard.Prossive_skill_3 = c.Prossive_skill_3;
            userCard.Action_skill     = c.Action_skill;
            userCard.Staff_skill_self = c.Staff_skill_self;
            userCard.Hero_level       = hero_level;

            userCard.Fire       = (int)(userCard.OrgFire + userCard.Hero_level * userCard.Fire_growth * 2.3f);
            userCard.Water      = (int)(userCard.OrgWater + userCard.Hero_level * userCard.Water_growth * 2.3f);
            userCard.Soil       = (int)(userCard.OrgSoil + userCard.Hero_level * userCard.Soil_growth * 2.3f);
            userCard.Wind       = (int)(userCard.OrgWind + userCard.Hero_level * userCard.Wind_growth * 2.3f);
            userCard.Thunder    = (int)(userCard.OrgThunder + userCard.Hero_level * userCard.Thunder_growth * 2.3f);
            userCard.Dark       = (int)(userCard.OrgDark + userCard.Hero_level * userCard.Dark_growth * 2.3f);
            userCard.Hero_hp    = (int)(userCard.OrgHp + userCard.Hero_level * userCard.Hero_hp_growth);
            userCard.Hero_speed = (int)(userCard.OrgSpeed + userCard.Hero_level * userCard.Hero_speed_growth);

            userCardList.Add(userCard);
        }
    }