Esempio n. 1
0
        private Image GetMonsterImage()
        {
            ControlPlus.TipImage tipData = new ControlPlus.TipImage();
            var cardQual = Config.CardConfigManager.GetCardConfig(liveMonster.CardId).Quality;
            var name     = string.Format("{0}(Lv{1})", liveMonster.Avatar.Name, liveMonster.Level);

            tipData.AddTextNewLine(name, HSTypes.I2QualityColor(cardQual), 20);
            tipData.AddImage(HSIcons.GetIconsByEName("atr" + liveMonster.Avatar.MonsterConfig.Attr), 16, 16);
            tipData.AddImage(HSIcons.GetIconsByEName("rac" + liveMonster.Avatar.MonsterConfig.Type), 16, 16);
            tipData.AddLine();

            tipData.AddTextNewLine(string.Format("生命 {0}/{1}", liveMonster.Life, liveMonster.RealMaxHp), "Lime");
            if (liveMonster.HpBar.PArmor > 0)
            {
                AddText(tipData, "物甲", liveMonster.HpBar.PArmor, liveMonster.HpBar.PArmor, "LightGray", true);
            }
            if (liveMonster.HpBar.MArmor > 0)
            {
                AddText(tipData, "魔甲", liveMonster.HpBar.MArmor, liveMonster.HpBar.MArmor, "DodgerBlue", true);
            }
            AddText(tipData, "攻击", (int)liveMonster.Atk.Source, liveMonster.RealAtk, liveMonster.CanAttack ? "White" : "DarkGray", true);
            AddText(tipData, "移动", liveMonster.ReadMov, liveMonster.ReadMov, "White", false);
            AddText(tipData, "射程", liveMonster.RealRange, liveMonster.RealRange, "White", true);
            bool isLeft = false;

            if (liveMonster.RealDef != 0)
            {
                AddText(tipData, "防御", (int)liveMonster.Def.Source, liveMonster.RealDef, "White", isLeft);
                isLeft = !isLeft;
            }
            if (liveMonster.RealMag > 0)
            {
                AddText(tipData, "魔力", (int)liveMonster.Mag.Source, liveMonster.RealMag, "White", isLeft);
                isLeft = !isLeft;
            }
            if (liveMonster.RealSpd != 0)
            {
                AddText(tipData, "攻速", (int)liveMonster.Spd.Source, liveMonster.RealSpd, "White", isLeft);
                isLeft = !isLeft;
            }
            if (liveMonster.RealHit != 0)
            {
                AddText(tipData, "命中", (int)liveMonster.Hit.Source, liveMonster.RealHit, "White", isLeft);
                isLeft = !isLeft;
            }
            if (liveMonster.RealDHit != 0)
            {
                AddText(tipData, "回避", (int)liveMonster.Dhit.Source, liveMonster.RealDHit, "White", isLeft);
                isLeft = !isLeft;
            }
            if (liveMonster.RealCrt != 0)
            {
                AddText(tipData, "暴击", (int)liveMonster.Crt.Source, liveMonster.RealCrt, "White", isLeft);
                isLeft = !isLeft;
            }
            if (liveMonster.RealLuk != 0)
            {
                AddText(tipData, "幸运", (int)liveMonster.Luk.Source, liveMonster.RealLuk, "White", isLeft);
                isLeft = !isLeft;
            }

            foreach (var memBaseSkill in liveMonster.SkillManager.Skills)
            {
                tipData.AddImageNewLine(SkillBook.GetSkillImage(memBaseSkill.SkillId));

                if (liveMonster.SkillManager.InForget && memBaseSkill.Type != SkillSourceTypes.Weapon)
                {
                    tipData.AddText(string.Format("{0} X", memBaseSkill.SkillInfo.Name), "Red");
                    continue;
                }
                string tp = string.Format("{0}:{1}{2}", memBaseSkill.SkillInfo.Name, memBaseSkill.SkillInfo.Descript, memBaseSkill.Percent == 100 ? "" : string.Format("({0}%)", memBaseSkill.Percent));
                if (tp.Length > 20)
                {
                    tipData.AddText(tp.Substring(0, 19), "White");
                    tipData.AddTextNewLine(tp.Substring(19), "White");
                }
                else
                {
                    tipData.AddText(tp, "White");
                }
            }
            if (liveMonster.Weapon != null)
            {
                tipData.AddImageNewLine(liveMonster.Weapon.GetImage(16, 16));
                //todo weapon效果没有
                tipData.AddText(liveMonster.Weapon.Des, "White");
            }

            if (!liveMonster.IsGhost)//鬼不显示buff
            {
                liveMonster.BuffManager.DrawBuffToolTip(tipData);
            }

            return(tipData.Image);
        }
