diff --git a/datapacks/omegaflowey/data/omegaflowey.admin/function/attack/shared.mcfunction b/datapacks/omegaflowey/data/omegaflowey.admin/function/attack/shared.mcfunction index 8012fdbc2..2d1d6295a 100644 --- a/datapacks/omegaflowey/data/omegaflowey.admin/function/attack/shared.mcfunction +++ b/datapacks/omegaflowey/data/omegaflowey.admin/function/attack/shared.mcfunction @@ -1,4 +1,9 @@ -execute unless entity @s[tag=omegaflowey.player.fighting_flowey] run \ +scoreboard players set #omegaflowey.admin.is_active_player omegaflowey.global.flag 0 + +function gu:generate +function omegaflowey.admin:attack/shared/macro with storage omegaflowey:bossfight + +execute if score #omegaflowey.admin.is_active_player omegaflowey.global.flag matches 0 run \ function omegaflowey.utils:log/self { text_component: '[ \ { "text": "", "color": "red" }, \ "Some attacks won\'t function properly if you don\'t have the bossfight tag.\\n", \ diff --git a/datapacks/omegaflowey/data/omegaflowey.admin/function/attack/shared/macro.mcfunction b/datapacks/omegaflowey/data/omegaflowey.admin/function/attack/shared/macro.mcfunction new file mode 100644 index 000000000..21feb6e52 --- /dev/null +++ b/datapacks/omegaflowey/data/omegaflowey.admin/function/attack/shared/macro.mcfunction @@ -0,0 +1,4 @@ +$execute \ + if entity @s[tag=omegaflowey.player.fighting_flowey] \ + if data storage gu:main { out: "$(active_player_uuid)" } run \ + scoreboard players set #omegaflowey.admin.is_active_player omegaflowey.global.flag 1 diff --git a/datapacks/omegaflowey/data/omegaflowey.admin/function/set_active_player.mcfunction b/datapacks/omegaflowey/data/omegaflowey.admin/function/set_active_player.mcfunction index d12c8c481..760a5e743 100644 --- a/datapacks/omegaflowey/data/omegaflowey.admin/function/set_active_player.mcfunction +++ b/datapacks/omegaflowey/data/omegaflowey.admin/function/set_active_player.mcfunction @@ -1,12 +1,11 @@ -execute if entity @s[tag=omegaflowey.player.fighting_flowey] run return run \ - function omegaflowey.utils:log/self { text_component: '[ \ - { "text": "You are already the active bossfight player", "color": "red" } \ - ]' } - tag @a remove omegaflowey.player.fighting_flowey tag @s add omegaflowey.player.fighting_flowey + function gu:generate data modify storage omegaflowey:bossfight active_player_uuid set from storage gu:main out + +function omegaflowey.main:summit/room/cave/active_player_display/update_value with storage omegaflowey:bossfight + function omegaflowey.utils:log/self { text_component: '[ \ { "text": "Set you as the active bossfight player", "color": "yellow" } \ ]' } diff --git a/datapacks/omegaflowey/data/omegaflowey.admin/function/unset_active_player.mcfunction b/datapacks/omegaflowey/data/omegaflowey.admin/function/unset_active_player.mcfunction index 2f30ca1ce..00073a2a1 100644 --- a/datapacks/omegaflowey/data/omegaflowey.admin/function/unset_active_player.mcfunction +++ b/datapacks/omegaflowey/data/omegaflowey.admin/function/unset_active_player.mcfunction @@ -1,9 +1,7 @@ -execute unless entity @s[tag=omegaflowey.player.fighting_flowey] run return run \ - function omegaflowey.utils:log/self { text_component: '[ \ - { "text": "You are already NOT the active bossfight player", "color": "red" } \ - ]' } - tag @s remove omegaflowey.player.fighting_flowey + +function omegaflowey.main:summit/room/cave/active_player_display/update_value with storage omegaflowey:bossfight + function omegaflowey.utils:log/self { text_component: '[ \ { "text": "Unset you as the active bossfight player", "color": "yellow" } \ ]' } diff --git a/datapacks/omegaflowey/data/omegaflowey.entity/function/directorial/boss_fight/shared/stop.mcfunction b/datapacks/omegaflowey/data/omegaflowey.entity/function/directorial/boss_fight/shared/stop.mcfunction index d6ba39d65..f4d9462f7 100644 --- a/datapacks/omegaflowey/data/omegaflowey.entity/function/directorial/boss_fight/shared/stop.mcfunction +++ b/datapacks/omegaflowey/data/omegaflowey.entity/function/directorial/boss_fight/shared/stop.mcfunction @@ -11,7 +11,6 @@ function omegaflowey.entity:shared/run_as_active_player_or_spectator { command: } $execute as $(active_player_uuid) run function omegaflowey.entity:directorial/boss_fight/shared/stop/as_active_player -data modify storage omegaflowey:bossfight active_player_uuid set value "0" function omegaflowey.main:summit/room/cave/active_player_display/update_value with storage omegaflowey:bossfight # prompt next player in queue function omegaflowey.entity:directorial/boss_fight/summit/player/queue/check_should_prompt diff --git a/datapacks/omegaflowey/data/omegaflowey.entity/function/directorial/boss_fight/summit/player/active/leave_and_rejoin.mcfunction b/datapacks/omegaflowey/data/omegaflowey.entity/function/directorial/boss_fight/summit/player/active/leave_and_rejoin.mcfunction index 925417f28..da43c1c9a 100644 --- a/datapacks/omegaflowey/data/omegaflowey.entity/function/directorial/boss_fight/summit/player/active/leave_and_rejoin.mcfunction +++ b/datapacks/omegaflowey/data/omegaflowey.entity/function/directorial/boss_fight/summit/player/active/leave_and_rejoin.mcfunction @@ -1,5 +1,6 @@ # players who leave the server are removed from the bossfight (when they rejoin) function omegaflowey.entity:directorial/boss_fight/shared/stop/as_active_player/modify_health_and_tags +function omegaflowey.main:summit/room/cave/active_player_display/update_value with storage omegaflowey:bossfight function omegaflowey.utils:log/self { text_component: '[\ { "text": "You were ", "color": "yellow" }, \ diff --git a/datapacks/omegaflowey/data/omegaflowey.main/function/summit/room/cave/active_player_display/as_text_display.mcfunction b/datapacks/omegaflowey/data/omegaflowey.main/function/summit/room/cave/active_player_display/as_text_display.mcfunction index e82e53f2e..4a640420d 100644 --- a/datapacks/omegaflowey/data/omegaflowey.main/function/summit/room/cave/active_player_display/as_text_display.mcfunction +++ b/datapacks/omegaflowey/data/omegaflowey.main/function/summit/room/cave/active_player_display/as_text_display.mcfunction @@ -1,8 +1,7 @@ setblock -133 43 44 air -$execute unless entity $(active_player_uuid) run \ +$execute unless entity $(active_player_uuid) run return run \ data modify entity @s text set value '[{ "text": "NONE", "bold": true, "color": "green" }]' -$execute unless entity $(active_player_uuid) run return 0 $data modify entity @s text set value '[{ "selector": "$(active_player_uuid)", "color": "white" }]' diff --git a/datapacks/omegaflowey/data/omegaflowey.main/function/summit/room/cave/active_player_display/update_value.mcfunction b/datapacks/omegaflowey/data/omegaflowey.main/function/summit/room/cave/active_player_display/update_value.mcfunction index b55b2452d..4cbdced4c 100644 --- a/datapacks/omegaflowey/data/omegaflowey.main/function/summit/room/cave/active_player_display/update_value.mcfunction +++ b/datapacks/omegaflowey/data/omegaflowey.main/function/summit/room/cave/active_player_display/update_value.mcfunction @@ -1,4 +1,11 @@ -$execute as $(active_player_uuid) run data modify storage omegaflowey:bossfight active_player_uuid_intarray set from entity @s UUID +# If active player doesn't exist, update active player UUID storage +$execute unless entity $(active_player_uuid) run data modify storage omegaflowey:bossfight active_player_uuid set value "0" +$execute \ + as $(active_player_uuid) \ + if entity @s[tag=!omegaflowey.player.fighting_flowey] \ + run data modify storage omegaflowey:bossfight active_player_uuid set value "0" + +$data modify storage omegaflowey:bossfight active_player_uuid_intarray set from entity $(active_player_uuid) UUID $execute as $(active_player_display_uuid) run \ function omegaflowey.main:summit/room/cave/active_player_display/as_text_display with storage omegaflowey:bossfight diff --git a/datapacks/omegaflowey/data/omegaflowey.main/function/summit/room/cave/active_player_health_display/as_text_display.mcfunction b/datapacks/omegaflowey/data/omegaflowey.main/function/summit/room/cave/active_player_health_display/as_text_display.mcfunction index e82a3ae22..1f4ba2050 100644 --- a/datapacks/omegaflowey/data/omegaflowey.main/function/summit/room/cave/active_player_health_display/as_text_display.mcfunction +++ b/datapacks/omegaflowey/data/omegaflowey.main/function/summit/room/cave/active_player_health_display/as_text_display.mcfunction @@ -1,6 +1,5 @@ -$execute unless entity $(active_player_uuid) run \ +$execute unless entity $(active_player_uuid) run return run \ data modify entity @s text set value '""' -$execute unless entity $(active_player_uuid) run return 0 $data modify entity @s text set value '[ \ { "text": "\\uf610", "font": "omega-flowey:custom" }, \ diff --git a/datapacks/omegaflowey/data/omegaflowey.main/function/summit/room/cave/setup/text_displays.mcfunction b/datapacks/omegaflowey/data/omegaflowey.main/function/summit/room/cave/setup/text_displays.mcfunction index 44aa9d71b..2b0dfc29a 100644 --- a/datapacks/omegaflowey/data/omegaflowey.main/function/summit/room/cave/setup/text_displays.mcfunction +++ b/datapacks/omegaflowey/data/omegaflowey.main/function/summit/room/cave/setup/text_displays.mcfunction @@ -648,3 +648,83 @@ execute as @e[ \ limit=1 \ ] run function gu:generate data modify storage omegaflowey:decorative feedback_form_interaction_uuid set from storage gu:main out + +summon minecraft:text_display -137.75 44.0 26.001 { \ + Tags: [ \ + "omega-flowey-remastered", \ + "decorative", \ + "decorative-cave", \ + "sound-categories-display-title", \ + ], \ + alignment: "center", \ + background: 0, \ + brightness: { block: 12, sky: 0 }, \ + default_background: 0b, \ + line_width: 200, \ + see_through: 0b, \ + shadow: 0b, \ + text: '{ "text": "BOOTH SOUND CATEGORIES", "color": "gold", "bold": true }', \ + text_opacity: 255, \ + transformation: { \ + left_rotation: [0.0f, 0.0f, 0.0f, 1.0f], \ + right_rotation: [0.0f, 0.0f, 0.0f, 1.0f], \ + scale: [0.875f, 0.875f, 0.875f], \ + translation: [0.0f, 0.0f, 0.0f] \ + } \ +} + +summon minecraft:text_display -137.75 42.0 26.0015 { \ + Tags: [ \ + "omega-flowey-remastered", \ + "decorative", \ + "decorative-cave", \ + "sound-categories-display-content", \ + ], \ + alignment: "left", \ + background: -16777216, \ + brightness: { block: 12, sky: 0 }, \ + default_background: 0b, \ + line_width: 300, \ + see_through: 0b, \ + shadow: 0b, \ + text: '[ \ + { "translate": ":musical_note:" }, \ + { "text": " Jukebox/Note Blocks", "color": "yellow", "bold": true }, \ + "\\nbossfight music\\n\\n", \ + { "translate": ":crossed_swords:" }, \ + { "text": " Hostile Creatures", "color": "yellow", "bold": true }, \ + "\\nattack sound effects\\n\\n", \ + { "translate": ":video_game:" }, \ + { "text": " Players", "color": "yellow", "bold": true }, \ + "\\nsound effects applied to players\\n\\n", \ + { "translate": ":earth_americas:" }, \ + { "text": " Ambient", "color": "yellow", "bold": true }, \ + "\\nmisc. supplemental sounds" \ + ]', \ + text_opacity: 255, \ + transformation: { \ + left_rotation: [0.0f, 0.0f, 0.0f, 1.0f], \ + right_rotation: [0.0f, 0.0f, 0.0f, 1.0f], \ + scale: [0.625f, 0.625f, 0.625f], \ + translation: [0.0f, 0.0f, 0.0f], \ + } \ +} + +summon minecraft:block_display -139.13 41.9375 26.001 { \ + Tags: [ \ + "omega-flowey-remastered", \ + "decorative", \ + "decorative-cave", \ + "sound-categories-display-border", \ + ], \ + block_state: { \ + "Name": "minecraft:smooth_quartz", \ + }, \ + brightness: { block: 12, sky: 0 }, \ + transformation: { \ + left_rotation: [0.0f, 0.0f, 0.0f, 1.0f], \ + right_rotation: [0.0f, 0.0f, 0.0f, 1.0f], \ + scale: [2.775f, 1.875f, 1.0E-4f], \ + translation: [0.0f, 0.0f, 0.0f], \ + } \ +}