IGachaItem Gacha(int pool, TouhouUser user) { IGachaItem[] result = null; if (pool == 1) { int count = user.CZCount; result = TouhouGacha.Get(pool, ref count); user.CZCount = count; } else if (pool == 2) { int count = user.UpCount; result = TouhouGacha.Get(pool, ref count); user.UpCount = count; } else if (pool == 3) { int count = user.WeaponCount; result = TouhouGacha.Get(pool, ref count); user.WeaponCount = count; } if (user.EcUser.Items.ContainsKey(result[0].Name)) { user.EcUser.Items[result[0].Name].Count++; } else { user.EcUser.Items.Add(result[0].Name, new UserItem() { Item = result[0], Count = 1 }); } return(result[0]); }
static void Main(string[] args) { //var jsonStr=File.ReadAllText("C:\\Users\\Len\\Desktop\\文档\\test.json"); //var groupmember = JsonSerializer.Deserialize<XQMembers>(jsonStr); //Console.WriteLine("over"); //CommandSystem.Execute(new MessageContent() { // Message="#抽签" //}, null); //for(int i = 0; i < 10; i++) //{ // var r = GenshinGacha.GetOne(1); // Console.WriteLine(r.Name +" "+r.Level); //} bool hasup = false; int count = 0; //using (var db = new LiteDatabase(@"./hyper_bot.db")) //{ // var col = db.GetCollection<DB_EcUser>("ecommerce"); // foreach(var item in col.FindAll()) // { // Console.WriteLine(item.Id); // } //} Dictionary <string, string> a = new Dictionary <string, string>(); a.Add("a", "1"); a.Add("b", "2"); int maxPage = a.Keys.Count() / 10; maxPage += a.Keys.Count() % 10 == 0 ? 0 : 1; Console.WriteLine(maxPage); while (true) { Console.WriteLine("======按回车抽10连======"); Console.ReadLine(); foreach (var r in TouhouGacha.Get(2, ref count)) { Console.WriteLine(r.GetSingleName()); } } }
IGachaItem[] Gacha10(int pool, TouhouUser user) { IGachaItem[] result = null; if (pool == 1) { int count = user.CZCount; result = TouhouGacha.Get(pool, ref count); user.CZCount = count; } else if (pool == 2) { int count = user.UpCount; result = TouhouGacha.Get(pool, ref count); user.UpCount = count; } else if (pool == 3) { int count = user.WeaponCount; result = TouhouGacha.Get(pool, ref count); user.WeaponCount = count; } foreach (var item in result) { if (user.EcUser.Items.ContainsKey(item.Name)) { user.EcUser.Items[item.Name].Count++; } else { user.EcUser.Items.Add(item.Name, new UserItem() { Item = item, Count = 1 }); } } return(result); }