Files
Claude (owner) 2b61af28a8 music_quiz: 무대 의존 제거 + 정적 데이터 스토리지화 + 매 틱 게이팅
- 무대 한정 코드 제거: repeat/map/ (트리/조명), images/image_custom (파이브가이즈),
  load.mcfunction의 map 스코어보드·fill·counter 초기화
- 매 틱 디스패치를 init 상태로 게이팅:
  · timer는 init>=2, check_answer는 init in {5,6}에서만 호출
  · idle(init=0) 틱의 함수 호출 8개 → 4개
- 곡 50개를 매크로 체인(250+ 명령/회) → 스토리지 리스트 O(1) 룩업으로 전환
  mq:init/songs가 mq:main.songs를 적재, setanswer는 index-1로 인덱스 룩업
- 버튼/트리거 정의를 mq:init/buttons / mq:init/triggers로 분리해
  mq:main.button_defs · trigger_defs 스토리지 리스트로 관리
- repeat/triggers/trigger.mcfunction: 투표 후처리 산술 블록 중 변하지 않는
  max_player·rest_player 재계산 제거, $(n)_player 갱신만 1라인
- 작가용 메모 수정.txt 제거
- README.md: 변경 사항·새 구조·스토리지 스키마 반영

566 lines -, 154 lines +.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-13 15:45:35 +09:00

28 lines
1.9 KiB
MCFunction

$scoreboard players enable @a $(n)
$execute unless score init main matches 5 as @a if score @s $(n) matches 1.. run scoreboard players reset @s $(n)
execute unless score init main matches 5 run return 0
$execute store result score real_max_player $(n) if entity @a
$execute store result score rest_player $(n) if entity @a
$execute unless score rest_player $(n) matches 0 run scoreboard players operation rest_player $(n) %= two func.temp
$execute store result score max_player $(n) if entity @a
$execute unless score real_max_player $(n) matches 0 run scoreboard players operation max_player $(n) /= two func.temp
$execute unless score real_max_player $(n) matches 0 run scoreboard players operation max_player $(n) += rest_player $(n)
$execute store result score $(n)_player $(n) if entity @a[scores={$(n)=2..}]
$execute store result score $(n)_player_add $(n) if entity @a[scores={$(n)=2..}]
$execute run scoreboard players add $(n)_player_add $(n) 1
$execute as @a if score @s $(n) matches 1 run function mq:tellraw {"text":"","color":"black",msg:[{"selector":"@s","color": "yellow","bold": true}," : ",{"text":"$(n2) 투표 완료","color": "white"}, \
{"text":" (","color":"gray"},{"score":{"name":"$(n)_player_add","objective": "$(n)"},"color":"gray"},{"text":"/","color":"gray"},{"score":{"name":"max_player","objective": "$(n)"},"color":"gray"},{"text":")","color":"gray"}]}
$execute as @a if score @s $(n) matches 1 run scoreboard players set @s $(n) 2
$execute as @a if score @s $(n) matches 3 run function mq:tellraw {"text":"","color":"black",msg:[{"selector":"@s","color": "yellow","bold": true}," : ",{"text":"이미 $(n2)투표를 하셨습니다.","color": "red"}]}
$execute as @a if score @s $(n) matches 3 run scoreboard players set @s $(n) 2
$execute store result score $(n)_player $(n) if entity @a[scores={$(n)=2..}]
$execute unless score real_max_player $(n) matches 0 \
if score max_player $(n) = $(n)_player $(n) \
run $(c)