# Story Showcase — Inspect Story Progress
# @s = player being inspected
# Broadcasts story info to nearby players (10 block radius)
# Can be triggered via trigger or from Guild Card share

tellraw @a[distance=..10] {"text":""}
tellraw @a[distance=..10] [{"text":"\u2550\u2550\u2550 ",color:"dark_gray"},{"selector":"@s",color:"gold"},{"text":" \u2550\u2550\u2550",color:"dark_gray"}]

# Act display with color per act
execute if score @s sm.act matches 0 run tellraw @a[distance=..10] [{"text":"  Act: ",color:"gray"},{"text":"Not Started",color:"dark_gray","italic":true}]
execute if score @s sm.act matches 1 run tellraw @a[distance=..10] [{"text":"  Act: ",color:"gray"},{"text":"I",color:"white"},{"text":" \u2014 Landfall",color:"gray"}]
execute if score @s sm.act matches 2 run tellraw @a[distance=..10] [{"text":"  Act: ",color:"gray"},{"text":"II",color:"blue"},{"text":" \u2014 Foundations",color:"gray"}]
execute if score @s sm.act matches 3 run tellraw @a[distance=..10] [{"text":"  Act: ",color:"gray"},{"text":"III",color:"green"},{"text":" \u2014 The Awakening",color:"gray"}]
execute if score @s sm.act matches 4 run tellraw @a[distance=..10] [{"text":"  Act: ",color:"gray"},{"text":"IV",color:"light_purple"},{"text":" \u2014 The Forging",color:"gray"}]
execute if score @s sm.act matches 5 run tellraw @a[distance=..10] [{"text":"  Act: ",color:"gray"},{"text":"V",color:"gold"},{"text":" \u2014 Ascension",color:"gray"}]

# Chapter progress
tellraw @a[distance=..10] [{"text":"  Chapter: ",color:"gray"},{"score":{"name":"@s","objective":"sm.chapter"},color:"yellow"},{"text":" / 50",color:"dark_gray"}]

# Path display
execute if score @s sm.path matches 0 run tellraw @a[distance=..10] [{"text":"  Path: ",color:"gray"},{"text":"Unchosen",color:"dark_gray","italic":true}]
execute if score @s sm.path matches 1 run tellraw @a[distance=..10] [{"text":"  Path: ",color:"gray"},{"text":"\u2694 ",color:"red"},{"text":"Adventurer\u2019s Chronicle",color:"red"}]
execute if score @s sm.path matches 2 run tellraw @a[distance=..10] [{"text":"  Path: ",color:"gray"},{"text":"\u2692 ",color:"green"},{"text":"Artisan\u2019s Almanac",color:"green"}]
execute if score @s sm.path matches 3 run tellraw @a[distance=..10] [{"text":"  Path: ",color:"gray"},{"text":"\u2605 ",color:"gold"},{"text":"Both Paths",color:"gold"}]

# Chapters completed + convergences
tellraw @a[distance=..10] [{"text":"  Completed: ",color:"gray"},{"score":{"name":"@s","objective":"sm.chapters_done"},color:"green"},{"text":" chapters",color:"dark_gray"},{"text":"  \u2022  ",color:"dark_gray"},{"text":"Convergences: ",color:"gray"},{"score":{"name":"@s","objective":"sm.conv_done"},color:"gold"},{"text":"/5",color:"dark_gray"}]

tellraw @a[distance=..10] [{"text":"\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550",color:"dark_gray"}]
