This commit is contained in:
@ -158,14 +158,16 @@ class IdiomGame:
|
|||||||
跳过当前成语,选择下一个成语
|
跳过当前成语,选择下一个成语
|
||||||
"""
|
"""
|
||||||
await self.lock.acquire()
|
await self.lock.acquire()
|
||||||
self._skip_idiom_async(buff_score)
|
self._skip_idiom_async()
|
||||||
|
self.add_buff_score(buff_score)
|
||||||
self.lock.release()
|
self.lock.release()
|
||||||
return self.last_idiom
|
return self.last_idiom
|
||||||
|
|
||||||
def _skip_idiom_async(self, buff_score: int = -100) -> str:
|
def _skip_idiom_async(self) -> str:
|
||||||
self.last_idiom = secrets.choice(IdiomGame.ALL_IDIOMS)
|
self.last_idiom = secrets.choice(IdiomGame.ALL_IDIOMS)
|
||||||
self.last_char = self.last_idiom[-1]
|
self.last_char = self.last_idiom[-1]
|
||||||
self.add_buff_score(buff_score)
|
if not self.is_nextable(self.last_char):
|
||||||
|
self._skip_idiom_async()
|
||||||
return self.last_idiom
|
return self.last_idiom
|
||||||
|
|
||||||
async def try_verify_idiom(self, idiom: str, user_id: str) -> TryVerifyState:
|
async def try_verify_idiom(self, idiom: str, user_id: str) -> TryVerifyState:
|
||||||
|
|||||||
Reference in New Issue
Block a user