Beispiel #1
0
        public void DrawBuff(Graphics g, int roundKey)
        {
            MemBaseBuff[] copybuffs = new MemBaseBuff[buffDict.Count];
            buffDict.Values.CopyTo(copybuffs, 0);
            if (copybuffs.Length >= 1 && roundKey % 2 == 0)
            {
                int index = 0;
                int wid   = 100 / copybuffs.Length;
                foreach (var buff in copybuffs)
                {
                    var color = BuffBook.GetBuffColor(buff.Id);
                    var brush = new SolidBrush(color);
                    if (index == copybuffs.Length - 1)//最后一个
                    {
                        g.FillRectangle(brush, wid * index, 0, 100 - wid * (index - 1), 100);
                    }
                    else
                    {
                        g.FillRectangle(brush, wid * index, 0, wid, 100);
                    }
                    brush.Dispose();

                    g.DrawImage(BuffBook.GetBuffImage(buff.Id, (buff.RoundMark / 3) % 2), new Rectangle(wid * index + (wid - 20) / 2, 40, 20, 20), new Rectangle(0, 0, 20, 20), GraphicsUnit.Pixel);

                    index++;
                }
            }
        }
Beispiel #2
0
 public void DelBuff(BuffEffectTypes type)
 {
     foreach (var buff in buffDict.Values)
     {
         if (BuffBook.HasEffect(buff.Id, type))
         {
             buffDict.Remove(buff.Id);
             return;
         }
     }
 }
Beispiel #3
0
 public bool HasBuff(BuffEffectTypes type)
 {
     foreach (var buff in buffDict.Values)
     {
         if (BuffBook.HasEffect(buff.Id, type))
         {
             return(true);
         }
     }
     return(false);
 }
Beispiel #4
0
        public void DrawBuffToolTip(TipImage tipData)
        {
            MemBaseBuff[] memBasebuffInfos = new MemBaseBuff[buffDict.Count];
            buffDict.Values.CopyTo(memBasebuffInfos, 0);
            foreach (MemBaseBuff buffdata in memBasebuffInfos)
            {
                Buff   buff = buffdata.BuffInfo;
                string tp   = "";
                if (buff.BuffConfig.Type[1] == 's')
                {
                    tp = string.Format("{0}(剩余{1:0.0}回合)", buff.BuffConfig.Name, buffdata.TimeLeft);
                }
                else if (buff.BuffConfig.Type[1] == 'a')
                {
                    tp = string.Format("{0}({1})", buff.BuffConfig.Name, buff.Descript);
                }

                tipData.AddImageNewLine(BuffBook.GetBuffImage(buffdata.Id, 0));

                tipData.AddText(tp, BuffBook.GetBuffColor(buffdata.Id));
            }
        }