Example #1
0
        [FieldIndex(Index = 28)] public uint MoveBoostRound;                        //快速移动时长

        public void AddExp(int ex)
        {
            if (Level >= ExpTree.MaxLevel)
            {
                return;
            }

            Exp += ex;
            MainTipManager.AddTip(string.Format("|获得|Cyan|{0}||点经验值", ex), "White");
            AchieveBook.CheckByCheckType("exp");

            if (Exp >= ExpTree.GetNextRequired(Level))
            {
                int oldLevel = Level;
                while (CheckNewLevel()) //循环升级
                {
                    OnLevel(Level);
                }

                MainItem.SystemMenuManager.ResetIconState();
                MainForm.Instance.RefreshView();

                MainItem.PanelManager.ShowLevelInfo(oldLevel, UserProfile.InfoBasic.Level);
            }
        }
Example #2
0
 internal void AddResource(GameResourceType type, uint value)
 {
     Resource.Add(type, (int)value);
     if (type > 0)
     {
         MainTipManager.AddTip(string.Format("|获得|{0}|{1}||x{2}", HSTypes.I2ResourceColor((int)type), HSTypes.I2Resource((int)type), value), "White");
         AchieveBook.CheckByCheckType("resource");
     }
 }
Example #3
0
        public void SetRivalAvail(int id)
        {
            DbRivalState state;

            if (!Rivals.TryGetValue(id, out state))
            {
                Rivals[id] = new DbRivalState(id)
                {
                    Avail = true
                };
            }
            else
            {
                state.Avail = true;
            }
            AchieveBook.CheckByCheckType("people");
        }
Example #4
0
        public void AddRivalState(int id, bool isWin)
        {
            if (PeopleBook.IsPeople(id))//打怪不记录战绩
            {
                if (!Rivals.ContainsKey(id))
                {
                    Rivals[id] = new DbRivalState(id);
                }
                if (isWin)
                {
                    Rivals[id].Win++;
                }
                else
                {
                    Rivals[id].Loss++;
                }
            }

            AchieveBook.CheckByCheckType("fight");
        }
Example #5
0
        public void AddResource(int[] res)
        {
            Resource.Gold      += res[0];
            Resource.Lumber    += res[1];
            Resource.Stone     += res[2];
            Resource.Mercury   += res[3];
            Resource.Carbuncle += res[4];
            Resource.Sulfur    += res[5];
            Resource.Gem       += res[6];

            for (int i = 0; i < 7; i++)
            {
                if (res[i] > 0)
                {
                    MainTipManager.AddTip(string.Format("|获得|{0}|{1}||x{2}", HSTypes.I2ResourceColor(i), HSTypes.I2Resource(i), res[i]), "White");
                }
            }

            AchieveBook.CheckByCheckType("resource");
        }
Example #6
0
        /// <summary>
        /// 添加卡牌,外层都会检查cid的合法性,所以里面不用在判断了
        /// </summary>
        /// <param name="cid">卡牌id</param>
        public DbDeckCard AddCard(int cid)
        {
            DbDeckCard card     = new DbDeckCard(cid, 1, 0);
            var        cardData = CardConfigManager.GetCardConfig(cid);

            if (GetCardCount(cid) >= 1) //每张卡其实只能有一份
            {
                var myCard = GetDeckCardById(cid);
                myCard.AddExp(1); //多余的卡转化为经验值
                return(myCard);   //每种卡牌只能拥有1张
            }

            Cards.Add(card.BaseId, card);
            Newcards.Add(card.BaseId);
            if (Newcards.Count > 10)
            {
                Newcards.RemoveAt(0);
            }

            AchieveBook.CheckByCheckType("card");
            MainTipManager.AddTip(string.Format("|获得卡片-|{0}|{1}", HSTypes.I2QualityColor(cardData.Quality), cardData.Name), "White");

            return(card);
        }