diff --git a/examples/game/main.py b/examples/game/main.py index 098f6d8e5..8cae0c78b 100644 --- a/examples/game/main.py +++ b/examples/game/main.py @@ -57,6 +57,9 @@ def invited_group_chat( msg = None elif answer == "结束邀请对话": break + else: + send_chat_msg("【系统】请重新选择。") + continue for c in invited_customer: msg = c(msg) send_pretty_msg(msg) @@ -141,7 +144,9 @@ def one_on_one_loop(customers, player): break send_pretty_msg(msg) send_chat_msg( - "【系统】请输入“做菜”启动做菜程序,它会按所选定食材产生菜品。" " (对话轮次过多会使得顾客综合满意度下降。)", + "【系统】请输入“做菜”启动做菜程序,它会按所选定食材产生菜品。 \n" + "【系统】对话轮次过多会使得顾客综合满意度下降。 \n" + "【系统】若不输入任何内容直接按回车键,顾客将离开餐馆。", ) msg = player(msg) if len(msg["content"]) == 0 or "[TERMINATE]" in msg["content"]: @@ -201,6 +206,9 @@ def invite_customers(customers): answer = query_answer(select_customer, "invited") if answer == "END": break + if answer not in select_customer: + send_chat_msg("【系统】请重新选择。") + continue invited_customers.append(answer) available_customers.remove(answer) @@ -312,7 +320,10 @@ def main(args) -> None: for c in customers if c.name not in checkpoint.invited_customers ] - checkpoint.visit_customers = one_on_one_loop(rest_customers, player) + checkpoint.visit_customers = one_on_one_loop( + rest_customers, + player, + ) checkpoint.stage_per_night = StagePerNight.MAKING_INVITATION elif checkpoint.stage_per_night == StagePerNight.MAKING_INVITATION: # ============ making invitation decision ============= diff --git a/examples/game/ruled_user.py b/examples/game/ruled_user.py index 5aae7b8e7..a0647d903 100644 --- a/examples/game/ruled_user.py +++ b/examples/game/ruled_user.py @@ -158,6 +158,7 @@ def cook(self): cook_list.clear() elif sel_ingr not in ingredients_list: send_chat_msg("【系统】不可用食材,请重新选择。") + continue else: cook_list.append(sel_ingr) end_query_answer()