Ejemplo n.º 1
0
        private void pictureBoxBuy_Click(object sender, EventArgs e)
        {
            int level = UserProfile.InfoSkill.GetSkillAttrLevel(sid);
            int cost  = HeroSkillAttrBook.GetCost(sid, level + 1);

            if (level >= UserProfile.InfoBasic.Level)
            {
                parent.AddFlowCenter("等级限制", "Red");
                return;
            }

            if (UserProfile.InfoBasic.AttrPoint >= cost)
            {
                UserProfile.InfoBasic.AttrPoint -= cost;
                UserProfile.InfoSkill.AddSkillAttrLevel(sid);

                if (level + 1 >= UserProfile.InfoBasic.Level)
                {
                    bitmapButtonBuy.Visible = false;
                }
                parent.Invalidate();
            }
            else
            {
                parent.AddFlowCenter("阅历不足", "Red");
            }
        }
Ejemplo n.º 2
0
 private void virtualRegion_RegionEntered(int info, int mx, int my, int key)
 {
     if (sid > 0)
     {
         int   level = UserProfile.InfoSkill.GetSkillAttrLevel(sid);
         Image image = HeroSkillAttrBook.GetPreview(sid, level);
         tooltip.Show(image, parent, mx, my, sid);
     }
 }
Ejemplo n.º 3
0
 public override void Init(int width, int height)
 {
     base.Init(width, height);
     skills        = HeroSkillAttrBook.GetAvailSkills(UserProfile.InfoBasic.Level);
     page          = 0;
     skillControls = new HeroSkillAttrItem[9];
     for (int i = 0; i < 9; i++)
     {
         skillControls[i] = new HeroSkillAttrItem(this, 10 + (i % 3) * 180, 35 + (i / 3) * 82, 180, 82);
         skillControls[i].Init(i);
     }
     nlPageSelector1.TotalPage = (skills.Length - 1) / 9 + 1;
     RefreshInfo();
 }