Calc() public static method

public static Calc ( EntityInfo entity ) : void
entity EntityInfo
return void
Exemplo n.º 1
0
        public void EnterScene(User newUser)
        {
            Msg_LR_RoomUserInfo lobbyUserData = newUser.LobbyUserData;

            if (null == lobbyUserData)
            {
                return;
            }
            TableConfig.Actor cfg  = TableConfig.ActorProvider.Instance.GetActor(lobbyUserData.Hero);
            EntityInfo        info = m_EntityMgr.AddEntity(0, lobbyUserData.Camp, cfg, string.Empty);

            info.SetUnitId(EntityInfo.c_StartUserUnitId + info.GetId());
            info.GetMovementStateInfo().FormationIndex = 0;
            if (null != m_SceneConfig)
            {
                info.GetMovementStateInfo().SetPosition2D(m_SceneConfig.EnterX + (Helper.Random.NextFloat() - 0.5f) * m_SceneConfig.EnterRadius, m_SceneConfig.EnterY + (Helper.Random.NextFloat() - 0.5f) * m_SceneConfig.EnterRadius);
            }
            newUser.Info = info;

            AttrCalculator.Calc(info);
            if (newUser.HaveHpArmor)
            {
                info.Hp     = newUser.Hp;
                info.Energy = newUser.Energy;
            }
            else
            {
                info.Hp     = newUser.Info.HpMax;
                info.Energy = newUser.Info.EnergyMax;
            }

            info.SceneContext = m_SceneContext;
            AddCareList(info);
            if (newUser.IsEntered)
            {
                var args = m_StorySystem.NewBoxedValueList();
                args.Add(info.GetId());
                args.Add(info.GetUnitId());
                args.Add(info.GetCampId());
                args.Add(info.GetMovementStateInfo().PositionX);
                args.Add(info.GetMovementStateInfo().PositionZ);
                m_StorySystem.SendMessage("user_enter_scene", args);
            }
        }
Exemplo n.º 2
0
        internal void EnterScene(User newUser)
        {
            Msg_LR_RoomUserInfo lobbyUserData = newUser.LobbyUserData;

            if (null == lobbyUserData)
            {
                return;
            }
            TableConfig.Actor cfg  = TableConfig.ActorProvider.Instance.GetActor(lobbyUserData.Hero);
            EntityInfo        info = m_EntityMgr.AddEntity(0, lobbyUserData.Camp, cfg, (int)AiStateLogicId.Entity_Leader);

            info.SetUnitId(EntityInfo.c_StartUserUnitId + info.GetId());
            info.GetMovementStateInfo().FormationIndex = 0;
            if (null != m_SceneConfig)
            {
                info.GetMovementStateInfo().SetPosition2D(m_SceneConfig.EnterX + (Helper.Random.NextFloat() - 0.5f) * m_SceneConfig.EnterRadius, m_SceneConfig.EnterY + (Helper.Random.NextFloat() - 0.5f) * m_SceneConfig.EnterRadius);
            }
            newUser.Info = info;

            AttrCalculator.Calc(info);
            if (newUser.HaveHpArmor)
            {
                info.SetHp(Operate_Type.OT_Absolute, newUser.Hp);
                info.SetEnergy(Operate_Type.OT_Absolute, newUser.Energy);
            }
            else
            {
                info.SetHp(Operate_Type.OT_Absolute, newUser.Info.GetActualProperty().HpMax);
                info.SetEnergy(Operate_Type.OT_Absolute, newUser.Info.GetActualProperty().EnergyMax);
            }

            info.SceneContext = m_SceneContext;
            AddCareList(info);
            if (newUser.IsEntered)
            {
                m_StorySystem.SendMessage("user_enter_scene", info.GetId(), info.GetUnitId(), info.GetCampId(), info.GetMovementStateInfo().PositionX, info.GetMovementStateInfo().PositionZ);
            }
        }
