Exemplo n.º 1
0
 public ItemDataInfo GetItemData(int item_id, int random_property)
 {
     if (null != m_Items && m_Items.Count > 0)
     {
         bool         ret        = false;
         ItemDataInfo exist_info = null;
         foreach (ItemDataInfo info in m_Items)
         {
             if (info.ItemId == item_id && random_property == info.RandomProperty)
             {
                 exist_info = info;
                 ret        = true;
                 break;
             }
         }
         if (ret)
         {
             ItemDataInfo item_info = new ItemDataInfo();
             item_info.ItemConfig     = ItemConfigProvider.Instance.GetDataById(item_id);
             item_info.Level          = exist_info.Level;
             item_info.ItemNum        = exist_info.ItemNum;
             item_info.RandomProperty = exist_info.RandomProperty;
             if (null != item_info.ItemConfig)
             {
                 return(item_info);
             }
         }
     }
     return(null);
 }
Exemplo n.º 2
0
 public void AddItemData(ItemDataInfo item, int num)
 {
     if (null != item && null != m_Items)
     {
         bool isHave = false;
         for (int i = 0; i < m_Items.Count; i++)
         {
             if (m_Items[i].ItemId == item.ItemId && m_Items[i].RandomProperty == item.RandomProperty &&
                 null != item.ItemConfig && item.ItemConfig.m_MaxStack > 1)
             {
                 m_Items[i].ItemNum += num;
                 isHave              = true;
                 break;
             }
         }
         if (!isHave)
         {
             m_Items.Add(item);
         }
         if (WorldSystem.Instance.IsPureClientScene())
         {
             GfxSystem.PublishGfxEvent("ge_item_change", "item");//通知ui做效果
         }
     }
 }
Exemplo n.º 3
0
 public void HeroRelive()
 {
     ArkCrossEngine.RoleInfo ri = ArkCrossEngine.LobbyClient.Instance.CurrentRole;
     if (ri != null)
     {
         int reliveStoneId                = ArkCrossEngine.ItemConfigProvider.Instance.GetReliveStoneId();
         int reliveStoneCount             = 0;
         ArkCrossEngine.ItemDataInfo item = ri.GetItemData(reliveStoneId, 0);
         if (null != item)
         {
             reliveStoneCount = item.ItemNum;
         }
         if (ri.Gold < 50 && reliveStoneCount <= 0)
         {
             ArkCrossEngine.LogicSystem.EventChannelForGfx.Publish("ge_show_dialog", "ui",
                                                                   ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(149), ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(140), null, null, null, false);
         }
         else
         {
             UnityEngine.GameObject go = UIManager.Instance.GetWindowGoByName("FightUI");
             if (go != null)
             {
                 PveFightInfo pfi = go.GetComponent <PveFightInfo>();
                 if (pfi != null)
                 {
                     pfi.AboutHeroDead();
                 }
             }
             time = 0.0f;
             ArkCrossEngine.GfxSystem.EventChannelForLogic.Publish("ge_request_relive", "lobby", true);
             ArkCrossEngine.LogicSystem.EventChannelForGfx.Publish("ge_ui_connect_hint", "ui", true, true);
         }
     }
 }
