提交 8cb7d52c 编辑于 作者: ice-b-114's avatar ice-b-114
浏览文件

fix some gacha problems

上级 6b2a17e4
...@@ -171,10 +171,11 @@ class Gacha: ...@@ -171,10 +171,11 @@ class Gacha:
day_times = 0 day_times = 0
reply = "" reply = ""
result = "" result = ""
flag = False flag_fully_30_times = True
for i in range(1, 31): for i in range(1, 31):
if day_limit != 0 and day_times >= day_limit: if day_limit != 0 and day_times >= day_limit:
reply += "{}抽到第{}发十连时已经达到今日抽卡上限,抽卡结果:".format(nickname, i) reply += "{}抽到第{}发十连时已经达到今日抽卡上限,抽卡结果:".format(nickname, i)
flag_fully_30_times = False
break break
single_result = self.result() single_result = self.result()
times += 1 times += 1
...@@ -184,12 +185,10 @@ class Gacha: ...@@ -184,12 +185,10 @@ class Gacha:
info[char] += 1 info[char] += 1
if self.check_ssr(char): if self.check_ssr(char):
result += "\n{}({})".format(char, info[char]) result += "\n{}({})".format(char, info[char])
flag = True
else: else:
info[char] = 1 info[char] = 1
if self.check_ssr(char): if self.check_ssr(char):
result += "\n{}(new)".format(char) result += "\n{}(new)".format(char)
flag = True
sql_info = pickle.dumps(info) sql_info = pickle.dumps(info)
if mem_exists: if mem_exists:
db.execute("UPDATE Colle SET colle=?, times=?, last_day=?, day_times=? WHERE qqid=?", db.execute("UPDATE Colle SET colle=?, times=?, last_day=?, day_times=? WHERE qqid=?",
...@@ -198,9 +197,12 @@ class Gacha: ...@@ -198,9 +197,12 @@ class Gacha:
db.execute("INSERT INTO Colle (qqid,colle,times,last_day,day_times) VALUES(?,?,?,?,?)", db.execute("INSERT INTO Colle (qqid,colle,times,last_day,day_times) VALUES(?,?,?,?,?)",
(qqid, sql_info, times, last_day, day_times)) (qqid, sql_info, times, last_day, day_times))
if not result: if not result:
reply = "{}太非了,本次下井没有抽到ssr。".format(nickname) if flag_fully_30_times:
reply += "\n{}太非了,本次下井没有抽到ssr。".format(nickname)
else:
reply += "\n本次没有抽到ssr。".format(nickname)
return reply return reply
if flag: if flag_fully_30_times:
reply += "{}本次下井结果:".format(nickname) reply += "{}本次下井结果:".format(nickname)
reply += result reply += result
db_conn.commit() db_conn.commit()
......
支持 Markdown
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册