Exemplo n.º 1
0
        //一次展示且只展示三个商品,并且为他们标定价格
        static public string Show()
        {
            if (Game.IntRecord.Get("上次访问商店时间") != DateTime.Now.DayOfYear)
            {
                Game.IntRecord.Set("上次访问商店时间", DateTime.Now.DayOfYear);
                PriceLow();
            }
            while (Items.Dic.Count < 3)
            {
                var item = ItemList.ChooseOne();
                //已经包括的,不加入
                if (Items.Contain(item.name))
                {
                    continue;
                }
                Items.Set(item.name, (new Random()).Next(item.priceLow, item.priceHigh + 1));
            }

            string temple = "能买道具的时候要尽量购买!";
            int    times  = 1;

            foreach (var c in Items.Dic)
            {
                temple += $"\n{times}/ {c.Key}, 价格:{c.Value}";
                times++;
            }
            return(temple);
        }