Exemplo n.º 1
0
        /// <summary>
        /// 升级
        /// </summary>
        public static void LevelUp()
        {
            BaseHeroRole baseRole = GameInfo.HeroRoleList.FirstOrDefault(x => x.Role == GameInfo.Role);

            Level++;
            //属性更新
            MaxExp          = NumberHelper.GetLevelExp(Level);
            MaxHealth      += baseRole.GrowthHealth;
            MaxMana        += baseRole.GrowthMana;
            PhysicalAttack += baseRole.GrowthPhysicalAttack;
            MagicAttack    += baseRole.GrowthMagicAttack;
            PhysicalArmor  += baseRole.GrowthPhysicalArmor;
            MagicArmor     += baseRole.GrowthMagicArmor;

            Health += NumberHelper.GetRound(MaxHealth * 0.2f);
            Mana   += NumberHelper.GetRound(MaxMana * 0.2f);
        }
Exemplo n.º 2
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 static void Init()
        {
            GameInfo.HeroRoleList.Clear();

            var warrior = new BaseHeroRole();

            warrior.BaseHealth           = 80;
            warrior.BaseMana             = 10;
            warrior.BasePhysicalAttack   = 12;
            warrior.BaseMagicAttack      = 4;
            warrior.BasePhysicalArmor    = 5;
            warrior.BaseMagicArmor       = 2;
            warrior.GrowthHealth         = 10;
            warrior.GrowthMana           = 2;
            warrior.GrowthPhysicalAttack = 7;
            warrior.GrowthMagicAttack    = 2;
            warrior.GrowthPhysicalArmor  = 3;
            warrior.GrowthMagicArmor     = 1;
            warrior.Name = "无畏战神";
            warrior.Role = HeroRole.FearlessWarrior;
            GameInfo.HeroRoleList.Add(warrior);
        }