Exemplo n.º 3
0
        private void TickEntities()
        {
            m_DeletedEntities.Clear();
            for (LinkedListNode <EntityInfo> linkNode = m_EntityMgr.Entities.FirstNode; null != linkNode; linkNode = linkNode.Next)
            {
                EntityInfo info = linkNode.Value;
                info.RetireAttackerInfos(60000);
                if (info.LevelChanged || info.GetSkillStateInfo().BuffChanged)
                {
                    AttrCalculator.Calc(info);
                    info.LevelChanged = false;
                    info.GetSkillStateInfo().BuffChanged = false;
                }
                if (info.IsBorning)
                {
                    if (info.BornTime <= 0)
                    {
                        SkillInfo skillInfo = info.GetSkillStateInfo().GetSkillInfoById(info.BornSkillId);
                        if (info.BornSkillId > 0 && null != skillInfo)
                        {
                            info.BornTime = TimeUtility.GetLocalMilliseconds();
                        }
                        else
                        {
                            info.IsBorning = false;
                            info.BornTime  = 0;
                            info.SetAIEnable(true);
                            info.RemoveState(CharacterPropertyEnum.x3009_无敌);
                        }
                    }
                    else if (info.BornTime + info.BornTimeout < TimeUtility.GetLocalMilliseconds())
                    {
                        info.IsBorning = false;
                        info.BornTime  = 0;
                        info.SetAIEnable(true);
                        info.RemoveState(CharacterPropertyEnum.x3009_无敌);
                    }
                }
                if (info.IsDead() && !info.NeedDelete)
                {
                    if (info.DeadTime <= 0)
                    {
                        CalcKillIncome(info);
                        //发送npc死亡消息
                        Msg_RC_NpcDead npcDeadBuilder = new Msg_RC_NpcDead();
                        npcDeadBuilder.npc_id = info.GetId();
                        NotifyAllUser(RoomMessageDefine.Msg_RC_NpcDead, npcDeadBuilder);

                        SkillInfo skillInfo = info.GetSkillStateInfo().GetSkillInfoById(info.DeadSkillId);
                        if (info.DeadSkillId > 0 && null != skillInfo)
                        {
                            info.DeadTime = TimeUtility.GetLocalMilliseconds();
                            OnEntityKilled(info);
                        }
                        else
                        {
                            if (null == info.CustomData as User)
                            {
                                info.DeadTime   = 0;
                                info.NeedDelete = true;
                                OnEntityKilled(info);
                            }
                            else
                            {
                                info.DeadTime = TimeUtility.GetLocalMilliseconds();
                            }
                        }
                    }
                    else
                    {
                        if (null == info.CustomData as User && info.DeadTime + info.DeadTimeout < TimeUtility.GetLocalMilliseconds())
                        {
                            info.DeadTime   = 0;
                            info.NeedDelete = true;

                            //重新发送npc死亡消息
                            Msg_RC_NpcDead npcDeadBuilder = new Msg_RC_NpcDead();
                            npcDeadBuilder.npc_id = info.GetId();
                            NotifyAllUser(RoomMessageDefine.Msg_RC_NpcDead, npcDeadBuilder);
                        }
                        else if (null != info.CustomData as User && info.DeadTime + info.ReliveTimeout < TimeUtility.GetLocalMilliseconds())
                        {
                            info.DeadTime = 0;
                            info.Hp       = info.HpMax;
                            info.Energy   = info.EnergyMax;

                            Msg_RC_SyncProperty npcProp = DataSyncUtility.BuildSyncPropertyMessage(info);
                            NotifyAllUser(RoomMessageDefine.Msg_RC_SyncProperty, npcProp);
                        }
                    }
                }
                if (info.NeedDelete)
                {
                    m_DeletedEntities.Add(info);
                }
            }
            if (m_DeletedEntities.Count > 0)
            {
                int enemyCt  = 0;
                int friendCt = 0;
                Msg_RC_DestroyNpc destroyNpcBuilder = new Msg_RC_DestroyNpc();
                for (int i = 0; i < m_DeletedEntities.Count; ++i)
                {
                    EntityInfo ni = m_DeletedEntities[i];
                    if (CharacterRelation.RELATION_ENEMY == EntityInfo.GetRelation((int)CampIdEnum.Blue, ni.GetCampId()))
                    {
                        ++enemyCt;
                    }
                    else if (CharacterRelation.RELATION_FRIEND == EntityInfo.GetRelation((int)CampIdEnum.Blue, ni.GetCampId()))
                    {
                        ++friendCt;
                    }
                    //发送npc消失消息
                    destroyNpcBuilder.npc_id = ni.GetId();
                    NotifyAllUser(RoomMessageDefine.Msg_RC_DestroyNpc, destroyNpcBuilder);
                    DestroyEntity(ni);
                }
                TryAllKilledOrAllDied(enemyCt > 0, friendCt > 0);
            }
            m_EntityMgr.ExecuteDelayAdd();
        }