Exemplo n.º 4
0
        internal void UpdateEquipment()
        {
            for (int i = 0; i < EquipmentInfo.c_MaxEquipmentNum; i++)
            {
                ItemDataInfo equip = m_User.GetEquipmentStateInfo().GetEquipmentData(i);
                UpdateEquipment(equip, false);
            }

            UpdateSuit();
        }
 public static void RefixAttrByXSoul(CharacterInfo obj)
 {
     foreach (XSoulPartInfo part in obj.GetXSoulInfo().GetAllXSoulPartData().Values)
     {
         ItemDataInfo info = part.XSoulPartItem;
         if (null != info)
         {
             float aMoveSpeed          = obj.GetActualProperty().MoveSpeed;
             int   aHpMax              = obj.GetActualProperty().HpMax;
             int   aEnergyMax          = obj.GetActualProperty().EnergyMax;
             float aHpRecover          = obj.GetActualProperty().HpRecover;
             float aEnergyRecover      = obj.GetActualProperty().EnergyRecover;
             int   aAttackBase         = obj.GetActualProperty().AttackBase;
             int   aADefenceBase       = obj.GetActualProperty().ADefenceBase;
             int   aMDefenceBase       = obj.GetActualProperty().MDefenceBase;
             float aCritical           = obj.GetActualProperty().Critical;
             float aCriticalPow        = obj.GetActualProperty().CriticalPow;
             float aCriticalBackHitPow = obj.GetActualProperty().CriticalBackHitPow;
             float aCriticalCrackPow   = obj.GetActualProperty().CriticalCrackPow;
             float aFireDamage         = obj.GetActualProperty().FireDamage;
             float aFireERD            = obj.GetActualProperty().FireERD;
             float aIceDamage          = obj.GetActualProperty().IceDamage;
             float aIceERD             = obj.GetActualProperty().IceERD;
             float aPoisonDamage       = obj.GetActualProperty().PoisonDamage;
             float aPoisonERD          = obj.GetActualProperty().PoisonERD;
             float aWeight             = obj.GetActualProperty().Weight;
             float aRps         = obj.GetActualProperty().Rps;
             float aAttackRange = obj.GetActualProperty().AttackRange;
             info.Level -= 1;
             obj.GetActualProperty().SetMoveSpeed(Operate_Type.OT_Relative, info.GetAddSpd(aMoveSpeed, obj.GetLevel()));
             obj.GetActualProperty().SetHpMax(Operate_Type.OT_Relative, (int)info.GetAddHpMax(aHpMax, obj.GetLevel()));
             obj.GetActualProperty().SetEnergyMax(Operate_Type.OT_Relative, (int)info.GetAddEpMax(aEnergyMax, obj.GetLevel()));
             obj.GetActualProperty().SetHpRecover(Operate_Type.OT_Relative, info.GetAddHpRecover(aHpRecover, obj.GetLevel()));
             obj.GetActualProperty().SetEnergyRecover(Operate_Type.OT_Relative, info.GetAddEpRecover(aEnergyRecover, obj.GetLevel()));
             obj.GetActualProperty().SetAttackBase(Operate_Type.OT_Relative, (int)info.GetAddAd(aAttackBase, obj.GetLevel()));
             obj.GetActualProperty().SetADefenceBase(Operate_Type.OT_Relative, (int)info.GetAddADp(aADefenceBase, obj.GetLevel()));
             obj.GetActualProperty().SetMDefenceBase(Operate_Type.OT_Relative, (int)info.GetAddMDp(aMDefenceBase, obj.GetLevel()));
             obj.GetActualProperty().SetCritical(Operate_Type.OT_Relative, info.GetAddCri(aCritical, obj.GetLevel()));
             obj.GetActualProperty().SetCriticalPow(Operate_Type.OT_Relative, info.GetAddPow(aCriticalPow, obj.GetLevel()));
             obj.GetActualProperty().SetCriticalBackHitPow(Operate_Type.OT_Relative, info.GetAddBackHitPow(aCriticalBackHitPow, obj.GetLevel()));
             obj.GetActualProperty().SetCriticalCrackPow(Operate_Type.OT_Relative, info.GetAddCrackPow(aCriticalCrackPow, obj.GetLevel()));
             obj.GetActualProperty().SetFireDamage(Operate_Type.OT_Relative, info.GetAddFireDam(aFireDamage, obj.GetLevel()));
             obj.GetActualProperty().SetFireERD(Operate_Type.OT_Relative, info.GetAddFireErd(aFireERD, obj.GetLevel()));
             obj.GetActualProperty().SetIceDamage(Operate_Type.OT_Relative, info.GetAddIceDam(aIceDamage, obj.GetLevel()));
             obj.GetActualProperty().SetIceERD(Operate_Type.OT_Relative, info.GetAddIceErd(aIceERD, obj.GetLevel()));
             obj.GetActualProperty().SetPoisonDamage(Operate_Type.OT_Relative, info.GetAddPoisonDam(aPoisonDamage, obj.GetLevel()));
             obj.GetActualProperty().SetPoisonERD(Operate_Type.OT_Relative, info.GetAddPoisonErd(aPoisonERD, obj.GetLevel()));
             obj.GetActualProperty().SetWeight(Operate_Type.OT_Relative, info.GetAddWeight(aWeight, obj.GetLevel()));
             obj.GetActualProperty().SetRps(Operate_Type.OT_Relative, info.GetAddRps(aRps, obj.GetLevel()));
             obj.GetActualProperty().SetAttackRange(Operate_Type.OT_Relative, info.GetAddAttackRange(aAttackRange, obj.GetLevel()));
             info.Level += 1;
         }
     }
 }
 public static void RefixAttrByEquipment(CharacterInfo obj)
 {
     //计算装备影响
     for (int index = 0; index < EquipmentInfo.c_MaxEquipmentNum; ++index)
     {
         ItemDataInfo info = obj.GetEquipmentStateInfo().EquipmentInfo.Armor[index];
         if (null != info)
         {
             float aMoveSpeed          = obj.GetActualProperty().MoveSpeed;
             int   aHpMax              = obj.GetActualProperty().HpMax;
             int   aEnergyMax          = obj.GetActualProperty().EnergyMax;
             float aHpRecover          = obj.GetActualProperty().HpRecover;
             float aEnergyRecover      = obj.GetActualProperty().EnergyRecover;
             int   aAttackBase         = obj.GetActualProperty().AttackBase;
             int   aADefenceBase       = obj.GetActualProperty().ADefenceBase;
             int   aMDefenceBase       = obj.GetActualProperty().MDefenceBase;
             float aCritical           = obj.GetActualProperty().Critical;
             float aCriticalPow        = obj.GetActualProperty().CriticalPow;
             float aCriticalBackHitPow = obj.GetActualProperty().CriticalBackHitPow;
             float aCriticalCrackPow   = obj.GetActualProperty().CriticalCrackPow;
             float aFireDamage         = obj.GetActualProperty().FireDamage;
             float aFireERD            = obj.GetActualProperty().FireERD;
             float aIceDamage          = obj.GetActualProperty().IceDamage;
             float aIceERD             = obj.GetActualProperty().IceERD;
             float aPoisonDamage       = obj.GetActualProperty().PoisonDamage;
             float aPoisonERD          = obj.GetActualProperty().PoisonERD;
             float aWeight             = obj.GetActualProperty().Weight;
             float aRps         = obj.GetActualProperty().Rps;
             float aAttackRange = obj.GetActualProperty().AttackRange;
             obj.GetActualProperty().SetMoveSpeed(Operate_Type.OT_Relative, info.GetAddSpd(aMoveSpeed, obj.GetLevel()));
             obj.GetActualProperty().SetHpMax(Operate_Type.OT_Relative, (int)info.GetAddHpMax(aHpMax, obj.GetLevel()));
             obj.GetActualProperty().SetEnergyMax(Operate_Type.OT_Relative, (int)info.GetAddEpMax(aEnergyMax, obj.GetLevel()));
             obj.GetActualProperty().SetHpRecover(Operate_Type.OT_Relative, info.GetAddHpRecover(aHpRecover, obj.GetLevel()));
             obj.GetActualProperty().SetEnergyRecover(Operate_Type.OT_Relative, info.GetAddEpRecover(aEnergyRecover, obj.GetLevel()));
             obj.GetActualProperty().SetAttackBase(Operate_Type.OT_Relative, (int)info.GetAddAd(aAttackBase, obj.GetLevel()));
             obj.GetActualProperty().SetADefenceBase(Operate_Type.OT_Relative, (int)info.GetAddADp(aADefenceBase, obj.GetLevel()));
             obj.GetActualProperty().SetMDefenceBase(Operate_Type.OT_Relative, (int)info.GetAddMDp(aMDefenceBase, obj.GetLevel()));
             obj.GetActualProperty().SetCritical(Operate_Type.OT_Relative, info.GetAddCri(aCritical, obj.GetLevel()));
             obj.GetActualProperty().SetCriticalPow(Operate_Type.OT_Relative, info.GetAddPow(aCriticalPow, obj.GetLevel()));
             obj.GetActualProperty().SetCriticalBackHitPow(Operate_Type.OT_Relative, info.GetAddBackHitPow(aCriticalBackHitPow, obj.GetLevel()));
             obj.GetActualProperty().SetCriticalCrackPow(Operate_Type.OT_Relative, info.GetAddCrackPow(aCriticalCrackPow, obj.GetLevel()));
             obj.GetActualProperty().SetFireDamage(Operate_Type.OT_Relative, info.GetAddFireDam(aFireDamage, obj.GetLevel()));
             obj.GetActualProperty().SetFireERD(Operate_Type.OT_Relative, info.GetAddFireErd(aFireERD, obj.GetLevel()));
             obj.GetActualProperty().SetIceDamage(Operate_Type.OT_Relative, info.GetAddIceDam(aIceDamage, obj.GetLevel()));
             obj.GetActualProperty().SetIceERD(Operate_Type.OT_Relative, info.GetAddIceErd(aIceERD, obj.GetLevel()));
             obj.GetActualProperty().SetPoisonDamage(Operate_Type.OT_Relative, info.GetAddPoisonDam(aPoisonDamage, obj.GetLevel()));
             obj.GetActualProperty().SetPoisonERD(Operate_Type.OT_Relative, info.GetAddPoisonErd(aPoisonERD, obj.GetLevel()));
             obj.GetActualProperty().SetWeight(Operate_Type.OT_Relative, info.GetAddWeight(aWeight, obj.GetLevel()));
             obj.GetActualProperty().SetRps(Operate_Type.OT_Relative, info.GetAddRps(aRps, obj.GetLevel()));
             obj.GetActualProperty().SetAttackRange(Operate_Type.OT_Relative, info.GetAddAttackRange(aAttackRange, obj.GetLevel()));
         }
     }
 }
