Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔊 add Undertale battle sfx on fight-join + victory sfx on win #245

Merged
merged 9 commits into from
Oct 24, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,28 @@ function omegaflowey.utils:log/self { text_component: '[ \
"value": "/function omegaflowey.admin:kill/queue" \
} \
}, \
": resets the bossfight player queue" \
": resets the bossfight player queue", \
"\\n", \
"\\n", \
{ \
"text": "queue/enable", \
"color": "yellow", \
"clickEvent": { \
"action": "suggest_command", \
"value": "/function omegaflowey.admin:queue/enable" \
} \
}, \
": enables the join queue buttons and shows their text", \
"\\n", \
{ \
"text": "queue/disable", \
"color": "yellow", \
"clickEvent": { \
"action": "suggest_command", \
"value": "/function omegaflowey.admin:queue/disable" \
} \
}, \
": disables the join queue buttons and hides their text" \
] \
} \
]'}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
function omegaflowey.utils:log { text_component: '[ \
{ "selector": "@s", "color": "gold" }, \
{ "text": " disabled the JOIN QUEUE buttons ", "color": "yellow" } \
]'}

function omegaflowey.main:summit/room/cave/setup/text_displays/join_queue/disable
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
function omegaflowey.utils:log { text_component: '[ \
{ "selector": "@s", "color": "gold" }, \
{ "text": " enabled the JOIN QUEUE buttons ", "color": "yellow" } \
]'}

function omegaflowey.main:summit/room/cave/setup/text_displays/join_queue/enable
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"criteria": {
"requirement": {
"trigger": "minecraft:player_interacted_with_entity",
"conditions": {
"entity": {
"type": "minecraft:interaction",
"nbt": "{ Tags: [\"join-queue-2-interaction\"] }"
}
}
}
},
"rewards": {
"function": "omegaflowey.entity:player/interacted/with_join_queue_2"
}
}
Original file line number Diff line number Diff line change
@@ -1,19 +1,2 @@
# Summon and animate Omega Flowey entity
function omegaflowey.entity:directorial/boss_fight/summit/origin/at { \
command: "execute positioned ~ ~ ~29.4 run function omegaflowey.entity:hostile/omega-flowey/summon/relative" \
}
execute as @e[ \
x=-186, dx=61, y=12, dy=44, z=47, dz=91, \
type=minecraft:item_display, \
tag=aj.rig_root, \
tag=omega-flowey-remastered \
] run function omegaflowey.entity:hostile/omega-flowey/animate/intro/darken/as_root

function omegaflowey.entity:shared/run_as_active_player_or_spectator { command: "\
execute at @s run playsound omega-flowey:cutscene.intro.music record @s ~ ~ ~ 1 1\
"}

# Set arena box to flashing red variant
$execute as $(arena_box_uuid) run function animated_java:omegaflowey_arena_box/variants/intro_flashing_red/apply

schedule function omegaflowey.entity:directorial/boss_fight/summit/phase/cutscene/terminate/scheduled 575t
# Delay before music/red flashing starts
scoreboard players set @s omegaflowey.boss-fight.cutscene.clock.i -14
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
scoreboard players add @s omegaflowey.boss-fight.cutscene.clock.i 1
execute if score @s omegaflowey.boss-fight.cutscene.clock.i matches ..-1 run return 0

# Run cutscene specific logic
execute if score @s omegaflowey.boss-fight.cutscene.phase.i matches 0 run return run \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
execute if score @s omegaflowey.boss-fight.cutscene.clock.i matches 0 run \
function omegaflowey.entity:directorial/boss_fight/summit/phase/cutscene/loop/0/start_cutscene with storage omegaflowey:bossfight

execute if score @s omegaflowey.boss-fight.cutscene.clock.i matches 1 run \
function omegaflowey.entity:directorial/boss_fight/summit/phase/cutscene/loop/0/clear_player_blindness with storage omegaflowey:bossfight

