public void ClearState(CharacterPropertyEnum id)
 {
     BaseProperty.ClearState(id);
     ActualProperty.ClearState(id);
 }
 public void DisableState(CharacterPropertyEnum id)
 {
     BaseProperty.DisableState(id);
     ActualProperty.DisableState(id);
 }
 public void RemoveState(CharacterPropertyEnum id)
 {
     BaseProperty.RemoveState(id);
     ActualProperty.RemoveState(id);
 }
 public void AddState(CharacterPropertyEnum id)
 {
     BaseProperty.AddState(id);
     ActualProperty.AddState(id);
 }
 public bool HaveState(CharacterPropertyEnum id)
 {
     return(ActualProperty.HaveState(id));
 }
Beispiel #6
0
        public void LoadData(TableConfig.Actor cfg)
        {
            m_ConfigData              = cfg;
            BaseProperty.ConfigData   = cfg;
            BaseProperty.Owner        = this;
            ActualProperty.ConfigData = cfg;
            ActualProperty.Owner      = this;

            TableConfig.SkillEventProvider.Instance.skillEventTable.TryGetValue(cfg.id, out m_SkillEventConfigData);

            SetLinkId(cfg.id);
            SetModel(cfg.avatar);
            EntityType    = cfg.type;
            m_Radius      = cfg.size;
            m_ViewRange   = cfg.viewrange;
            m_GohomeRange = cfg.gohomerange;

            float maxAttackRange = 0;

            if (cfg.skill0 > 0)
            {
                SkillInfo info = new SkillInfo(cfg.skill0);
                GetSkillStateInfo().AddSkill(info);

                if (maxAttackRange < info.ConfigData.skillData.distance)
                {
                    maxAttackRange = info.ConfigData.skillData.distance;
                }

                m_AutoSkillIds.Add(cfg.skill0);
            }
            if (cfg.skill1 > 0)
            {
                SkillInfo info = new SkillInfo(cfg.skill1);
                GetSkillStateInfo().AddSkill(info);

                if (maxAttackRange < info.ConfigData.skillData.distance)
                {
                    maxAttackRange = info.ConfigData.skillData.distance;
                }

                m_AutoSkillIds.Add(cfg.skill1);
            }
            if (cfg.skill2 > 0)
            {
                SkillInfo info = new SkillInfo(cfg.skill2);
                GetSkillStateInfo().AddSkill(info);

                if (maxAttackRange < info.ConfigData.skillData.distance)
                {
                    maxAttackRange = info.ConfigData.skillData.distance;
                }

                m_AutoSkillIds.Add(cfg.skill2);
            }
            if (cfg.skill3 > 0)
            {
                SkillInfo info = new SkillInfo(cfg.skill3);
                GetSkillStateInfo().AddSkill(info);

                if (maxAttackRange < info.ConfigData.skillData.distance)
                {
                    maxAttackRange = info.ConfigData.skillData.distance;
                }

                m_AutoSkillIds.Add(cfg.skill3);
            }
            if (cfg.skill4 > 0)
            {
                SkillInfo info = new SkillInfo(cfg.skill4);
                GetSkillStateInfo().AddSkill(info);

                if (maxAttackRange < info.ConfigData.skillData.distance)
                {
                    maxAttackRange = info.ConfigData.skillData.distance;
                }

                m_ManualSkillId = cfg.skill4;
            }
            if (cfg.skill5 > 0)
            {
                SkillInfo info = new SkillInfo(cfg.skill5);
                GetSkillStateInfo().AddSkill(info);

                m_PassiveSkillIds.Add(cfg.skill5);
            }
            if (cfg.skill6 > 0)
            {
                SkillInfo info = new SkillInfo(cfg.skill6);
                GetSkillStateInfo().AddSkill(info);

                m_PassiveSkillIds.Add(cfg.skill6);
            }
            if (cfg.skill7 > 0)
            {
                SkillInfo info = new SkillInfo(cfg.skill7);
                GetSkillStateInfo().AddSkill(info);

                m_PassiveSkillIds.Add(cfg.skill7);
            }
            if (cfg.skill8 > 0)
            {
                SkillInfo info = new SkillInfo(cfg.skill8);
                GetSkillStateInfo().AddSkill(info);

                m_PassiveSkillIds.Add(cfg.skill8);
            }
            if (cfg.bornskill > 0)
            {
                SkillInfo info = new SkillInfo(cfg.bornskill);
                GetSkillStateInfo().AddSkill(info);

                m_BornSkillId = cfg.bornskill;
            }
            if (cfg.deadskill > 0)
            {
                SkillInfo info = new SkillInfo(cfg.deadskill);
                GetSkillStateInfo().AddSkill(info);

                m_DeadSkillId = cfg.deadskill;
            }

            foreach (var pair in TableConfig.AttrDefineProvider.Instance.AttrDefineMgr.GetData())
            {
                TableConfig.AttrDefine def = pair.Value as TableConfig.AttrDefine;
                BaseProperty.SetInt((CharacterPropertyEnum)def.id, def.value);
            }

            InitProperty(CharacterPropertyEnum.x1001_基础物理攻击, cfg.x1001);
            InitProperty(CharacterPropertyEnum.x1002_物理攻击成长, cfg.x1002);
            InitProperty(CharacterPropertyEnum.x1006_基础法术攻击, cfg.x1006);
            InitProperty(CharacterPropertyEnum.x1007_法术攻击成长, cfg.x1007);
            InitProperty(CharacterPropertyEnum.x1011_基础物理防御, cfg.x1011);
            InitProperty(CharacterPropertyEnum.x1012_物理防御成长, cfg.x1012);
            InitProperty(CharacterPropertyEnum.x1016_基础法术防御, cfg.x1016);
            InitProperty(CharacterPropertyEnum.x1017_法术防御成长, cfg.x1017);
            InitProperty(CharacterPropertyEnum.x1021_暴击等级, cfg.x1021);
            InitProperty(CharacterPropertyEnum.x1022_抗暴击等级, cfg.x1022);
            InitProperty(CharacterPropertyEnum.x1024_命中等级, cfg.x1024);
            InitProperty(CharacterPropertyEnum.x1026_闪避等级, cfg.x1026);
            InitProperty(CharacterPropertyEnum.x1028_破击等级, cfg.x1028);
            InitProperty(CharacterPropertyEnum.x1030_格挡等级, cfg.x1030);
            InitProperty(CharacterPropertyEnum.x1032_格挡强度, cfg.x1032);
            InitProperty(CharacterPropertyEnum.x1033_暴击伤害, cfg.x1033);
            InitProperty(CharacterPropertyEnum.x1034_暴击伤害减免, cfg.x1034);

            InitProperty(CharacterPropertyEnum.x2001_基础生命, cfg.x2001);
            InitProperty(CharacterPropertyEnum.x2002_生命成长, cfg.x2002);
            InitProperty(CharacterPropertyEnum.x2007_基础速度, cfg.x2007);
            InitProperty(CharacterPropertyEnum.x2008_速度成长, cfg.x2008);

            InitProperty(CharacterPropertyEnum.x4001_职业, cfg.x4001);
            InitProperty(CharacterPropertyEnum.x4002_阵营, cfg.x4002);
            InitProperty(CharacterPropertyEnum.x4003_品质, cfg.x4003);
            InitProperty(CharacterPropertyEnum.x4004_性别, cfg.x4004);

            AttrCalculator.Calc(this);
            Hp = ActualProperty.GetInt(CharacterPropertyEnum.x2005_最大生命值);
        }