-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ replace player-selectors with macro UUIDs/volume bounds (#225)
* ♻️ replace instances that reference the "closest" active player with a macro UUID * ♻️ replace instances that reference a random active player with a macro UUID * 🧑💻 store `active_player_uuid` to storage when running attack test suite * ♻️ add volume bounds/room checks to most `@a` selectors - biggest change here is that only the active player + spectators will hear bossfight sounds and music * 🚸 stop bossfight music/sounds when player leaves spectator box
- Loading branch information
1 parent
6295439
commit a8ba02a
Showing
45 changed files
with
130 additions
and
56 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
datapacks/omegaflowey/data/_/function/test/attacks.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
datapacks/omegaflowey/data/_/function/test/attacks/scheduled/macro.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
$function omegaflowey.utils:log { text_component: \ | ||
'[ { "text": "Running: attack/$(name)" } ]' \ | ||
} | ||
$execute at @p[tag=omegaflowey.player.fighting_flowey] run function _:attack/$(name) |
4 changes: 3 additions & 1 deletion
4
...flowey.entity/function/directorial/boss_fight/shared/phase/soul/static/as_root.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
# Play static sound | ||
playsound omega-flowey:boss-fight.static ambient @a ~ ~ ~ 10 | ||
function omegaflowey.entity:shared/run_as_active_player_or_spectator { command: \ | ||
'playsound omega-flowey:boss-fight.static ambient @s ~ ~ ~ 10' \ | ||
} | ||
|
||
function animated_java:omegaflowey_tv_screen/variants/static/apply |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
...ntity/function/directorial/boss_fight/summit/phase/warn/initialize/after_delay.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
...wey.entity/function/hostile/omega-flowey/attack/bomb/bullet/loop/start_falling.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
stopsound @a hostile omega-flowey:attack.bomb.fall | ||
playsound omega-flowey:attack.bomb.fall hostile @a ~ ~ ~ 5 1 | ||
function omegaflowey.entity:shared/run_as_active_player_or_spectator { command: \ | ||
'function omegaflowey.entity:hostile/omega-flowey/attack/bomb/bullet/loop/start_falling/as_player' \ | ||
} |
2 changes: 2 additions & 0 deletions
2
.../function/hostile/omega-flowey/attack/bomb/bullet/loop/start_falling/as_player.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
stopsound @s hostile omega-flowey:attack.bomb.fall | ||
playsound omega-flowey:attack.bomb.fall hostile @s ~ ~ ~ 5 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
...ction/hostile/omega-flowey/attack/bomb/bullet/loop/stop_falling/as_player_once.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
stopsound @s hostile omega-flowey:attack.bomb.explode | ||
playsound omega-flowey:attack.bomb.explode hostile @s ~ ~ ~ 5 1 |
6 changes: 3 additions & 3 deletions
6
...ity/function/hostile/omega-flowey/attack/dentata-snakes/bullet/initialize/head.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# Play summon sounds | ||
playsound omega-flowey:attack.dentata-snakes.spawn hostile @a ~ ~ ~ 5 1 | ||
playsound omega-flowey:attack.dentata-snakes.summon hostile @a ~ ~ ~ 5 1 | ||
function omegaflowey.entity:shared/run_as_active_player_or_spectator { command: \ | ||
'function omegaflowey.entity:hostile/omega-flowey/attack/dentata-snakes/bullet/initialize/head/as_player' \ | ||
} | ||
|
||
# Add tags | ||
tag @s add attack-bullet-head |
3 changes: 3 additions & 0 deletions
3
...on/hostile/omega-flowey/attack/dentata-snakes/bullet/initialize/head/as_player.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Play summon sounds | ||
playsound omega-flowey:attack.dentata-snakes.spawn hostile @s ~ ~ ~ 5 1 | ||
playsound omega-flowey:attack.dentata-snakes.summon hostile @s ~ ~ ~ 5 1 |
4 changes: 3 additions & 1 deletion
4
...ile/omega-flowey/attack/dentata-snakes/bullet/loop/after_bounce_as_bullet_head.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
# If we bounced, play bounce sound | ||
# Only the bullet-head makes bounce sounds/shakes the player's screen (see `maybe_bounce.mcfunction`) | ||
playsound omega-flowey:attack.dentata-snakes.bounce hostile @a ~ ~ ~ 5 1 | ||
function omegaflowey.entity:shared/run_as_active_player_or_spectator { command: \ | ||
'playsound omega-flowey:attack.dentata-snakes.bounce hostile @s ~ ~ ~ 5 1' \ | ||
} | ||
# execute as @a unless entity @s[tag=!omegaflowey.player.fighting_flowey,team=!dead,tag=!omegaflowey.player.room.spectator_box] at @s run function omegaflowey.entity:utils/shake_screen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
...y/function/hostile/omega-flowey/attack/finger-guns/bullet/initialize/as_player.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
stopsound @s hostile omega-flowey:attack.finger-guns.shoot | ||
playsound omega-flowey:attack.finger-guns.shoot hostile @s ~ ~ ~ 5 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
.../function/hostile/omega-flowey/attack/homing-vines/bullet/initialize/as_player.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
stopsound @s hostile omega-flowey:attack.homing-vines.summon | ||
playsound omega-flowey:attack.homing-vines.summon hostile @s ~ ~ ~ 5 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...nction/hostile/omega-flowey/attack/homing-vines/executor/loop/summon_indicator.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# Summon and initialize indicator | ||
execute at @r[tag=omegaflowey.player.fighting_flowey] summon minecraft:marker run function omegaflowey.entity:hostile/omega-flowey/attack/homing-vines/indicator/initialize | ||
$execute at $(active_player_uuid) summon minecraft:marker run function omegaflowey.entity:hostile/omega-flowey/attack/homing-vines/indicator/initialize |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...ks/omegaflowey/data/omegaflowey.entity/function/player/room/spectator_box/exit.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
tag @s remove omegaflowey.player.room.spectator_box | ||
function omegaflowey.entity:directorial/boss_fight/shared/stop/as_spectator |
5 changes: 5 additions & 0 deletions
5
...owey/data/omegaflowey.entity/function/shared/run_as_active_player_or_spectator.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# NOTE: TAG_SUMMIT_HARDCODED_GLOBAL_VOLUME | ||
$execute \ | ||
as @a[x=-186, dx=91, y=12, dy=93, z=12, dz=95] \ | ||
unless entity @s[tag=!omegaflowey.player.fighting_flowey, tag=!omegaflowey.player.room.spectator_box] \ | ||
run $(command) |
9 changes: 3 additions & 6 deletions
9
...aflowey/data/omegaflowey.entity/function/soul/soul_5/executor/initialize/saved.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
...ta/omegaflowey.entity/function/soul/soul_5/executor/initialize/saved/as_player.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Stop event music | ||
stopsound @s record omega-flowey:music.soul.5 | ||
|
||
# Play saved music + sound effect | ||
playsound omega-flowey:soul.saved record @s ~ ~ ~ 10 1 | ||
playsound omega-flowey:soul.transition record @s ~ ~ ~ 10 1 |
2 changes: 1 addition & 1 deletion
2
datapacks/omegaflowey/data/omegaflowey.entity/function/soul/soul_5/executor/loop.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
...s/omegaflowey/data/omegaflowey.entity/function/soul/soul_5/executor/play_music.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
playsound omega-flowey:music.soul.5 record @a ~ ~ ~ 10 1 | ||
function omegaflowey.entity:shared/run_as_active_player_or_spectator { command: \ | ||
'playsound omega-flowey:music.soul.5 record @s ~ ~ ~ 10 1' \ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
...owey/data/omegaflowey.entity/function/soul/soul_5/executor/terminate/as_player.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
stopsound @s record omega-flowey:music.soul.5 | ||
stopsound @s record omega-flowey:soul.saved |
2 changes: 1 addition & 1 deletion
2
datapacks/omegaflowey/data/omegaflowey.entity/function/soul/soul_5/healer/heal.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
execute as @p[tag=omegaflowey.player.fighting_flowey] at @s run function omegaflowey.entity:soul/soul_5/healer/heal/as_player | ||
$execute as $(active_player_uuid) at @s run function omegaflowey.entity:soul/soul_5/healer/heal/as_player | ||
function omegaflowey.entity:soul/soul_5/healer/terminate |
3 changes: 2 additions & 1 deletion
3
datapacks/omegaflowey/data/omegaflowey.entity/function/soul/soul_5/healer/loop.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
datapacks/omegaflowey/data/omegaflowey.entity/function/soul/soul_5/tick.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
execute if entity @s[tag=act-button] run function omegaflowey.entity:soul/soul_5/act_button/loop | ||
execute if entity @s[tag=soul-bullet] run function omegaflowey.entity:soul/soul_5/bullet/loop | ||
execute if entity @s[tag=soul-executor] run function omegaflowey.entity:soul/soul_5/executor/loop | ||
execute if entity @s[tag=soul-executor] run function omegaflowey.entity:soul/soul_5/executor/loop with storage omegaflowey:bossfight | ||
execute if entity @s[tag=soul-healer] run function omegaflowey.entity:soul/soul_5/healer/loop | ||
execute if entity @s[tag=soul-indicator] run function omegaflowey.entity:soul/soul_5/indicator/loop | ||
execute if entity @s[tag=soul-locator] run function omegaflowey.entity:soul/soul_5/locator/loop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 8 additions & 3 deletions
11
datapacks/omegaflowey/data/omegaflowey.entity/function/utils/face_closest_player.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
execute store result storage omegaflowey:entity.utils.face_closest_player x float 0.01 run scoreboard players get @s omegaflowey.attack.position.x | ||
execute store result storage omegaflowey:entity.utils.face_closest_player y float 0.01 run scoreboard players get @s omegaflowey.attack.position.y | ||
execute store result storage omegaflowey:entity.utils.face_closest_player z float 0.01 run scoreboard players get @s omegaflowey.attack.position.z | ||
execute store result storage omegaflowey:entity.utils.face_closest_player x float 0.01 run \ | ||
scoreboard players get @s omegaflowey.attack.position.x | ||
execute store result storage omegaflowey:entity.utils.face_closest_player y float 0.01 run \ | ||
scoreboard players get @s omegaflowey.attack.position.y | ||
execute store result storage omegaflowey:entity.utils.face_closest_player z float 0.01 run \ | ||
scoreboard players get @s omegaflowey.attack.position.z | ||
data modify storage omegaflowey:entity.utils.face_closest_player active_player_uuid set from \ | ||
storage omegaflowey:bossfight active_player_uuid | ||
|
||
function omegaflowey.entity:utils/face_closest_player_macro with storage omegaflowey:entity.utils.face_closest_player |
Oops, something went wrong.