Esempio n. 2
0
        private Image GetMonsterImage()
        {
            ControlPlus.TipImage tipData = new ControlPlus.TipImage();
            var cardQual = Config.CardConfigManager.GetCardConfig(liveMonster.CardId).Quality;
            var name = string.Format("{0}(Lv{1})", liveMonster.Avatar.Name, liveMonster.Level);
            tipData.AddTextNewLine(name, HSTypes.I2QualityColor(cardQual), 20);
            tipData.AddImage(HSIcons.GetIconsByEName("atr" + liveMonster.Avatar.MonsterConfig.Attr), 16, 16);
            tipData.AddImage(HSIcons.GetIconsByEName("rac" + liveMonster.Avatar.MonsterConfig.Type), 16, 16);
            tipData.AddLine();

            tipData.AddTextNewLine(string.Format("生命 {0}/{1}", liveMonster.Life, liveMonster.RealMaxHp), "Lime");
            AddText(tipData, "攻击", (int)liveMonster.Atk.Source, liveMonster.RealAtk, liveMonster.CanAttack ? "White" : "DarkGray", true);
            AddText(tipData, "移动", liveMonster.ReadMov, liveMonster.ReadMov, "White", false);
            AddText(tipData, "射程", liveMonster.RealRange, liveMonster.RealRange, "White", true);
            bool isLeft = false;
            if (liveMonster.RealDef != 0)
            {
                AddText(tipData, "防御", (int)liveMonster.Def.Source, liveMonster.RealDef, "White", isLeft);
                isLeft = !isLeft;
            }
            if (liveMonster.RealMag > 0)
            {
                AddText(tipData, "魔力", (int)liveMonster.Mag.Source, liveMonster.RealMag, "White", isLeft);
                isLeft = !isLeft;
            }
            if (liveMonster.RealSpd != 0)
            {
                AddText(tipData, "攻速", (int)liveMonster.Spd.Source, liveMonster.RealSpd, "White", isLeft);
                isLeft = !isLeft;
            }
            if (liveMonster.RealHit != 0)
            {
                AddText(tipData, "命中", (int)liveMonster.Hit.Source, liveMonster.RealHit, "White", isLeft);
                isLeft = !isLeft;
            }
            if (liveMonster.RealDHit != 0)
            {
                AddText(tipData, "回避", (int)liveMonster.Dhit.Source, liveMonster.RealDHit, "White", isLeft);
                isLeft = !isLeft;
            }
            if (liveMonster.RealCrt != 0)
            {
                AddText(tipData, "暴击", (int)liveMonster.Crt.Source, liveMonster.RealCrt, "White", isLeft);
                isLeft = !isLeft;
            }
            if (liveMonster.RealLuk != 0)
            {
                AddText(tipData, "幸运", (int)liveMonster.Luk.Source, liveMonster.RealLuk, "White", isLeft);
                isLeft = !isLeft;
            }

            foreach (var memBaseSkill in liveMonster.SkillManager.Skills)
            {
                tipData.AddImageNewLine(SkillBook.GetSkillImage(memBaseSkill.SkillId));

                if (liveMonster.SkillManager.InForget && memBaseSkill.Type != SkillSourceTypes.Weapon)
                {
                    tipData.AddText(string.Format("{0} X", memBaseSkill.SkillInfo.Name), "Red");
                    continue;
                }
                string tp = string.Format("{0}:{1}{2}", memBaseSkill.SkillInfo.Name, memBaseSkill.SkillInfo.Descript, memBaseSkill.Percent == 100 ? "" : string.Format("({0}%)", memBaseSkill.Percent));
                if (tp.Length > 20)
                {
                    tipData.AddText(tp.Substring(0, 19), "White");
                    tipData.AddTextNewLine(tp.Substring(19), "White");
                }
                else
                {
                    tipData.AddText(tp, "White");
                }
            }
            if (liveMonster.Weapon != null)
            {
                tipData.AddImageNewLine(liveMonster.Weapon.GetImage(16, 16));
                //todo weapon效果没有
                tipData.AddText(liveMonster.Weapon.Des, "White");
            }

            if (!liveMonster.IsGhost)//鬼不显示buff
            {
                liveMonster.BuffManager.DrawBuffToolTip(tipData);
            }

            return tipData.Image;
        }