Exemplo n.º 7
0
 public void SetEquip(int pos, ItemDataInfo info)
 {
     if (null != m_Equips && m_Equips.Length > 0)
     {
         for (int i = 0; i < m_Equips.Length; i++)
         {
             if (i == pos)
             {
                 m_Equips[i] = info;
                 break;
             }
         }
     }
 }
Exemplo n.º 8
0
        public ItemDataInfo GetLegacyData(int index)
        {
            ItemDataInfo info = null;

            for (int i = 0; i < m_Legacys.Length; i++)
            {
                if (i == index)
                {
                    info = m_Legacys[i];
                    break;
                }
            }
            return(info);
        }
Exemplo n.º 9
0
 public void SetLegacy(int pos, ItemDataInfo info)
 {
     if (null != m_Legacys && m_Legacys.Length > 0)
     {
         for (int i = 0; i < m_Legacys.Length; i++)
         {
             if (i == pos)
             {
                 m_Legacys[i] = info;
                 break;
             }
         }
     }
 }
Exemplo n.º 10
0
 private void RoleDead()
 {
     try
     {
         isRun = true;
         UIManager.Instance.ShowWindowByName("CombatFalse");
         ArkCrossEngine.RoleInfo roleInfo = ArkCrossEngine.LobbyClient.Instance.CurrentRole;
         if (null != roleInfo)
         {
             int reliveStoneId                = ArkCrossEngine.ItemConfigProvider.Instance.GetReliveStoneId();
             int reliveStoneCount             = 0;
             ArkCrossEngine.ItemDataInfo item = roleInfo.GetItemData(reliveStoneId, 0);
             if (null != item)
             {
                 reliveStoneCount = item.ItemNum;
             }
             if (reliveStoneCount <= 0)
             {
                 // 钻石复活
                 SetDiamondActive(true);
                 SetReliveStoneActive(false);
             }
             else
             {
                 // 复活石复活
                 SetDiamondActive(false);
                 SetReliveStoneActive(true);
             }
             UnityEngine.Transform tf = transform.Find("FightBack/shiNum");
             if (null != tf)
             {
                 UILabel reliveStoneLabel = tf.gameObject.GetComponent <UILabel>();
                 if (null != reliveStoneLabel)
                 {
                     reliveStoneLabel.text = reliveStoneCount.ToString();
                 }
             }
             UILabel costStoneLabel = m_ReliveStoneNum.GetComponent <UILabel>();
             if (costStoneLabel != null)
             {
                 costStoneLabel.text = "1";
             }
         }
     }
     catch (Exception ex)
     {
         ArkCrossEngine.LogicSystem.LogFromGfx("[Error]:Exception:{0}\n{1}", ex.Message, ex.StackTrace);
     }
 }
