Exemple #1
0
        /// <summary>
        /// 读取表格信息保存到PlayerUpGradeInfo的list集合和字典中
        /// </summary>
        /// <param name="tableId"></param>
        /// <returns></returns>
        public static List <PlayerUpGradeInfo> SelectMenuTable(int tableId)
        {
            DataRowCollection        collect         = ExcelAccess.ReadExcel(SheetNames[tableId - 1]);
            List <PlayerUpGradeInfo> upGradeInfoList = new List <PlayerUpGradeInfo>();

            for (int i = 1; i < collect.Count; i++)
            {
                if (collect[i][1].ToString() == null)
                {
                    continue;
                }
                PlayerUpGradeInfo itemInfo = new PlayerUpGradeInfo();
                if (collect[i][0].ToString() != "")
                {
                    itemInfo.Level                   = int.Parse(collect[i][0].ToString());
                    itemInfo.Exp                     = int.Parse(collect[i][1].ToString());
                    itemInfo.HpPlus                  = int.Parse(collect[i][2].ToString());
                    itemInfo.MpPlus                  = int.Parse(collect[i][3].ToString());
                    itemInfo.AttackPlus              = int.Parse(collect[i][4].ToString());
                    itemInfo.DefencePlus             = int.Parse(collect[i][5].ToString());
                    itemInfo.DexterityPlus           = int.Parse(collect[i][6].ToString());
                    itemInfo.CriticalTriggerRatePlus = float.Parse(collect[i][7].ToString());
                    itemInfo.CriticalAttackPlus      = float.Parse(collect[i][8].ToString());
                    upGaradeInfoDic.Add(itemInfo.Level, itemInfo);
                    upGradeInfoList.Add(itemInfo);
                }
            }
            return(upGradeInfoList);
        }
Exemple #2
0
        }//UpgradeOperation_End

        /// <summary>
        /// 具体升级规则
        /// </summary>
        /// <param name="levelInfo"></param>
        private void UpgradeRuleOperation(PlayerUpGradeInfo levelInfo)
        {
            //玩家所有的核心最大数值[生命值]增加
            PlayerInfo.Instance.PlusHPMax(levelInfo.HpPlus);
            PlayerInfo.Instance.PlusMPMax(levelInfo.MpPlus);
            PlayerInfo.Instance.PlusATKMax(levelInfo.AttackPlus);
            PlayerInfo.Instance.PlusDEFMax(levelInfo.DefencePlus);
            PlayerInfo.Instance.PlusDEXMax(levelInfo.DexterityPlus);
            PlayerInfo.Instance.PlusCTRMax(levelInfo.CriticalTriggerRatePlus);
            PlayerInfo.Instance.PlusCARMax(levelInfo.CriticalAttackPlus);
            //对应的"生命数值" "魔法数值",加满为最大数值
            PlayerInfo.Instance.PlusHP(PlayerInfo.Instance.PlayerPropertyCurrent.HPMax);
            PlayerInfo.Instance.PlusMP(PlayerInfo.Instance.PlayerPropertyCurrent.HPMax);
        }
Exemple #3
0
        /// <summary>
        /// 升级厚要执行的操作
        /// </summary>
        /// <param name="level">升级后的等级</param>
        public void UpgradeOperation(int level)
        {
            PlayerUpGradeInfo levelInfo = upGaradeInfoDic[level];

            UpgradeRuleOperation(levelInfo);
        }//UpgradeOperation_End