| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 | using System;using System.Collections.Generic;using Excel2Json;using Fort23.UTool;namespace GameLogic.Hero{    public class FaBaoInfo    {        /// <summary>        /// 星级        /// </summary>        public int star;        public FabaoConfig FabaoConfig;        public FabaoPowerupConfig FabaoPowerupConfig;        public SkillConfig SkillConfig;        public float[] effectValue;        public long qiangDu;        public Dictionary<int, long> attriButedIC = new Dictionary<int, long>();                public AccountFileInfo.FaBaoData FaBaoData;         public FaBaoInfo(AccountFileInfo.FaBaoData faBaoData)        {            CustomInit(faBaoData);        }        public void UpGrade()        {            FaBaoData.level++;            CustomInit(FaBaoData);            AccountFileInfo.Instance.SavePlayerData();        }        public FaBaoInfo(int id, int powerupId, int start = 1)        {            FaBaoData = new AccountFileInfo.FaBaoData();            FaBaoData.level= powerupId;            FaBaoData.id = id;            // FaBaoData.useIndex = start;            FabaoConfig = ConfigComponent.Instance.Get<FabaoConfig>(id);            FabaoPowerupConfig = ConfigComponent.Instance.Get<FabaoPowerupConfig>(powerupId);            SkillConfig = ConfigComponent.Instance.Get<SkillConfig>(FabaoConfig.SkillGroupID * 10 + FabaoPowerupConfig.SkillLevel - 1);            effectValue = new float[SkillConfig.effectValue.Length];                                               attriButedIC.Clear();            //计算加得属性            for (var i = 0; i < FabaoConfig.ShuxingIDs.Length; i++)            {                long attribute = GetAttriBute(FabaoConfig.ShuxingIDs[i]);                long value = (long)(attribute * FabaoConfig.ShuxingPara[0] * 0.01f);                attriButedIC.Add(FabaoConfig.ShuxingIDs[i], value);            }            qiangDu = (long)(FabaoPowerupConfig.Power * SkillConfig.power * 0.01f);        }        public void CustomInit(AccountFileInfo.FaBaoData faBaoData)        {            FaBaoData = faBaoData;                                FabaoConfig = ConfigComponent.Instance.Get<FabaoConfig>(faBaoData.id);            FabaoPowerupConfig = ConfigComponent.Instance.Get<FabaoPowerupConfig>(faBaoData.level);            SkillConfig = ConfigComponent.Instance.Get<SkillConfig>(FabaoConfig.SkillGroupID * 10 + FabaoPowerupConfig.SkillLevel - 1);            effectValue = new float[SkillConfig.effectValue.Length];            Array.Copy(SkillConfig.effectValue, effectValue, SkillConfig.effectValue.Length);            attriButedIC.Clear();            //计算加得属性            for (var i = 0; i < FabaoConfig.ShuxingIDs.Length; i++)            {                long attribute = GetAttriBute(FabaoConfig.ShuxingIDs[i]);                long value = (long)(attribute * FabaoConfig.ShuxingPara[0] * 0.01f);                attriButedIC.Add(FabaoConfig.ShuxingIDs[i], value);            }            qiangDu = (long)(FabaoPowerupConfig.Power * SkillConfig.power * 0.01f);        }        private long GetAttriBute(int type)        {            switch (type)            {                case 1:                    return FabaoPowerupConfig.HP;                case 2:                    return FabaoPowerupConfig.HP;                case 3:                    return FabaoPowerupConfig.HP;            }            return 0;        }    }}
 |