Exemplo n.º 4
0
        public void ImpactDamage(int srcObjId, int targetId, int impactId, int seq, bool isFinal)
        {
            if (!PluginFramework.Instance.IsBattleScene)
            {
                return;
            }
            EntityViewModel view    = GetEntityViewById(targetId);
            EntityViewModel srcView = GetEntityViewById(srcObjId);

            if (null != view && null != view.Entity && null != view.Actor)
            {
                EntityInfo targetObj = view.Entity;
                EntityInfo srcObj    = null;
                if (null != srcView && null != srcView.Entity)
                {
                    srcObj = srcView.Entity;
                }
                if (null != targetObj && !view.Entity.IsDeadSkillCasting())
                {
                    ImpactInfo impactInfo = targetObj.GetSkillStateInfo().GetImpactInfoBySeq(seq);
                    if (null != impactInfo && impactId == impactInfo.ImpactId)
                    {
                        EntityInfo ownerObj = GetRootSummoner(srcObj);
                        int        ownerId  = 0;
                        if (null != ownerObj)
                        {
                            ownerId = ownerObj.GetId();
                        }
                        int addsc = impactInfo.DamageData.AddSc;
                        int adduc = impactInfo.DamageData.AddUc;

                        int index = impactInfo.CurDamageCount;
                        ++impactInfo.CurDamageCount;
                        int  multiple  = impactInfo.DamageData.GetMultiple(index);
                        int  damage    = impactInfo.DamageData.GetDamage(index);
                        long hitrate   = 0;
                        long critrate  = 0;
                        long blockrate = 0;
                        long phyDamage = 0;
                        long magDamage = 0;

                        hitrate   = AttrCalculator.Calc(targetObj.SceneContext, impactInfo.SenderProperty, targetObj.ActualProperty, "hitrate");
                        critrate  = AttrCalculator.Calc(targetObj.SceneContext, impactInfo.SenderProperty, targetObj.ActualProperty, "critrate");
                        blockrate = AttrCalculator.Calc(targetObj.SceneContext, impactInfo.SenderProperty, targetObj.ActualProperty, "blockrate");
                        long rnd        = Helper.Random.Next();
                        long critonoff  = 0;
                        long blockonoff = 0;
                        if (rnd <= critrate)
                        {
                            critonoff = 1;
                        }
                        else if (rnd > critrate && rnd <= critrate + blockrate)
                        {
                            blockonoff = 1;
                        }
                        impactInfo.DamageData.IsCritical = critonoff > 0;
                        impactInfo.DamageData.IsBlock    = blockonoff > 0;
                        phyDamage = AttrCalculator.Calc(targetObj.SceneContext, impactInfo.SenderProperty, targetObj.ActualProperty, "phydamage", multiple, damage, critonoff, blockonoff);
                        magDamage = AttrCalculator.Calc(targetObj.SceneContext, impactInfo.SenderProperty, targetObj.ActualProperty, "magdamage", multiple, damage, critonoff, blockonoff);

                        damage = (int)(phyDamage + magDamage);
                        if (damage < 0)
                        {
                            damage = 0;
                        }
                        int  vampire  = impactInfo.DamageData.GetVampire(index);
                        bool isKiller = false;
                        if (targetObj.Shield >= damage)
                        {
                            targetObj.Shield -= (int)damage;
                        }
                        else if (targetObj.Shield > 0)
                        {
                            int leftDamage = (int)damage - targetObj.Shield;
                            targetObj.Shield = 0;
                            if (targetObj.GetId() == PluginFramework.Instance.LeaderID && targetObj.Hp <= leftDamage)
                            {
                                //队长不死,demo专用代码
                            }
                            else
                            {
                                targetObj.Hp -= (int)leftDamage;
                                if (targetObj.Hp <= 0)
                                {
                                    isKiller = true;
                                }
                            }
                        }
                        else
                        {
                            if (targetObj.GetId() == PluginFramework.Instance.LeaderID && targetObj.Hp <= damage)
                            {
                                //队长不死,demo专用代码
                            }
                            else
                            {
                                targetObj.Hp -= (int)damage;
                                if (targetObj.Hp <= 0)
                                {
                                    isKiller = true;
                                }
                            }
                        }
                        if (isKiller)
                        {
                            targetObj.GetCombatStatisticInfo().AddDeadCount(1);
                            if (null != srcObj)
                            {
                                EntityInfo killer = srcObj;
                                if (killer.SummonerId > 0)
                                {
                                    EntityViewModel npcViewModel = GetEntityViewById(killer.SummonerId);
                                    if (null != npcViewModel)
                                    {
                                        killer = npcViewModel.Entity;
                                    }
                                }
                                if (targetObj.EntityType == (int)EntityTypeEnum.Tower)
                                {
                                    killer.GetCombatStatisticInfo().AddKillTowerCount(1);
                                }
                                else if (targetObj.EntityType == (int)EntityTypeEnum.Hero)
                                {
                                    killer.GetCombatStatisticInfo().AddKillHeroCount(1);
                                    killer.GetCombatStatisticInfo().AddMultiKillCount(1);
                                }
                                else
                                {
                                    killer.GetCombatStatisticInfo().AddKillNpcCount(1);
                                }
                            }
                        }
                        targetObj.SetAttackerInfo(srcObjId, isKiller, true, false, (int)damage, 0);
                    }
                }
            }
        }
