Esempio n. 1
0
        public static int getAttack(List <PropsInfo> sort, int index)
        {
            Debug.LogError(string.Format("getAttack, Index: {0}", 1));
            Props iItem = sort[index].Item;

            Debug.LogError(string.Format("getAttack, iItem: {0}", iItem));
            int attack = 0;

            if (iItem.PropsEffect != null)
            {
                for (int i = 0; i < iItem.PropsEffect.Count; i++)
                {
                    PropsEffect propsEffect = iItem.PropsEffect[i];
                    Debug.LogError(string.Format("getAttack, propsEffect: {0}", propsEffect));
                    if (propsEffect is PropsBattleProperty)
                    {
                        PropsBattleProperty propsBattleProperty = propsEffect as PropsBattleProperty;
                        Debug.LogError(string.Format("getAttack, propsBattleProperty: {0}", propsBattleProperty));
                        if (propsBattleProperty.Property == CharacterProperty.Attack || propsBattleProperty.Property == CharacterProperty.Defense)
                        {
                            Debug.LogError(string.Format("getAttack, propsBattleProperty.Property: {0}", propsBattleProperty.Property));
                            attack = propsBattleProperty.Value;
                            break;
                        }
                    }
                }
            }
            Debug.LogError(string.Format("getAttack, attack: {0}", attack));
            return(attack);
        }
Esempio n. 2
0
        public static bool GiftInvertoryPatch_propsFilterAndSort(ref CtrlGiftInvertoryWindow __instance, ref InventoryWindowInfo inventoryWindowInfo)
        {
            if (giftFilter.Value)
            {
                List <PropsInfo> sort    = inventoryWindowInfo.Sort;
                CharacterMapping mapping = inventoryWindowInfo.Mapping;

                List <PropsInfo> canAddExpGiftlist = new List <PropsInfo>();
                for (int index = 0; index < sort.Count; index++)
                {
                    Props item = sort[index].Item;

                    if (item.PropsEffect != null)
                    {
                        for (int i = 0; i < item.PropsEffect.Count; i++)
                        {
                            PropsEffect propsEffect = item.PropsEffect[i];
                            if (propsEffect is PropsFavorable)
                            {
                                PropsFavorable propsFavorable = propsEffect as PropsFavorable;
                                if (mapping != null && mapping.InfoId != null && !mapping.InfoId.Equals(string.Empty))
                                {
                                    if (propsFavorable.Npcid == mapping.InfoId)
                                    {
                                        canAddExpGiftlist.Add(sort[index]);
                                        break;
                                    }
                                }
                            }
                        }
                    }
                }
                sort.Clear();
                sort.AddRange(canAddExpGiftlist.ToArray());
                canAddExpGiftlist.Clear();

                GiftSortByCategory(sort, mapping.Id);
                GiftSortByNumber(sort, mapping.Id);
            }
            return(true);
        }
Esempio n. 3
0
        public static int getFavExp(List <PropsInfo> sort, string mappingId, int index)
        {
            Props iItem  = sort[index].Item;
            int   favExp = 0;

            for (int i = 0; i < iItem.PropsEffect.Count; i++)
            {
                PropsEffect propsEffect = iItem.PropsEffect[i];
                if (propsEffect is PropsFavorable)
                {
                    PropsFavorable propsFavorable = propsEffect as PropsFavorable;
                    if (mappingId != null && !mappingId.Equals(string.Empty))
                    {
                        if (propsFavorable.Npcid == mappingId)
                        {
                            return(propsFavorable.Value);
                        }
                    }
                }
            }
            return(favExp);
        }