Exemplo n.º 11
0
        public ItemDataInfo EquipTalent(EquipSlot slot, ItemDataInfo item)
        {
            TalentCard card = null;

            if (item != null && item.ItemConfig != null)
            {
                //LogSystem.Error("-----talent: equip {0} itemid={1}", slot, item.ItemId);
                card = new TalentCard((TalentType)item.ItemConfig.m_TalentType);
                card.Init(item);
            }
            TalentCard old_card = EquipTalent(slot, card);

            if (old_card != null)
            {
                return(old_card.Item);
            }
            return(null);
        }
Exemplo n.º 12
0
        public virtual void Init(ItemDataInfo item)
        {
            m_Item = item;
            List <int> item_talent_attributes = item.ItemConfig.m_TalentAttributes;

            for (int i = 0; i < (int)TalentPhase.kMax; i++)
            {
                if (item_talent_attributes.Count > i)
                {
                    int attribute_id           = item_talent_attributes[i];
                    ItemAttributeConfig config = ItemAttributeConfigProvider.Instance.GetDataById(attribute_id);
                    if (config != null)
                    {
                        m_TalentAttributes[i] = AttributeCreator.Instance.Create((AttributeId)config.AttributeType);
                        if (m_TalentAttributes[i] == null)
                        {
                            continue;
                        }
                        try
                        {
                            m_TalentAttributes[i].Init(config.ParamValues, config.LevelAddValues);
                        }
                        catch (Exception ex)
                        {
                            LogSystem.Error("----talent attribut {0} init error!\n {1}\n{2}", config.AttributeType, ex.Message, ex.StackTrace);
                        }
                        m_TalentAttributes[i].UpdateToLevel(item.Level);
                    }
                    foreach (int active_id in item.ItemConfig.m_ActiveAttributes)
                    {
                        if (attribute_id == active_id)
                        {
                            m_TalentAttributes[i].IsActive = true;
                            break;
                        }
                    }
                }
                else
                {
                    LogSystem.Warn("TalentCard have no {0} attribute", (AttributeId)i);
                }
            }
        }