Exemplo n.º 5
0
 private void TickEntities()
 {
     m_DeletedEntities.Clear();
     for (LinkedListNode <EntityInfo> linkNode = m_EntityManager.Entities.FirstValue; null != linkNode; linkNode = linkNode.Next)
     {
         EntityInfo info = linkNode.Value;
         info.RetireAttackerInfos(10000);
         if (info.LevelChanged || info.GetSkillStateInfo().BuffChanged)
         {
             AttrCalculator.Calc(info);
             info.LevelChanged = false;
             info.GetSkillStateInfo().BuffChanged = false;
         }
         if (info.IsBorning)
         {
             if (info.BornTime <= 0)
             {
                 SkillInfo skillInfo = info.GetSkillStateInfo().GetSkillInfoById(info.BornSkillId);
                 if (info.BornSkillId > 0 && null != skillInfo)
                 {
                     info.BornTime = TimeUtility.GetLocalMilliseconds();
                     GfxSkillSystem.Instance.StartSkill(info.GetId(), skillInfo.ConfigData, 0);
                 }
                 else
                 {
                     info.IsBorning = false;
                     info.BornTime  = 0;
                     info.SetAIEnable(true);
                     info.SetStateFlag(Operate_Type.OT_RemoveBit, CharacterState_Type.CST_Invincible);
                 }
             }
             else if (info.BornTime + info.BornTimeout < TimeUtility.GetLocalMilliseconds())
             {
                 info.IsBorning = false;
                 info.BornTime  = 0;
                 info.SetAIEnable(true);
                 info.SetStateFlag(Operate_Type.OT_RemoveBit, CharacterState_Type.CST_Invincible);
             }
         }
         if (info.IsDead() && !info.NeedDelete)
         {
             if (info.CanDead)
             {
                 if (info.DeadTime <= 0)
                 {
                     SkillInfo skillInfo = info.GetSkillStateInfo().GetSkillInfoById(info.DeadSkillId);
                     if (info.DeadSkillId > 0 && null != skillInfo)
                     {
                         info.DeadTime = TimeUtility.GetLocalMilliseconds();
                         GfxSkillSystem.Instance.StopAllSkill(info.GetId(), true, false, true);
                         GfxSkillSystem.Instance.StartSkill(info.GetId(), skillInfo.ConfigData, 0);
                         OnEntityKilled(info);
                         EntityDrop(info); // 掉落
                     }
                     else
                     {
                         info.DeadTime   = 0;
                         info.NeedDelete = true;
                         OnEntityKilled(info);
                         EntityDrop(info); // 掉落
                     }
                 }
                 else if (info.DeadTime + info.DeadTimeout < TimeUtility.GetLocalMilliseconds())
                 {
                     info.DeadTime   = 0;
                     info.NeedDelete = true;
                 }
             }
             else
             {
                 info.CanDead = true;
             }
         }
         else
         {
             //每个tick复位CanDead,技能里需要鞭尸时应使用触发器每帧标记目标不可死亡(keeplive)
             info.CanDead = true;
         }
         if (info.NeedDelete)
         {
             m_DeletedEntities.Add(info);
         }
     }
     if (m_DeletedEntities.Count > 0)
     {
         int enemyCt  = 0;
         int friendCt = 0;
         for (int i = 0; i < m_DeletedEntities.Count; ++i)
         {
             EntityInfo ni = m_DeletedEntities[i];
             if (CharacterRelation.RELATION_ENEMY == EntityInfo.GetRelation(CampId, ni.GetCampId()))
             {
                 ++enemyCt;
             }
             else if (CharacterRelation.RELATION_FRIEND == EntityInfo.GetRelation(CampId, ni.GetCampId()))
             {
                 ++friendCt;
             }
             DestroyEntity(ni);
         }
         TryAllKilledOrAllDied(enemyCt > 0, friendCt > 0);
     }
 }
