Example #1
0
        static bool CheckSingleCondition(SellingCondition condition, Shop atShop)
        {
            switch (condition)
            {
            case SellingCondition.SkillLevel_2: return(GetCorrespondingSkillLevel(atShop) >= 2);

            case SellingCondition.SkillLevel_4: return(GetCorrespondingSkillLevel(atShop) >= 4);

            case SellingCondition.SkillLevel_6: return(GetCorrespondingSkillLevel(atShop) >= 6);

            case SellingCondition.SkillLevel_8: return(GetCorrespondingSkillLevel(atShop) >= 8);

            case SellingCondition.SkillLevel_10: return(GetCorrespondingSkillLevel(atShop) >= 10);

            case SellingCondition.FriendshipHearts_2: return(GetCorrespondingFriendshipLevel(atShop) >= 2);

            case SellingCondition.FriendshipHearts_4: return(GetCorrespondingFriendshipLevel(atShop) >= 4);

            case SellingCondition.FriendshipHearts_6: return(GetCorrespondingFriendshipLevel(atShop) >= 6);

            case SellingCondition.FriendshipHearts_8: return(GetCorrespondingFriendshipLevel(atShop) >= 8);

            case SellingCondition.FriendshipHearts_10: return(GetCorrespondingFriendshipLevel(atShop) >= 10);

            default:
                return(false);
            }
        }
 public ExtendItem SoldBy(Shop shop, int price, SellingCondition sellingCondition = SellingCondition.None)
 {
     soldBy                = shop;
     this.price            = price;
     this.sellingCondition = sellingCondition;
     return(this);
 }
 internal ExtItemInfo(string newDescription, bool disableCrafting, IEffect effect, Shop soldBy, int price, SellingCondition sellingCondition)
 {
     NewItemDescription = newDescription;
     IsCraftingDisabled = disableCrafting;
     Effect             = effect;
     SoldBy             = soldBy;
     Price            = price;
     SellingCondition = sellingCondition;
 }
Example #4
0
        public static bool IsFulfilled(this SellingCondition condition, Shop atShop)
        {
            if (condition == SellingCondition.None)
            {
                return(true);
            }

            foreach (SellingCondition sc in Enum.GetValues(typeof(SellingCondition)))
            {
                if (sc != SellingCondition.None && condition.HasFlag(sc))
                {
                    if (!CheckSingleCondition(sc, atShop))
                    {
                        return(false);
                    }
                }
            }

            return(true);
        }