Exemplo n.º 13
0
        internal void UpdateEquipment(ItemDataInfo equip, bool bUpdateSuit = true)
        {
            if (equip == null || equip.ItemConfig == null)
            {
                return;
            }

            string wear_node_and_name = equip.ItemConfig.m_WearNodeAndName;
            string new_equip          = equip.ItemConfig.m_Model;

            GfxSystem.ChangeEquip(Actor, wear_node_and_name, new_equip);

            ItemConfig currentItem = m_User.GetEquipmentStateInfo().EquipmentInfo.Armor[equip.ItemConfig.m_WearParts].ItemConfig;

            // new item has display model or origal item has display model
            if (IsItemSuitNeedRefresh(equip.ItemConfig) ||
                (currentItem != null && IsItemSuitNeedRefresh(currentItem)))
            {
                UpdateSuit();
            }
        }
Exemplo n.º 14
0
        internal void UpdateSuit()
        {
            var    playerConfig   = PlayerConfigProvider.Instance.GetPlayerConfigById(m_User.GetLinkId());
            string playerSkeleton = playerConfig.m_Skeleton;

            if (string.IsNullOrEmpty(playerSkeleton))
            {
                return;
            }

            //string playerModel = playerConfig.m_Model;
            List <string> skinnedModels = new List <string>();

            for (int i = 0; i < EquipmentInfo.c_MaxEquipmentNum; i++)
            {
                ItemDataInfo equip        = m_User.GetEquipmentStateInfo().GetEquipmentData(i);
                string       defaultEquip = playerConfig.GetDefaultModelFromEquipPart((EquipmentType)i);
                if (equip != null &&
                    equip.ItemConfig.m_SkeletonSource != null &&
                    equip.ItemConfig.m_SkeletonSource == playerSkeleton)
                {
                    skinnedModels.Add(equip.ItemConfig.m_Model);
                }
                else if (!string.IsNullOrEmpty(defaultEquip))
                {
                    skinnedModels.Add(defaultEquip);
                }
            }

            /*
             * if (skinnedModels.Count == 0)
             * {
             *  return;
             * }
             */

            //skinnedModels.Add(playerModel);

            GfxSystem.ChangeSuit(Actor, playerSkeleton, skinnedModels);
        }
