Esempio n. 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);
            }
        }
Esempio n. 2
0
 private void virtualRegion_RegionEntered(int info, int mx, int my, int key)
 {
     if (aid > 0)
     {
         Image image = AchieveBook.GetPreview(aid);
         tooltip.Show(image, parent, mx, my, aid);
     }
 }
Esempio n. 3
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");
     }
 }
Esempio n. 4
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");
        }
Esempio n. 5
0
 private void ChangeType(int type)
 {
     page = 0;
     AchieveConfig[] achieves = AchieveBook.GetAchievesByType(type);
     achieveIds = new int[achieves.Length];
     for (int i = 0; i < achieves.Length; i++)
     {
         achieveIds[i] = achieves[i].Id;
     }
     Array.Sort(achieveIds, new CompareByAid());
     nlPageSelector1.TotalPage = (achieveIds.Length - 1) / 15 + 1;
     RefreshInfo();
     for (int i = 0; i < 5; i++)
     {
         virtualRegion.SetRegionState(i + 1, RegionState.Free);
     }
     virtualRegion.SetRegionState(type, RegionState.Blacken);
     Invalidate(new Rectangle(9, 35, 66, 30 * 5));
 }
Esempio n. 6
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");
        }
Esempio n. 7
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");
        }
Esempio n. 8
0
        public void Draw(Graphics g)
        {
            if (show)
            {
                AchieveConfig achieveConfig = ConfigData.GetAchieveConfig(aid);

                virtualRegion.Draw(g);

                int bound = achieveConfig.Condition.Value;
                int get   = DataType.User.UserProfile.Profile.GetAchieveState(aid);

                Font  ft   = new Font("宋体", 11.5f * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);
                Image back = PicLoader.Read("System", "AchieveBack.JPG");
                if (get >= bound)
                {
                    get = bound;
                    g.DrawImage(back, x, y, width, height);
                    g.DrawImage(AchieveBook.GetAchieveImage(aid), x + 14, y + 12, 50, 50);
                    g.DrawString(achieveConfig.Name, ft, Brushes.Gold, x + 98, y + 12);
                }
                else
                {
                    Rectangle destBack = new Rectangle(x, y, width, height);
                    g.DrawImage(back, destBack, 0, 0, back.Width, back.Height, GraphicsUnit.Pixel, HSImageAttributes.ToGray);

                    Rectangle dest = new Rectangle(x + 14, y + 12, 50, 50);
                    g.DrawImage(AchieveBook.GetAchieveImage(aid), dest, 0, 0, 64, 64, GraphicsUnit.Pixel, HSImageAttributes.ToGray);
                    g.DrawString(achieveConfig.Name, ft, Brushes.Gray, x + 98, y + 12);
                }
                back.Dispose();
                ft.Dispose();
                LinearGradientBrush b1 = new LinearGradientBrush(new Rectangle(x + 102, y + 53, 100, 9), Color.White, Color.Gray, LinearGradientMode.Vertical);
                g.FillRectangle(b1, x + 87, y + 44, get * 88 / bound, 9);
                b1.Dispose();
            }
        }
Esempio n. 9
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);
        }