execute if score @s omegaflowey.boss-fight.cutscene.clock.i matches 0..293 run return run \
function omegaflowey.entity:directorial/boss_fight/summit/phase/cutscene/loop/0/approach
execute if score @s omegaflowey.boss-fight.cutscene.clock.i matches 332 run return run \
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$effect clear $(active_player_uuid) minecraft:blindness
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Summon and animate Omega Flowey entity
function omegaflowey.entity:directorial/boss_fight/summit/origin/at { \
command: "execute positioned ~ ~ ~29.4 run function omegaflowey.entity:hostile/omega-flowey/summon/relative" \
}
execute as @e[ \
x=-186, dx=61, y=12, dy=44, z=47, dz=91, \
type=minecraft:item_display, \
tag=aj.rig_root, \
tag=omega-flowey-remastered \
] run function omegaflowey.entity:hostile/omega-flowey/animate/intro/darken/as_root

function omegaflowey.entity:shared/run_as_active_player_or_spectator { command: "\
execute at @s run playsound omega-flowey:cutscene.intro.music record @s ~ ~ ~ 1 1\
"}

# Set arena box to flashing red variant
$execute as $(arena_box_uuid) run function animated_java:omegaflowey_arena_box/variants/intro_flashing_red/apply

schedule function omegaflowey.entity:directorial/boss_fight/summit/phase/cutscene/terminate/scheduled 575t
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
$execute at $(bossfight_tvscreen_uuid) run function omegaflowey.entity:shared/run_as_active_player_or_spectator { command: '\
playsound omega-flowey:cutscene.summit.victory ambient @s ~ ~ ~ 5 1\
'}
$execute as $(bossfight_tvscreen_uuid) at @s run \
function omegaflowey.entity:directorial/boss_fight/summit/phase/soul/loop/next_event/1/as_tvscreen

scoreboard players add @s omegaflowey.boss-fight.progress.phase.i 1

function omegaflowey.entity:directorial/boss_fight/shared/phase/soul/loop/event_finished with storage omegaflowey:bossfight
schedule clear omegaflowey.entity:directorial/boss_fight/summit/phase/soul/loop/next_event/1/scheduled
schedule function omegaflowey.entity:directorial/boss_fight/summit/phase/soul/loop/next_event/1/scheduled 30t replace
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function omegaflowey.entity:shared/run_as_active_player_or_spectator { command: '\
playsound omega-flowey:cutscene.summit.victory ambient @s ~ ~ ~ 5 1\
'}

function animated_java:omegaflowey_tv_screen/variants/thumbs_up/apply
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
function omegaflowey.entity:directorial/boss_fight/summit/phase/soul/loop/next_event/1/scheduled/macro with storage omegaflowey:bossfight
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
scoreboard players add @s omegaflowey.boss-fight.progress.phase.i 1

function omegaflowey.entity:directorial/boss_fight/shared/phase/soul/loop/event_finished with storage omegaflowey:bossfight
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
$execute as $(boss_fight_uuid) at @s run \
function omegaflowey.entity:directorial/boss_fight/summit/phase/soul/loop/next_event/1/scheduled/as_bossfight
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ data modify storage omegaflowey:bossfight active_player_uuid set from storage gu
teleport @s ~ ~-4.0 ~-27.0 ~180.0 -30.0
spawnpoint @s -142 43 25 -45

execute at @s run playsound omega-flowey:cutscene.intro.battle_start_end ambient @s ~ ~ ~ 5

effect clear @s
effect give @s minecraft:blindness 5 0 true
effect give @s instant_health 1 4 true
function omegaflowey.main:summit/room/cave/active_player_display/update_value with storage omegaflowey:bossfight

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
scoreboard players set #omegaflowey.bossfight.has_player_been_prompted omegaflowey.global.flag 0
data remove storage omegaflowey:bossfight player_queue_timeout_uuid
schedule clear omegaflowey.entity:directorial/boss_fight/summit/player/queue/prompt_next_player/show_prompt/confirm/after_delay
schedule clear omegaflowey.entity:directorial/boss_fight/summit/player/queue/prompt_next_player/show_prompt/confirm/teleport_animation
schedule clear omegaflowey.entity:directorial/boss_fight/summit/player/queue/prompt_next_player/show_prompt/timeout
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ function omegaflowey.utils:log/self { text_component: '[ \
{ "text": "...", "color": "yellow" } \
]' }