Exemplo n.º 15
0
        public void RefreshItemSkills(SendImpactToSelfDelegation sendImpactToSelf, StopMyImpactDelegation stopImpact)
        {
            //标记所有物品带的技能与buff
            for (int i = 0; i < GetSkillStateInfo().GetAllSkill().Count; i++)
            {
                if (GetSkillStateInfo().GetAllSkill()[i].IsItemSkill)
                {
                    GetSkillStateInfo().GetAllSkill()[i].IsMarkToRemove = true;
                }
            }
            for (int i = 0; i < GetSkillStateInfo().GetAllImpact().Count; i++)
            {
                if (GetSkillStateInfo().GetAllImpact()[i].m_IsItemImpact)
                {
                    GetSkillStateInfo().GetAllImpact()[i].m_IsMarkToRemove = true;
                }
            }

            /*
             * foreach (SkillInfo info in GetSkillStateInfo().GetAllSkill()) {
             * if (info.IsItemSkill) {
             *  info.IsMarkToRemove = true;
             * }
             * }
             * foreach (ImpactInfo info in GetSkillStateInfo().GetAllImpact()) {
             * if (info.m_IsItemImpact) {
             *  info.m_IsMarkToRemove = true;
             * }
             * }*/
            //刷新物品带的技能与buff
            EquipmentStateInfo equipInfo = GetEquipmentStateInfo();

            for (int ix = 0; ix < EquipmentStateInfo.c_EquipmentCapacity; ++ix)
            {
                ItemDataInfo itemInfo = equipInfo.GetEquipmentData(ix);
                if (null != itemInfo && itemInfo.ItemNum == 1 && null != itemInfo.ItemConfig)
                {
                    ItemConfig cfg = itemInfo.ItemConfig;
                    if (null != cfg.m_AddSkillOnEquiping)
                    {
                        for (int i = 0; i < cfg.m_AddSkillOnEquiping.Length; i++)
                        {
                            SkillInfo skillInfo = GetSkillStateInfo().GetSkillInfoById(cfg.m_AddSkillOnEquiping[i]);
                            if (null == skillInfo)
                            {
                                skillInfo                = new SkillInfo(cfg.m_AddSkillOnEquiping[i]);
                                skillInfo.IsItemSkill    = true;
                                skillInfo.IsMarkToRemove = false;
                                GetSkillStateInfo().AddSkill(skillInfo);
                            }
                            else
                            {
                                skillInfo.IsMarkToRemove = false;
                            }
                        }

                        /*
                         * foreach (int id in cfg.m_AddSkillOnEquiping) {
                         * SkillInfo skillInfo = GetSkillStateInfo().GetSkillInfoById(id);
                         * if (null == skillInfo) {
                         *  skillInfo = new SkillInfo(id);
                         *  skillInfo.IsItemSkill = true;
                         *  skillInfo.IsMarkToRemove = false;
                         *  GetSkillStateInfo().AddSkill(skillInfo);
                         * } else {
                         *  skillInfo.IsMarkToRemove = false;
                         * }
                         * }*/
                    }
                    if (null != cfg.m_AddBuffOnEquiping && null != sendImpactToSelf)
                    {
                        //此分支为服务器端处理,参数为加impact的回调,这个回调里包括加impact并发消息给客户端(现在ImpactSystem是这样实现的)
                        for (int i = 0; i < cfg.m_AddBuffOnEquiping.Length; i++)
                        {
                            ImpactInfo impactInfo = GetSkillStateInfo().GetImpactInfoById(cfg.m_AddBuffOnEquiping[i]);
                            if (null == impactInfo)
                            {
                                impactInfo = sendImpactToSelf(cfg.m_AddBuffOnEquiping[i]);
                                if (null != impactInfo)
                                {
                                    impactInfo.m_IsItemImpact   = true;
                                    impactInfo.m_IsMarkToRemove = false;
                                }
                            }
                            else
                            {
                                impactInfo.m_IsMarkToRemove = false;
                            }
                        }

                        /*
                         * foreach (int id in cfg.m_AddBuffOnEquiping) {
                         * ImpactInfo impactInfo = GetSkillStateInfo().GetImpactInfoById(id);
                         * if (null == impactInfo) {
                         *  impactInfo = sendImpactToSelf(id);
                         *  if (null != impactInfo) {
                         *    impactInfo.m_IsItemImpact = true;
                         *    impactInfo.m_IsMarkToRemove = false;
                         *  }
                         * } else {
                         *  impactInfo.m_IsMarkToRemove = false;
                         * }
                         * }*/
                    }
                }
            }
            //移除不再有效的技能与buff
            List <int> removeSkills = new List <int>();

            for (int i = 0; i < GetSkillStateInfo().GetAllSkill().Count; i++)
            {
                if (GetSkillStateInfo().GetAllSkill()[i].IsItemSkill && GetSkillStateInfo().GetAllSkill()[i].IsMarkToRemove)
                {
                    removeSkills.Add(GetSkillStateInfo().GetAllSkill()[i].SkillId);
                }
            }
            for (int i = 0; i < removeSkills.Count; i++)
            {
                GetSkillStateInfo().RemoveSkill(removeSkills[i]);
            }

            /*
             * foreach (SkillInfo info in GetSkillStateInfo().GetAllSkill()) {
             * if (info.IsItemSkill && info.IsMarkToRemove) {
             *  removeSkills.Add(info.SkillId);
             * }
             * }
             * foreach (int id in removeSkills) {
             * GetSkillStateInfo().RemoveSkill(id);
             * }*/
            removeSkills.Clear();

            List <int> removeImpacts = new List <int>();

            for (int i = 0; i < GetSkillStateInfo().GetAllImpact().Count; i++)
            {
                if (GetSkillStateInfo().GetAllImpact()[i].m_IsItemImpact && GetSkillStateInfo().GetAllImpact()[i].m_IsMarkToRemove)
                {
                    removeImpacts.Add(GetSkillStateInfo().GetAllImpact()[i].m_ImpactId);
                }
            }
            for (int i = 0; i < removeImpacts.Count; i++)
            {
                if (null != stopImpact)
                {
                    stopImpact(removeImpacts[i]);
                }
            }

            /*
             * foreach (ImpactInfo info in GetSkillStateInfo().GetAllImpact()) {
             * if (info.m_IsItemImpact && info.m_IsMarkToRemove) {
             *  removeImpacts.Add(info.m_ImpactId);
             * }
             * }
             * foreach (int id in removeImpacts) {
             * if (null != stopImpact)
             *  stopImpact(id);
             * }*/
            removeImpacts.Clear();
        }