Exemplo n.º 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_最大生命值);
        }
Exemplo n.º 7
0
        public void LoadData(TableConfig.Actor cfg)
        {
            m_ConfigData = cfg;

            SetLinkId(cfg.id);
            SetModel(cfg.avatar);
            EntityType = cfg.type;
            m_Radius   = cfg.size;

            float maxAttackRange = 0;

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

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

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

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

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

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

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

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

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

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

                m_ManualSkillId = cfg.skill4;
                //m_AutoSkillIds.Add(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;
            }

            ViewRange   = cfg.viewrange;
            GohomeRange = cfg.gohomerange;

            GetBaseProperty().SetRps(Operate_Type.OT_Absolute, 1);
            GetBaseProperty().SetAttackBase(Operate_Type.OT_Absolute, cfg.attack);
            GetBaseProperty().SetDefenceBase(Operate_Type.OT_Absolute, cfg.defence);
            GetBaseProperty().SetAttackRange(Operate_Type.OT_Absolute, maxAttackRange);
            GetBaseProperty().SetHpMax(Operate_Type.OT_Absolute, cfg.hp);
            GetBaseProperty().SetEnergyMax(Operate_Type.OT_Absolute, cfg.mp);
            GetBaseProperty().SetMoveSpeed(Operate_Type.OT_Absolute, cfg.speed);

            AttrCalculator.Calc(this);
            SetHp(Operate_Type.OT_Absolute, GetActualProperty().HpMax);
            SetEnergy(Operate_Type.OT_Absolute, GetActualProperty().EnergyMax);
        }