music_quiz: dialog 기반 정답 입력 + 큐 기반 first-submit-wins 추가
정답 입력 UI 를 dialog 로 제공 (mq:dialog/answer), #minecraft:quick_actions 태그 등록으로 빠른행동키에서 바로 열 수 있게 함. 동시 제출 시 먼저 제출한 사람이 정답으로 인정되도록 mq:answer/ 에 submit_seq 기반 FIFO 큐 + 매크로 기반 제출자 lookup 으로 처리. tick/stop/setanswer 도 새 큐 흐름에 맞춰 업데이트.
This commit is contained in:
17
music_quiz/data/mq/function/answer/judge.mcfunction
Normal file
17
music_quiz/data/mq/function/answer/judge.mcfunction
Normal file
@@ -0,0 +1,17 @@
|
||||
# 제출자(@s) 로 실행됨 — answer.title 및 alias 들과 비교
|
||||
# 매치되면 @s answer = 1 → check_answer 가 정답처리 흐름으로 진입
|
||||
# 매치 안되면 @s answer = 2 → check_answer 가 reset 처리 (1회 비교 후 초기화)
|
||||
|
||||
# 1) 제목과 비교
|
||||
data modify storage mq:tmp judge.answer set from storage mq:main answer.title
|
||||
function mq:answer/macro/match with storage mq:tmp judge
|
||||
|
||||
# 2) 제목 매치 실패 시 alias 들과 순차 비교 (조기 종료)
|
||||
execute unless score @s answer matches 1 run data modify storage mq:tmp aliases set from storage mq:main answer.alias
|
||||
execute unless score @s answer matches 1 run function mq:answer/iter_aliases
|
||||
|
||||
# 3) 끝까지 매치 실패면 오답 처리 (check_answer 가 reset)
|
||||
execute unless score @s answer matches 1 run scoreboard players set @s answer 2
|
||||
|
||||
# 4) 처리 완료 — 이 제출자의 submit_seq 정리 (다음 큐 항목과 혼동 방지)
|
||||
scoreboard players reset @s submit_seq
|
||||
Reference in New Issue
Block a user