Exemplo n.º 16
0
 public XSoulPartInfo(XSoulPart part, ItemDataInfo item)
 {
     m_Part          = part;
     m_XSoulPartItem = item;
 }
Exemplo n.º 17
0
        private UserInfo CreateArenaTarget(ArenaTargetInfo target)
        {
            if (target == null)
            {
                return(null);
            }
            int      image_res_id = target.HeroId;
            UserInfo image_player = m_UserMgr.AddUser(image_res_id);

            if (null != image_player)
            {
                image_player.SceneContext = m_SceneContext;
                int campid = NetworkSystem.Instance.CampId == (int)CampIdEnum.Blue ? (int)CampIdEnum.Red : (int)CampIdEnum.Blue;
                image_player.SetCampId(campid);
                Data_Unit unit = m_CurScene.StaticData.ExtractData(DataMap_Type.DT_Unit, GlobalVariables.GetUnitIdByCampId(campid)) as Data_Unit;
                if (null != unit)
                {
                    image_player.GetAiStateInfo().AiLogic = unit.m_AiLogic;
                    image_player.SetAIEnable(true);
                    image_player.GetMovementStateInfo().SetPosition(unit.m_Pos);
                    image_player.GetMovementStateInfo().SetFaceDir(unit.m_RotAngle);
                }
                image_player.SetLevel(target.Level);
                image_player.SetNickName(target.Nickname);
                image_player.SkillController = new SwordManSkillController(image_player, GfxModule.Skill.GfxSkillSystem.Instance);
                if (null != m_SpatialSystem)
                {
                    m_SpatialSystem.AddObj(image_player.SpaceObject);
                }
                /// skills
                if (null != target.Skills)
                {
                    image_player.GetSkillStateInfo().RemoveAllSkill();
                    int skill_ct = target.Skills.Count;
                    for (int i = 0; i < skill_ct; i++)
                    {
                        SkillInfo info = target.Skills[i];
                        if (null != info)
                        {
                            SkillCategory cur_skill_pos = SkillCategory.kNone;
                            if (info.Postions.Presets[0] == SlotPosition.SP_A)
                            {
                                cur_skill_pos = SkillCategory.kSkillA;
                            }
                            else if (info.Postions.Presets[0] == SlotPosition.SP_B)
                            {
                                cur_skill_pos = SkillCategory.kSkillB;
                            }
                            else if (info.Postions.Presets[0] == SlotPosition.SP_C)
                            {
                                cur_skill_pos = SkillCategory.kSkillC;
                            }
                            else if (info.Postions.Presets[0] == SlotPosition.SP_D)
                            {
                                cur_skill_pos = SkillCategory.kSkillD;
                            }
                            info.Category = cur_skill_pos;
                            image_player.GetSkillStateInfo().AddSkill(info);
                            WorldSystem.Instance.AddSubSkill(image_player, info.SkillId, cur_skill_pos, info.SkillLevel);
                        }
                    }
                }
                Data_PlayerConfig playerData = PlayerConfigProvider.Instance.GetPlayerConfigById(image_player.GetLinkId());
                if (null != playerData && null != playerData.m_FixedSkillList &&
                    playerData.m_FixedSkillList.Count > 0)
                {
                    foreach (int skill_id in playerData.m_FixedSkillList)
                    {
                        SkillInfo info = new SkillInfo(skill_id, 1);
                        image_player.GetSkillStateInfo().AddSkill(info);
                    }
                }
                image_player.ResetSkill();
                /// equips
                if (null != target.Equips)
                {
                    int equip_ct = target.Equips.Length;
                    for (int i = 0; i < equip_ct; i++)
                    {
                        ItemDataInfo image_equip = target.Equips[i];
                        if (null != image_equip)
                        {
                            image_player.GetEquipmentStateInfo().ResetEquipmentData(i);
                            image_equip.ItemConfig = ItemConfigProvider.Instance.GetDataById(image_equip.ItemId);
                            if (null != image_equip.ItemConfig)
                            {
                                image_player.GetEquipmentStateInfo().SetEquipmentData(i, image_equip);
                            }
                        }
                    }
                }
                ///
                if (null != target.Legacys)
                {
                    int legacy_ct = target.Legacys.Length;
                    for (int i = 0; i < legacy_ct; i++)
                    {
                        ItemDataInfo image_legacy = target.Legacys[i];
                        if (null != image_legacy && image_legacy.IsUnlock)
                        {
                            image_player.GetLegacyStateInfo().ResetLegacyData(i);
                            image_legacy.ItemConfig = ItemConfigProvider.Instance.GetDataById(image_legacy.ItemId);
                            if (null != image_legacy.ItemConfig)
                            {
                                image_player.GetLegacyStateInfo().SetLegacyData(i, image_legacy);
                            }
                        }
                    }
                    image_player.GetLegacyStateInfo().UpdateLegacyComplexAttr();
                }
                foreach (ArenaXSoulInfo x in target.XSoulInfo)
                {
                    ItemDataInfo item = new ItemDataInfo();
                    item.ItemId     = x.ItemId;
                    item.Level      = x.Level;
                    item.Experience = x.Experience;
                    item.UpdateLevelByExperience();
                    ItemConfig config = ItemConfigProvider.Instance.GetDataById(item.ItemId);
                    if (config == null)
                    {
                        continue;
                    }
                    item.ItemConfig = config;
                    XSoulPartInfo part = new XSoulPartInfo((XSoulPart)config.m_WearParts, item);
                    part.ShowModelLevel = x.ModelLevel;
                    image_player.GetXSoulInfo().SetXSoulPartData((XSoulPart)config.m_WearParts, part);
                }
                image_player.SetPartnerInfo(target.ActivePartner);
                SetArenaCharacterCoefficient(image_player);
                UserAttrCalculator.Calc(image_player);
                image_player.SetHp(Operate_Type.OT_Absolute, image_player.GetActualProperty().HpMax);
                image_player.SetRage(Operate_Type.OT_Absolute, 0);
                image_player.SetEnergy(Operate_Type.OT_Absolute, image_player.GetActualProperty().EnergyMax);

                target.CreatedPartners.Clear();
                int total_hp = image_player.GetActualProperty().HpMax;
                //LogSystem.Error("---challenge target hp=" + image_player.GetActualProperty().HpMax);
                foreach (PartnerInfo partner in target.FightPartners)
                {
                    NpcInfo partner_npc = CreateParterner(image_player, partner);
                    if (partner_npc != null)
                    {
                        target.CreatedPartners.Add(partner.Id, partner_npc);
                        //LogSystem.Error("---parnter {0} hp={1}", partner.Id, partner_npc.GetBaseProperty().HpMax);
                        total_hp += partner_npc.GetBaseProperty().HpMax;
                    }
                }
                //LogSystem.Error("-----challenge target total hp=" + total_hp);
                EntityManager.Instance.CreateUserView(image_player.GetId());
                UserView image_view = EntityManager.Instance.GetUserViewById(image_player.GetId());
                image_view.UpdateEquipment();
                image_view.UpdateXSoulEquip();
            }
            SyncGfxUserInfo(image_player.GetId());
            return(image_player);
        }