schedule function omegaflowey.entity:directorial/boss_fight/summit/player/queue/prompt_next_player/show_prompt/confirm/after_delay 3s replace
schedule function omegaflowey.entity:directorial/boss_fight/summit/player/queue/prompt_next_player/show_prompt/confirm/teleport_animation 3s replace
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
stopsound @s ambient omega-flowey:cutscene.intro.battle_start

function omegaflowey.entity:directorial/boss_fight/summit/player/queue/prompt_next_player/show_prompt/shared/as_player
function omegaflowey.entity:directorial/boss_fight/summit/origin/at { \
command: "function omegaflowey.entity:directorial/boss_fight/summit/player/join_bossfight" \
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
$execute as $(player_uuid) run function omegaflowey.entity:directorial/boss_fight/summit/player/queue/prompt_next_player/show_prompt/confirm/after_delay/as_player
$execute as $(player_uuid) at @s run \
function omegaflowey.entity:directorial/boss_fight/summit/player/queue/prompt_next_player/show_prompt/confirm/after_delay/as_player
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
function omegaflowey.entity:directorial/boss_fight/summit/player/queue/prompt_next_player/show_prompt/confirm/teleport_animation/macro \
with storage omegaflowey:bossfight player_queue[0]

schedule \
function omegaflowey.entity:directorial/boss_fight/summit/player/queue/prompt_next_player/show_prompt/confirm/after_delay \
6t replace
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
playsound omega-flowey:cutscene.intro.battle_start_full ambient @a[distance=..16] ~ ~ ~ 1 1
effect give @s minecraft:blindness 5 0 true
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
$execute as $(player_uuid) at @s run \
function omegaflowey.entity:directorial/boss_fight/summit/player/queue/prompt_next_player/show_prompt/confirm/teleport_animation/as_player
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ scoreboard players set #omegaflowey.bossfight.has_player_been_prompted omegaflow

# clear scheduled functions
schedule clear omegaflowey.entity:directorial/boss_fight/summit/player/queue/prompt_next_player/show_prompt/confirm/after_delay
schedule clear omegaflowey.entity:directorial/boss_fight/summit/player/queue/prompt_next_player/show_prompt/confirm/teleport_animation
schedule clear omegaflowey.entity:directorial/boss_fight/summit/player/queue/prompt_next_player/show_prompt/timeout

function omegaflowey.entity:directorial/boss_fight/summit/player/queue/pop
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ function omegaflowey.main:summit/room/cave/player_queue_counter/update_value
scoreboard players set #omegaflowey.bossfight.has_player_been_prompted omegaflowey.global.flag 0
execute as @a run function omegaflowey.entity:directorial/boss_fight/summit/player/queue/prompt_next_player/show_prompt/shared/as_player
schedule clear omegaflowey.entity:directorial/boss_fight/summit/player/queue/prompt_next_player/show_prompt/confirm/after_delay
schedule clear omegaflowey.entity:directorial/boss_fight/summit/player/queue/prompt_next_player/show_prompt/confirm/teleport_animation
schedule clear omegaflowey.entity:directorial/boss_fight/summit/player/queue/prompt_next_player/show_prompt/timeout
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
advancement revoke @s only omegaflowey.entity:player_interacted_with_join_queue

execute if score #omegaflowey.bossfight.queue_disabled omegaflowey.global.flag matches 1 run return 0

function omegaflowey.main:telemetry/booth/add_tag { name: "player.interact.join_queue" }
function omegaflowey.entity:player/interacted/with_join_queue/macro with storage omegaflowey:decorative
advancement revoke @s only omegaflowey.entity:player_interacted_with_join_queue
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
advancement revoke @s only omegaflowey.entity:player_interacted_with_join_queue_2

execute if score #omegaflowey.bossfight.queue_disabled omegaflowey.global.flag matches 1 run return 0

function omegaflowey.main:telemetry/booth/add_tag { name: "player.interact.join_queue_2" }
function omegaflowey.entity:player/interacted/with_join_queue_2/macro with storage omegaflowey:decorative
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
function omegaflowey.entity:player/interacted/with_join_queue/as_interaction
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$execute as $(join_queue_2_interaction_uuid) run function omegaflowey.entity:player/interacted/with_join_queue_2/as_interaction
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ data modify storage omegaflowey:bossfight active_player_health_display_uuid set
# Player name display updates both the name (+ skull) and the health counter
function omegaflowey.main:summit/room/cave/active_player_display/update_value with storage omegaflowey:bossfight

scoreboard players set #omegaflowey.bossfight.queue_disabled omegaflowey.global.flag 0
summon minecraft:text_display -137.5 43.5 42.5 { \
Tags: [ \
"omega-flowey-remastered", \
Expand All @@ -92,6 +93,7 @@ summon minecraft:text_display -137.5 43.5 42.5 { \
], \
alignment: "center", \
billboard: "center", \
brightness: { block: 14, sky: 0 }, \
default_background: 0b, \
line_width: 200, \
see_through: 0b, \
Expand Down Expand Up @@ -125,6 +127,49 @@ execute as @e[ \
] run function gu:generate
data modify storage omegaflowey:decorative join_queue_interaction_uuid set from storage gu:main out

summon minecraft:text_display -135.75 38.5 46.25 { \
Tags: [ \
"omega-flowey-remastered", \
"decorative", \
"decorative-cave", \
"join-queue-2-title", \
], \
alignment: "center", \
billboard: "center", \
brightness: { block: 14, sky: 0 }, \
default_background: 0b, \
line_width: 200, \
see_through: 0b, \
shadow: 0b, \
text: '[{ "text": "JOIN QUEUE", "color": "light_purple", "bold": true, "underlined": 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: [1.5f, 1.5f, 1.5f], \
translation: [0.0f, 0.0f, 0.0f] \
} \
}
summon minecraft:interaction -135.75 38.5 46.25 { \
Tags: [ \
"omega-flowey-remastered", \
"decorative", \
"decorative-cave", \
"join-queue-2-interaction", \
], \
width: 2.5, \
height: 0.5, \
response: true, \
}
execute as @e[ \
x=-136.0, dx=2, y=38.0, dy=2, z=45.0, dz=2, \
type=minecraft:interaction, \
tag=join-queue-2-interaction, \
tag=omega-flowey-remastered, \
limit=1 \
] run function gu:generate
data modify storage omegaflowey:decorative join_queue_2_interaction_uuid set from storage gu:main out

summon minecraft:text_display -139.99 45.0 39.0 { \
Tags: [ \
"omega-flowey-remastered", \
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
execute as @e[ \
x=-137.5, y=43.5, z=42.5, distance=..0.01, \
type=minecraft:text_display, \
tag=join-queue-title, \
limit=1 \
] run data modify entity @s text set value '[ \
{ "text": "FIGHT\\n", "color": "red", "bold": true, "underlined": false }, \
{ "text": "DISABLED", "underlined": true } \
]'

execute as @e[ \
x=-137.5, y=43.5, z=42.5, distance=..0.01, \
type=minecraft:interaction, \
tag=join-queue-interaction, \
limit=1 \
] run data modify entity @s response set value false

execute as @e[ \
x=-135.75, y=38.5, z=46.25, distance=..0.01, \
type=minecraft:text_display, \
tag=join-queue-2-title, \
limit=1 \
] run data modify entity @s text set value '[ \
{ "text": "FIGHT\\n", "color": "red", "bold": true, "underlined": false }, \
{ "text": "DISABLED", "underlined": true } \
]'

execute as @e[ \
x=-135.75, y=38.5, z=46.25, distance=..0.01, \
type=minecraft:interaction, \
tag=join-queue-2-interaction, \
limit=1 \
] run data modify entity @s response set value false

scoreboard players set #omegaflowey.bossfight.queue_disabled omegaflowey.global.flag 1

function omegaflowey.entity:directorial/boss_fight/summit/player/queue/reset
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
execute as @e[ \
x=-137.5, y=43.5, z=42.5, distance=..0.01, \
type=minecraft:text_display, \
tag=join-queue-title, \
limit=1 \
] run data modify entity @s text set value '[ \
{ "text": "JOIN QUEUE", "color": "light_purple", "bold": true, "underlined": true } \
]'

execute as @e[ \
x=-137.5, y=43.5, z=42.5, distance=..0.01, \
type=minecraft:interaction, \
tag=join-queue-interaction, \
limit=1 \
] run data modify entity @s response set value true

execute as @e[ \
x=-135.75, y=38.5, z=46.25, distance=..0.01, \
type=minecraft:text_display, \
tag=join-queue-2-title, \
limit=1 \
] run data modify entity @s text set value '[ \
{ "text": "JOIN QUEUE", "color": "light_purple", "bold": true, "underlined": true } \
]'

execute as @e[ \
x=-135.75, y=38.5, z=46.25, distance=..0.01, \
type=minecraft:interaction, \
tag=join-queue-2-interaction, \
limit=1 \
] run data modify entity @s response set value true

scoreboard players set #omegaflowey.bossfight.queue_disabled omegaflowey.global.flag 0
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Flowey TV screen, smiling
scoreboard players set #omegaflowey.summon.tag_variant omegaflowey.global.flag 3
execute positioned -123.47 87.25 33.35 rotated -158.2 12.52 run \
function animated_java:omegaflowey_tv_screen/summon { args: { animation: 'omegaflowey_move_slow', start_animation: true, variant: 'smiling' } }
function animated_java:omegaflowey_tv_screen/summon { args: { animation: 'omegaflowey_move_slow', start_animation: true, variant: 'smiling_noglow' } }

# Surrounding petal pipes, very simplified models
execute positioned -109.9375 90.0625 41.9375 rotated 200 15 run \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ execute on passengers if entity @s[tag=aj.omegaflowey_tv_screen.bone] run functi

function gu:generate
data modify storage omegaflowey:decorative outside_tvscreen_uuid set from storage gu:main out

# Set variant to day/night automatically
execute at @s run function omegaflowey.main:summit/room/outside/setup/tv_screen/set_screen/clear
schedule function omegaflowey.main:summit/room/outside/setup/tv_screen/reset_variant 20t
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ execute if entity @s[tag=is_active_death_animation] run return 0
execute store result score @s omegaflowey.math.0 run time query daytime
execute unless score @s omegaflowey.math.0 matches 13500..23000 run tag @s add is_daytime

execute if entity @s[tag=is_daytime] run function omegaflowey.main:summit/room/outside/setup/tv_screen/set_variant_day
execute unless entity @s[tag=is_daytime] run function omegaflowey.main:summit/room/outside/setup/tv_screen/set_variant_night
execute if entity @s[tag=is_daytime] run function omegaflowey.main:summit/room/outside/setup/tv_screen/set_variant_day

tag @s remove is_daytime
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ execute if entity @s[tag=is_active_death_animation] run return 0
execute store result score @s omegaflowey.math.0 run time query daytime
execute unless score @s omegaflowey.math.0 matches 13500..23000 run tag @s add is_daytime

execute if entity @s[tag=is_daytime] run function animated_java:omegaflowey_tv_screen/variants/static_noglow/apply
execute unless entity @s[tag=is_daytime] run function animated_java:omegaflowey_tv_screen/variants/static/apply
execute if entity @s[tag=is_daytime] run function animated_java:omegaflowey_tv_screen/variants/static_noglow/apply

tag @s remove is_daytime
Loading