Ejemplo n.º 1
0
        public Stream GetRoleIcon(HeroRole heroRole)
        {
            if (heroRole == HeroRole.Multiclass)
            {
                return(null);
            }

            if (RoleIcons.ContainsKey(heroRole))
            {
                return(HeroesIconsAssembly.GetManifestResourceStream(RoleIcons[heroRole]));
            }

            return(null);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 按职业初始化技能列表
        /// </summary>
        /// <param name="role"></param>
        public static void Init(HeroRole role)
        {
            switch (role)
            {
            case HeroRole.FearlessWarrior:
            {
                InitFearlessWarrior();
                break;
            }

            case HeroRole.ElementalMage:
            {
                InitElementalMage();
                break;
            }
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 初始化英雄信息
        /// </summary>
        /// <param name="role"></param>
        public static void New(HeroRole role)
        {
            BaseHeroRole baseRole = GameInfo.HeroRoleList.FirstOrDefault(x => x.Role == role);

            Level          = 0;
            Exp            = 0;
            MaxHealth      = Health = baseRole.BaseHealth;
            MaxMana        = Mana = baseRole.BaseMana;
            MaxExp         = NumberHelper.GetLevelExp(0);
            PhysicalAttack = baseRole.BasePhysicalAttack;
            MagicAttack    = baseRole.BaseMagicAttack;
            PhysicalArmor  = baseRole.BasePhysicalArmor;
            MagicArmor     = baseRole.BaseMagicArmor;

            FirePower   = 0;
            PurePower   = 0;
            ShadowPower = 0;
            HolyPower   = 0;
        }
        public BitmapImage GetRoleIcon(HeroRole heroRole)
        {
            if (RoleIcons.ContainsKey(heroRole))
            {
                try
                {
                    BitmapImage image = new BitmapImage(RoleIcons[heroRole]);
                    image.Freeze();

                    return(image);
                }
                catch (IOException)
                {
                    LogMissingImage($"Missing image: {RoleIcons[heroRole]}");
                    return(null);
                }
            }
            else
            {
                LogReferenceNameNotFound($"Other Icons: {heroRole}");
                return(null);
            }
        }