Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions src/game/guess/guessStart.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,18 @@ def refresh_time():
if level == '初级':
res = cropper.expand(int(cropper.image.size[0] * 0.2))
if res:
await data.send(reply.text(text))
await data.send(
Chain(answer, at=False).text('图片再放大一点了哦~').image(cropper.crop(check_transparent=False))
)
reply.text(text).text('\n图片再放大一点了哦~').image(cropper.crop(check_transparent=False))
await data.send(reply)
result.set_rate(answer.user_id, -2)
else:
await data.send(reply.text('不能继续放大了 >.<'))
if tips:
reply.text(text).text('\n').text(random_pop(tips))
if not tips:
reply.text('\n提示用完啦!请注意,下一次就是终极提示了,博士,请加油哦!')
await data.send(reply)
result.set_rate(answer.user_id, -2)
else:
await data.send(reply.text('不能继续放大了 >.<'))
else:
if tips or not final_tips:
if tips:
Expand Down
14 changes: 11 additions & 3 deletions src/game/guess/main.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from core import AmiyaBotPluginInstance, Requirement
from core import AmiyaBotPluginInstance, Requirement
from core.util import TimeRecorder
from core.database.user import UserInfo

from .guessStart import *

bot = AmiyaBotPluginInstance(
name='兔兔猜干员',
version='3.4',
version='3.5',
plugin_id='amiyabot-game-guess',
plugin_type='official',
description='干员竞猜小游戏,可获得合成玉',
Expand Down Expand Up @@ -57,7 +57,13 @@ async def _(data: Message):
],
keyboard=keyboard,
)
event = await data.wait_channel(choice_chain, force=True)
# 只接受发起游戏的同一用户发送的难度选择,避免被其他用户的消息打断
owner_id = data.user_id

async def level_filter(msg: Message):
return msg.user_id == owner_id

event = await data.wait_channel(choice_chain, force=True, data_filter=level_filter)
if not event:
return None

Expand Down Expand Up @@ -86,6 +92,8 @@ async def _(data: Message):

if '预备干员' in operator.name:
continue
if '盟约' in operator.name:
continue

if curr != referee.round:
curr = referee.round
Expand Down