Esempio n. 3
0
        public Image GetPreview()
        {
            EquipConfig equipConfig = ConfigData.GetEquipConfig(TemplateId);

            ControlPlus.TipImage tipData = new ControlPlus.TipImage();
            tipData.AddTextNewLine(equipConfig.Name, HSTypes.I2QualityColor(equipConfig.Quality), 20);
            tipData.AddTextNewLine(string.Format("       装备部位:{0}", HSTypes.I2EPosition(equipConfig.Position)), "White");
            tipData.AddTextNewLine(string.Format("       装备等级:{0}", equipConfig.Level), "White");
            tipData.AddTextNewLine("", "White");
            if (Atk > 0)
            {
                EquipAddonConfig eAddon = ConfigData.GetEquipAddonConfig((int) (TowerAttrs.Atk+ 1));
                tipData.AddTextNewLine(string.Format(eAddon.Format, Atk), HSTypes.I2EaddonColor(eAddon.Rare));
            }
            if (Hp > 0)
            {
                EquipAddonConfig eAddon = ConfigData.GetEquipAddonConfig((int)(TowerAttrs.Hp + 1));
                tipData.AddTextNewLine(string.Format(eAddon.Format, Hp), HSTypes.I2EaddonColor(eAddon.Rare));
            }
          
            if (equipConfig.EnergyRate[0] + equipConfig.EnergyRate[1] + equipConfig.EnergyRate[2] > 0)
            {
                tipData.AddLine();
                if (equipConfig.Job > 0)//转换职业
                {
                    var jobConfig = ConfigData.GetJobConfig(equipConfig.Job);
                    tipData.AddTextNewLine(string.Format("转职: {0}", jobConfig.Name), "Pink");
                }
                tipData.AddTextNewLine(string.Format("领导 {0}", equipConfig.EnergyRate[0]), "Gold");
                tipData.AddBar(100, equipConfig.EnergyRate[0], Color.Yellow, Color.Gold);
                tipData.AddTextNewLine(string.Format("力量 {0}", equipConfig.EnergyRate[1]), "Red");
                tipData.AddBar(100, equipConfig.EnergyRate[1], Color.Pink, Color.Red);
                tipData.AddTextNewLine(string.Format("魔力 {0}", equipConfig.EnergyRate[2]), "Blue");
                tipData.AddBar(100, equipConfig.EnergyRate[2], Color.Cyan, Color.Blue);
            }
            
            if (equipConfig.SpecialSkill > 0)
            {
                tipData.AddLine();
                tipData.AddImageNewLine(HeroSkillBook.GetHeroSkillImage(equipConfig.SpecialSkill));
                HeroSkillConfig skillConfig = ConfigData.GetHeroSkillConfig(equipConfig.SpecialSkill);
                string tp = string.Format("{0}:{1}", skillConfig.Name, skillConfig.Des);
                if (tp.Length > 12)
                {
                    tipData.AddText(tp.Substring(0, 11), "White");
                    tipData.AddTextNewLine(tp.Substring(11), "White");
                }
                else
                {
                    tipData.AddText(tp, "White");
                }
            }
            tipData.AddLine();
            tipData.AddTextNewLine(string.Format("需要等级:{0}", equipConfig.LvNeed), UserProfile.InfoBasic.Level < equipConfig.LvNeed ? "Red" : "Gray");
            tipData.AddTextNewLine(string.Format("出售价格:{0}", equipConfig.Value), "Yellow");
            tipData.AddImage(HSIcons.GetIconsByEName("res1"));
            tipData.AddImageXY(EquipBook.GetEquipImage(TemplateId), 8, 8, 48, 48, 7, 24, 32, 32);
            return tipData.Image;
        }
