Пример #1
0
        public int CompareTo(object obj)
        {
            CEquipPassiveSkillInfo cEquipPassiveSkillInfo = obj as CEquipPassiveSkillInfo;

            if (this.m_passiveSkillID == cEquipPassiveSkillInfo.m_passiveSkillID && this.m_isEnabled != cEquipPassiveSkillInfo.m_isEnabled)
            {
                return(this.m_isEnabled ? 1 : -1);
            }
            if ((uint)this.m_equipBuyPrice > (uint)cEquipPassiveSkillInfo.m_equipBuyPrice)
            {
                return(1);
            }
            if ((uint)this.m_equipBuyPrice != (uint)cEquipPassiveSkillInfo.m_equipBuyPrice)
            {
                return(-1);
            }
            if (this.m_sequence > cEquipPassiveSkillInfo.m_sequence)
            {
                return(1);
            }
            if (this.m_sequence == cEquipPassiveSkillInfo.m_sequence)
            {
                return(0);
            }
            return(-1);
        }
Пример #2
0
        private void AddEquipPassiveSkill(ushort equipID, uint passiveSkillID, ushort passiveSkillGroupID, uint equipBuyPrice, uint[] passiveSkillRelatedFuncIDs, uint sequence)
        {
            CEquipPassiveSkillInfoGroup group = null;

            if (this.m_equipPassiveSkillInfoMap.ContainsKey(passiveSkillGroupID))
            {
                this.m_equipPassiveSkillInfoMap.TryGetValue(passiveSkillGroupID, out group);
            }
            else
            {
                group = new CEquipPassiveSkillInfoGroup(passiveSkillGroupID);
                this.m_equipPassiveSkillInfoMap.Add(passiveSkillGroupID, group);
            }
            group.m_isChanged = true;
            ListView <CEquipPassiveSkillInfo> equipPassiveSkillInfos = group.m_equipPassiveSkillInfos;
            CEquipPassiveSkillInfo            item = null;

            for (int i = 0; i < equipPassiveSkillInfos.Count; i++)
            {
                if (equipPassiveSkillInfos[i].m_isNeedRemoved && equipPassiveSkillInfos[i].IsEqual(passiveSkillID, passiveSkillGroupID, passiveSkillRelatedFuncIDs))
                {
                    item = equipPassiveSkillInfos[i];
                    item.m_isNeedRemoved = false;
                    item.m_equipID       = equipID;
                    item.m_equipBuyPrice = (CrypticInt32)equipBuyPrice;
                    item.m_sequence      = sequence;
                    break;
                }
            }
            if (item == null)
            {
                item = new CEquipPassiveSkillInfo(equipID, equipBuyPrice, passiveSkillID, passiveSkillGroupID, passiveSkillRelatedFuncIDs, sequence);
                equipPassiveSkillInfos.Add(item);
            }
        }
Пример #3
0
        public int CompareTo(object obj)
        {
            CEquipPassiveSkillInfo info = obj as CEquipPassiveSkillInfo;

            if ((this.m_passiveSkillID == info.m_passiveSkillID) && (this.m_isEnabled != info.m_isEnabled))
            {
                return(!this.m_isEnabled ? -1 : 1);
            }
            if (((uint)this.m_equipBuyPrice) > ((uint)info.m_equipBuyPrice))
            {
                return(1);
            }
            if (((uint)this.m_equipBuyPrice) == ((uint)info.m_equipBuyPrice))
            {
                if (this.m_sequence > info.m_sequence)
                {
                    return(1);
                }
                if (this.m_sequence == info.m_sequence)
                {
                    return(0);
                }
            }
            return(-1);
        }
Пример #4
0
        private void AddEquipPassiveSkill(ushort equipID, uint passiveSkillID, ushort passiveSkillGroupID, uint equipBuyPrice, uint[] passiveSkillRelatedFuncIDs, uint sequence)
        {
            ListView <CEquipPassiveSkillInfo> view = null;

            if (this.m_equipPassiveSkillInfoMap.ContainsKey(passiveSkillGroupID))
            {
                this.m_equipPassiveSkillInfoMap.TryGetValue(passiveSkillGroupID, out view);
            }
            else
            {
                view = new ListView <CEquipPassiveSkillInfo>();
                this.m_equipPassiveSkillInfoMap.Add(passiveSkillGroupID, view);
            }
            CEquipPassiveSkillInfo item = new CEquipPassiveSkillInfo(equipID, equipBuyPrice, passiveSkillID, passiveSkillGroupID, passiveSkillRelatedFuncIDs, sequence);

            view.Add(item);
            if (passiveSkillGroupID == 0)
            {
                this.EnableEquipPassiveSkill(item);
            }
            else
            {
                this.UpdateEquipUniquePassiveSkill(view, true);
            }
        }
Пример #5
0
 private void EnableEquipPassiveSkill(CEquipPassiveSkillInfo equipPassiveSkillInfo)
 {
     if (!equipPassiveSkillInfo.m_isEnabled)
     {
         int cd = 0;
         if (this.RemoveEquipPassiveCd(equipPassiveSkillInfo.m_passiveSkillID, out cd))
         {
             base.actor.SkillControl.talentSystem.InitTalent((int)equipPassiveSkillInfo.m_passiveSkillID, cd);
         }
         else
         {
             base.actor.SkillControl.talentSystem.InitTalent((int)equipPassiveSkillInfo.m_passiveSkillID);
         }
         equipPassiveSkillInfo.m_isEnabled = true;
     }
 }
Пример #6
0
 private void DisableEquipPassiveSkill(CEquipPassiveSkillInfo equipPassiveSkillInfo)
 {
     if (equipPassiveSkillInfo.m_isEnabled)
     {
         int talentCDTime = base.actor.SkillControl.talentSystem.GetTalentCDTime((int)equipPassiveSkillInfo.m_passiveSkillID);
         if (talentCDTime > 0)
         {
             this.AddEquipPassiveCdInfo(equipPassiveSkillInfo.m_passiveSkillID, talentCDTime);
         }
         base.actor.SkillControl.talentSystem.RemoveTalent((int)equipPassiveSkillInfo.m_passiveSkillID);
         if (((base.actor.BuffHolderComp != null) && (equipPassiveSkillInfo.m_passiveSkillRelatedFuncIDs != null)) && (equipPassiveSkillInfo.m_passiveSkillRelatedFuncIDs.Length > 0))
         {
             for (int i = 0; i < equipPassiveSkillInfo.m_passiveSkillRelatedFuncIDs.Length; i++)
             {
                 if (equipPassiveSkillInfo.m_passiveSkillRelatedFuncIDs[i] > 0)
                 {
                     base.actor.BuffHolderComp.RemoveBuff((int)equipPassiveSkillInfo.m_passiveSkillRelatedFuncIDs[i]);
                 }
             }
         }
         equipPassiveSkillInfo.m_isEnabled = false;
     }
 }