Пример #1
0
        public static GeneralInfo GetGeneralInfoFromConfig(int configID, int level, int soldierCount)
        {
            GeneralInfo g = new GeneralInfo();
            g.GeneralConfig = DBConfigMgr.Instance.MapGeneral[configID];
            g.Level = level;
            g.Rank = 0;
            g.SoldierCount = soldierCount;

            return g;
        }
Пример #2
0
        // 计算武将战斗力
        public static int ComputeBattlePowerPoint(GeneralInfo gInfo, SoldierInfo sInfo)
        {
            double point = 0;

            //point = gInfo.HP * 0.038 + gInfo.ATK * 0.06 + gInfo.DEF * 0.17 + gInfo.CriticalRate * 1.9 + gInfo.DodgeRate * 1.3 + gInfo.HitRate * 1.4;
            point = gInfo.HP * 0.25 + gInfo.ATK * 0.25 + gInfo.DEF * 0.25;

            // 加上部队
            point += 0.1 * (sInfo.HP * 0.25 + sInfo.ATK * 0.25 + sInfo.DEF * 0.25) * sInfo.SoldierCount;

            // 加上装备
            return (int)point;
        }
Пример #3
0
        public static GeneralInfo GetGeneralInfoFromPlayerSlot(int slotIndex)
        {
            GeneralInfo g = new GeneralInfo();
            SlotGeneral s1 = (SlotGeneral)PlayerDataMgr.Instance.GetPlayerBag(SlotType.SlotType_General)[slotIndex];
            SlotSoldier s2 = (SlotSoldier)PlayerDataMgr.Instance.GetPlayerBag(SlotType.SlotType_Soldier)[s1.SoldierIndex];

            g.GeneralConfig = s1.GeneralConfig;
            g.Level = s1.Lv;
            g.Rank = s1.Rank;
            g.SoldierConfigID = s2.ConfigID;
            g.SoldierCount = s2.Count;
            g.SlotIndex = slotIndex;
            g.Exp = s1.ExtraData2;

            return g;
        }
Пример #4
0
        /// <summary>
        /// 战斗计算公式
        /// </summary>
        /// <param name="gInfo"></param>
        /// <param name="sInfo"></param>
        /// <returns></returns>
        public static int BattlePowerPoint(GeneralInfo gInfo, SoldierInfo sInfo)
        {
            double point = 0;

            // 武将自身的
            point += CONST_STAR_GAP_PARAMS[gInfo.GeneralConfig.Star] * CONST_CLASS_GAP_PARAMS[gInfo.Rank] *
                (gInfo.Level + 5) * CONST_BASE_GENERAL_VALUE;

            // 加上部队
            point += CONST_STAR_GAP_PARAMS[sInfo.SoldierConfig.Star] * (sInfo.Level + 5) *
                sInfo.SoldierCount * CONST_BASE_SOLDIER_VALUE;

            // 加上技能1
            point += gInfo.Skill1  * CONST_SKILL_STAR_GAP_PARAMS[gInfo.GeneralConfig.Star] * CONST_BASE_SKILL_VALUE;

            // 加上技能2
            if (gInfo.Skill2 > 0) point += gInfo.Skill2 * CONST_SKILL_STAR_GAP_PARAMS[gInfo.GeneralConfig.Star] * CONST_BASE_SKILL_VALUE;

            // 加上装备
            return (int)point;
        }
Пример #5
0
        /// <summary>
        /// 获取一个指定星级的标准武将
        /// </summary>
        /// <param name="star"></param>
        /// <param name="level"></param>
        /// <returns></returns>
        public static GeneralInfo GetBasicStarGeneralInfo(int star, int level)
        {
            GeneralInfo g = new GeneralInfo();
            int[] generalTemplate = { 0, 2000, 123, 1, 2, 3 };
            g.GeneralConfig = DBConfigMgr.Instance.MapGeneral[generalTemplate[star]];
            g.Level = level;
            g.Rank = 0;
            g.Skill1 = level;

            g.Skill2 = star > 2 ? level : 0;

            return g;
        }