Esempio n. 4
0
        public Image GetPreview()
        {
            EquipConfig equipConfig = ConfigData.GetEquipConfig(TemplateId);

            ControlPlus.TipImage tipData = new ControlPlus.TipImage();
            tipData.AddTextNewLine(equipConfig.Name, HSTypes.I2QualityColor(equipConfig.Quality), 20);
            tipData.AddTextNewLine(string.Format("       装备部位:{0}", HSTypes.I2EPosition(equipConfig.Position)), "White");
            tipData.AddTextNewLine(string.Format("       装备等级:{0}", equipConfig.Level), "White");
            tipData.AddTextNewLine("", "White");
            if (Atk > 0)
            {
                EquipAddonConfig eAddon = ConfigData.GetEquipAddonConfig((int)(EquipAttrs.AtkRate + 1));
                tipData.AddTextNewLine(string.Format(eAddon.Format, equipConfig.AtkR), HSTypes.I2EaddonColor(eAddon.Rare));
            }
            if (Hp > 0)
            {
                EquipAddonConfig eAddon = ConfigData.GetEquipAddonConfig((int)(EquipAttrs.HpRate + 1));
                tipData.AddTextNewLine(string.Format(eAddon.Format, equipConfig.VitR), HSTypes.I2EaddonColor(eAddon.Rare));
            }
            if (Spd > 0)
            {
                EquipAddonConfig eAddon = ConfigData.GetEquipAddonConfig((int)(EquipAttrs.Spd + 1));
                tipData.AddTextNewLine(string.Format(eAddon.Format, equipConfig.Spd), HSTypes.I2EaddonColor(eAddon.Rare));
            }
            if (Range > 0)
            {
                EquipAddonConfig eAddon = ConfigData.GetEquipAddonConfig((int)(EquipAttrs.Range + 1));
                tipData.AddTextNewLine(string.Format(eAddon.Format, equipConfig.Range), HSTypes.I2EaddonColor(eAddon.Rare));
            }

            if (equipConfig.EnergyRate[0] != 0 || equipConfig.EnergyRate[1] != 0 || equipConfig.EnergyRate[2] != 0)
            {
                tipData.AddLine();
                tipData.AddTextNewLine("能量回复比率修正", "White");
                tipData.AddTextNewLine(string.Format("LP {0}", equipConfig.EnergyRate[0].ToString().PadLeft(3, ' ')), "Gold");
                tipData.AddBarTwo(100, equipConfig.EnergyRate[0], Color.Yellow, Color.Gold);
                tipData.AddTextNewLine(string.Format("PP {0}", equipConfig.EnergyRate[1].ToString().PadLeft(3, ' ')), "Red");
                tipData.AddBarTwo(100, equipConfig.EnergyRate[1], Color.Pink, Color.Red);
                tipData.AddTextNewLine(string.Format("MP {0}", equipConfig.EnergyRate[2].ToString().PadLeft(3, ' ')), "Blue");
                tipData.AddBarTwo(100, equipConfig.EnergyRate[2], Color.Cyan, Color.Blue);
            }

            if (equipConfig.HeroSkillId > 0)
            {
                tipData.AddLine();
                tipData.AddImageNewLine(HeroPowerBook.GetImage(equipConfig.HeroSkillId));
                var    skillConfig = ConfigData.GetHeroPowerConfig(equipConfig.HeroSkillId);
                string tp          = string.Format("{0}:{1}", skillConfig.Name, skillConfig.Des);
                if (tp.Length > 12)
                {
                    tipData.AddText(tp.Substring(0, 11), "White");
                    tipData.AddTextNewLine(tp.Substring(11), "White");
                }
                else
                {
                    tipData.AddText(tp, "White");
                }
            }
            if (equipConfig.CommonSkillId > 0)
            {
                tipData.AddLine();
                tipData.AddImageNewLine(SkillBook.GetSkillImage(equipConfig.CommonSkillId));
                var    skillConfig = ConfigData.GetSkillConfig(equipConfig.CommonSkillId);
                string tp          = string.Format("{0}(被动)({2}%):{1}", skillConfig.Name, skillConfig.GetDescript(level), equipConfig.CommonSkillRate);
                if (tp.Length > 12)
                {
                    tipData.AddText(tp.Substring(0, 11), "White");
                    tipData.AddTextNewLine(tp.Substring(11), "White");
                }
                else
                {
                    tipData.AddText(tp, "White");
                }
            }
            tipData.AddLine();
            if (Dura > 0)//实例化了
            {
                tipData.AddTextNewLine(string.Format("耐久:{0}/{1}", Dura, equipConfig.Durable), "White");
            }
            else
            {
                tipData.AddTextNewLine(string.Format("最大耐久:{0}", equipConfig.Durable), "White");
            }
            if (ExpireTime > 0)//存在过期
            {
                var expireTime = TimeTool.UnixTimeToDateTime(ExpireTime);
                if (DateTime.Now >= expireTime.AddSeconds(-60))
                {
                    tipData.AddTextNewLine("即将过期", "Red");
                }
                else
                {
                    var timeDiffer = expireTime - DateTime.Now;
                    tipData.AddTextNewLine(string.Format("过期:{0}天{1}时{2}分", timeDiffer.Days, timeDiffer.Hours, timeDiffer.Minutes), "White");
                }
            }
            tipData.AddLine();
            tipData.AddTextNewLine(string.Format("出售价格:{0}", equipConfig.Value), "Yellow");
            tipData.AddImage(HSIcons.GetIconsByEName("res1"));
            tipData.AddImageXY(EquipBook.GetEquipImage(TemplateId), 8, 8, 48, 48, 7, 24, 32, 32);
            return(tipData.Image);
        }