Skip to content

Commit

Permalink
(0.14.37) Practice mode now can adjust game settings.
Browse files Browse the repository at this point in the history
  • Loading branch information
Frustrated-Programmer committed Feb 9, 2025
1 parent e452674 commit a58295a
Show file tree
Hide file tree
Showing 18 changed files with 88 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ execute as @a[scores={do2.logs.spam=2..}] run tellraw @s ["",{"text":"[§9B§r]:
# - End Log -


# Lock/Unlock Settings room
execute if score $dungeon do2.run.active matches 0 run function do2:scoreboard/config/config_unlock
execute if score $dungeon do2.run.active matches 1.. run function do2:scoreboard/config/config_lock

execute if score $dungeon do2.config.ec.controlSummons matches 0 if score $dungeon do2.run.active matches 0 run function do2:dungeon_setup/legacy/test_for_ravagers
execute if score $dungeon do2.config.ec.controlSummons matches 0 if score $dungeon do2.run.active matches 0 run function do2:dungeon_setup/legacy/test_for_wardens
execute if score $dungeon do2.config.ec.controlSummons matches 0 if score $dungeon do2.run.active matches 0 run function do2:dungeon_setup/legacy/test_for_other_killers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ execute as @a[advancements={do2:visible/credits/credits_root=false}] run functio
function do2:vanilla_compatability/gui/collect_values/update_scoreboard
function do2:vanilla_compatability/gui/update_has_map_tag/invoke_update

# Lock/Unlock Settings room
execute unless score $dungeon do2.utility.lockConfigRoom matches 1..2 run function do2:scoreboard/config/config_unlock
execute if score $dungeon do2.utility.lockConfigRoom matches 1 run function do2:scoreboard/config/config_lock
execute if score $dungeon do2.utility.lockConfigRoom matches 2 run function do2:scoreboard/config/config_lock_inverse


# Attempt every 5 second updates:
scoreboard players set $dungeon do2.utility.checkTick 5
scoreboard players operation $five_seconds do2.config.ticksPerSecond = $dungeon do2.config.ticksPerSecond
Expand All @@ -46,4 +52,4 @@ scoreboard players operation $dungeon_five do2.utility.checkTick %= $five_second
execute if score $dungeon_five do2.utility.checkTick matches 0 run function do2:events/on_100_ticks

# Agronet event
execute as @a[team=do2.players] run function do2:external/agronet/logs/spam/on_20_ticks
execute as @a[team=do2.players] run function do2:external/agronet/logs/spam/on_20_ticks
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ scoreboard players set $dungeon do2.utility.dungeonRepair 1
scoreboard players set $dungeon do2.run.players 0

# Lock Up Settings
scoreboard players set do2.utility.lockConfigRoom 1
function do2:scoreboard/config/config_lock

# Make sure that the redstone block keeping the iron door open is removed
Expand All @@ -54,5 +55,8 @@ setblock -551 119 1977 air
# Make sure all players are able to have map enabled
execute as @e[team=do2.players] run function do2:vanilla_compatability/gui/interface/detect

# Disable setting triggers
execute as @a[tag=!do2.fakePlayers] run trigger do2.trigger.settings add 0

# Agronet event
function do2:external/agronet/logs/gamestate/on_game_load
function do2:external/agronet/logs/gamestate/on_game_load
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ execute if score $dungeon do2.run.active matches 1.. unless entity @s[tag=do2.ru
execute if score $dungeon do2.run.active matches 1.. unless entity @s[tag=do2.running] run tag @s remove do2.received_shulker
function do2:scoreboard/triggers/on_player_join

# If player is in the settings room while game is active, lock the settings room. Ensure player gets TP'ed out
execute if score $dungeon do2.run.active matches 1.. run function do2:scoreboard/config/config_lock
# If player is in the settings room while room is locked out, lock the settings room. Ensure player gets TP'ed out
execute if score $dungeon do2.utility.lockConfigRoom matches 1 run function do2:scoreboard/config/config_lock

# If player is at LOBBY worldspawn when joining, Teleport them rotated properly
execute positioned -547 113 1980 if entity @s[distance=..5] at @s run tp @s ~ ~ ~ 90 0
Expand All @@ -33,7 +33,11 @@ execute if score $dungeon do2.utility.onInstance matches 1 unless score $dungeon

# Check if player needs AUDIO compatability
tag @s add do2.audio_checking
schedule function do2:vanilla_compatability/audio/interface/detect 5t
schedule function do2:vanilla_compatability/audio/interface/detect 5t append

# Check if we should enable player's ability to enter in the setting's room
tag @s add do2.setting_room_checking
schedule function do2:external/tracked_out/check_if_setting_room_trigger 5t append

# Agronet event
function do2:external/agronet/logs/spam/on_player_join
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Code needed to delay this function.
execute unless entity @s[tag=do2.setting_room_checking2] as @a[tag=do2.setting_room_checking] run tag @s add do2.setting_room_checking2
execute unless entity @s[tag=do2.setting_room_checking2] as @a[tag=do2.setting_room_checking] run function do2:external/tracked_out/check_if_setting_room_trigger
tag @a remove do2.setting_room_checking
execute unless entity @s[tag=do2.setting_room_checking2] if entity @a[tag=do2.setting_room_checking2] run return 0
tag @a remove do2.setting_room_checking2

# do2.utility.runType
# 0 = unknown
# 1 = practice
# 2 = comp

execute unless score @p[tag=do2.received_shulker] do2.utility.runType matches 1 run return 0
execute unless score $dungeon do2.run.active matches 0 run return 0

scoreboard players enable @s do2.trigger.settings

# Lock setting's room
scoreboard players set $dungeon do2.utility.lockConfigRoom 2
function do2:scoreboard/config/config_lock_inverse
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# No need for these datapacks
datapack disable "file/armor_statues_v2.9.4-trackedout.zip"
execute if score $dungeon do2.utility.onServer matches 1 run datapack disable "file/armor_statues_v2.9.4-trackedout.zip"
datapack disable "file/decked_out.zip"
datapack disable "file/bundles 1.20.zip"
datapack disable "file/hard on start v1.0.0.zip"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ execute unless entity @e[tag=do2.stop_settings2] run summon minecraft:armor_stan
execute unless entity @e[tag=do2.stop_settings3] run summon minecraft:item_display -514.4 116 1956 {Tags:["do2.stop_settings","do2.stop_settings3"],width:1f,height:1f,item:{id:"minecraft:barrier",Count:1b},view_range:2f,transformation:{left_rotation:[0f,-1f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0f,0f],scale:[0.8f,0.8f,2f]}}
fill -515 118 1954 -515 114 1958 minecraft:iron_bars replace air

# Hide the names if an entity isn't nearby
execute positioned -515 116 1956 unless entity @p[distance=..20] as @e[type=armor_stand,tag=do2.stop_settings] run data merge entity @s {CustomNameVisible:0b}
execute positioned -515 116 1956 if entity @p[distance=..20] as @e[type=armor_stand,tag=do2.stop_settings] run data merge entity @s {CustomNameVisible:1b}

execute as @a[x=-539,dx=24,y=113,dy=7,z=1938,dz=23] if entity @s[tag=do2.staff,tag=!do2.staff.warned] run tellraw @s ["",{"text":"§f[§9B§r]: You have the tag [§bdo2.staff§r], and this has stopped:\n - §5tp "},{"selector":"@s","color":"dark_purple"},{"text":"§5-512 114 1956 90 0\n§f[§9B§r]: Click "},{"text":"§b[here]","clickEvent":{"action":"run_command","value":"/tp @s -512 114 1956 90 0"}},{"text":" to run the command anyway."}]
execute as @a[x=-539,dx=24,y=113,dy=7,z=1938,dz=23] if entity @s[tag=do2.staff,tag=!do2.staff.warned] run tag @s add do2.staff.warned
execute as @a[x=-539,dx=24,y=113,dy=7,z=1938,dz=23] unless entity @s[tag=do2.staff] run tp @s -512 114 1956 90 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
execute unless entity @e[tag=do2.stop_settings1] run summon minecraft:armor_stand -515. 115 1956 {CustomName:'{"text":"Rest of world inaccessible.","color":"red"}',CustomNameVisible:1b,Invisible:1b,Invulnerable:1b,NoBasePlate:1b,NoGravity:1b,Small:1b,Tags:["do2.stop_settings","do2.stop_settings1"]}
execute unless entity @e[tag=do2.stop_settings2] run summon minecraft:armor_stand -515.5 113.7 1956 {CustomName:'{"text":"Approach to return to game.","color":"red"}',CustomNameVisible:1b,Invisible:1b,Invulnerable:1b,NoBasePlate:1b,NoGravity:1b,Small:1b,Tags:["do2.stop_settings","do2.stop_settings2"]}
execute unless entity @e[tag=do2.stop_settings3] run summon minecraft:item_display -514.65 116 1956 {Tags:["do2.stop_settings","do2.stop_settings3"],width:1f,height:1f,item:{id:"minecraft:barrier",Count:1b},view_range:2f,transformation:{left_rotation:[0f,-1f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0f,0f],scale:[0.8f,0.8f,2f]}}
fill -515 118 1954 -515 114 1958 minecraft:iron_bars replace air

# Hide the names if an entity isn't nearby
execute positioned -515 116 1956 unless entity @p[distance=..10] as @e[type=armor_stand,tag=do2.stop_settings] run data merge entity @s {CustomNameVisible:0b}
execute positioned -515 116 1956 if entity @p[distance=..10] as @e[type=armor_stand,tag=do2.stop_settings] run data merge entity @s {CustomNameVisible:1b}


execute as @a[x=-517,dx=1,y=113,dy=7,z=1953,dz=6] if entity @s[tag=do2.staff,tag=!do2.staff.warned] run tellraw @s ["",{"text":"§f[§9B§r]: You have the tag [§bdo2.staff§r], and this has stopped:\n - §5tp "},{"selector":"@s","color":"dark_purple"},{"text":"§5-550 113 1980 90 0\n§f[§9B§r]: Click "},{"text":"§b[here]","clickEvent":{"action":"run_command","value":"/tp @s -512 114 1956 90 0"}},{"text":" to run the command anyway."}]
execute as @a[x=-517,dx=1,y=113,dy=7,z=1953,dz=6] if entity @s[tag=do2.staff,tag=!do2.staff.warned] run tag @s add do2.staff.warned

execute as @a[x=-517,dx=1,y=113,dy=7,z=1953,dz=6] unless entity @s[tag=do2.staff] run tp @s -550 113 1980 90 0
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ scoreboard players set @s do2.run.gauntlet_survival 0
advancement revoke @s only do2:utility/survive_death_gauntlet

# Reset certain advancements
function do2:advancements/reset_key_advancemets
function do2:advancements/reset_key_advancements

# Ensure Gamemode
execute if entity @s[gamemode=adventure] run scoreboard players set @s do2.utility.oldGamemode 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ scoreboard objectives add do2.config.maxClankBerries dummy "Whether to allow ber

# Player Config: Player's last used Dungeon Difficulty.
scoreboard objectives add do2.config.dungeonDifficulty dummy "Dungeon Difficulty"
# Player Config: Silence wardens when unneeded.
scoreboard objectives add do2.config.silenceWardens dummy "Silent Wardens"

# ================
# - SET DEFAULTS -
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ scoreboard objectives add do2.utility.oldDungeonLocation dummy "Used to check wh
scoreboard objectives add do2.utility.arrayIndex dummy
scoreboard objectives add do2.utility.l4ShriekerScreamed dummy "Used to check WHICH l4 shrieker is true"
scoreboard objectives add do2.utility.mobSwitchCounter dummy "Used to count mobs needed for an active mob switch"
scoreboard objectives add do2.utility.lockConfigRoom dummy "Used to tell whether the config room needs to be locked"


# - Entity Controller - (entity_controller)
Expand Down Expand Up @@ -67,4 +68,4 @@ scoreboard objectives add do2.utility.key_4ToGive dummy "Level 4 key left to giv
scoreboard objectives add do2.utility.voiceChat dummy "Voice Chat installed"

# Note: for tracked out instances only:
scoreboard objectives add do2.utility.runType dummy "Used tell what kind of run this dungeon is running."
scoreboard objectives add do2.utility.runType dummy "Used tell what kind of run this dungeon is running."
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# happens every datapack tick
execute as @a unless entity @s[scores={do2.trigger.logs=0}] run function do2:scoreboard/triggers/t_logs
execute as @a unless entity @s[scores={do2.trigger.version=0}] run function do2:scoreboard/triggers/t_version
execute as @a unless entity @s[scores={do2.trigger.map=0}] run function do2:scoreboard/triggers/t_map
execute as @a unless entity @s[scores={do2.trigger.playsound=0}] run function do2:scoreboard/triggers/t_playsound
execute as @a unless entity @s[scores={do2.trigger.gui=0}] run function do2:scoreboard/triggers/t_gui
execute as @a unless entity @s[scores={do2.trigger.silenceWardens=0}] run function do2:scoreboard/triggers/t_silence_wardens
execute as @a[tag=!do2.fakePlayer] unless entity @s[scores={do2.trigger.logs=0}] run function do2:scoreboard/triggers/t_logs
execute as @a[tag=!do2.fakePlayer] unless entity @s[scores={do2.trigger.version=0}] run function do2:scoreboard/triggers/t_version
execute as @a[tag=!do2.fakePlayer] unless entity @s[scores={do2.trigger.map=0}] run function do2:scoreboard/triggers/t_map
execute as @a[tag=!do2.fakePlayer] unless entity @s[scores={do2.trigger.playsound=0}] run function do2:scoreboard/triggers/t_playsound
execute as @a[tag=!do2.fakePlayer] unless entity @s[scores={do2.trigger.gui=0}] run function do2:scoreboard/triggers/t_gui
execute as @a[tag=!do2.fakePlayer] unless entity @s[scores={do2.trigger.settings=0}] run function do2:scoreboard/triggers/t_settings
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
execute if entity @s[tag=!do2.fakePlayer] run return 0

scoreboard players set @s do2.trigger.logs 0
scoreboard players set @s do2.trigger.version 0
scoreboard players set @s do2.trigger.map 0
scoreboard players set @s do2.trigger.playsound 0
scoreboard players set @s do2.trigger.gui 0
scoreboard players set @s do2.trigger.silenceWardens 0

scoreboard players enable @s[tag=do2.staff] do2.trigger.logs
scoreboard players enable @s do2.trigger.version
scoreboard players enable @s do2.trigger.map
scoreboard players enable @s do2.trigger.playsound
scoreboard players enable @s do2.trigger.gui
#scoreboard players enable @s[team=do2.players] do2.trigger.silenceWardens
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,23 @@ execute as @a[scores={do2.logs.dev=1..}] run tellraw @s ["",{"text":"[§9B§r]:
# - End Log -

scoreboard objectives add do2.trigger.logs trigger "detect logs trigger"
scoreboard players enable @a[tag=do2.staff] do2.trigger.logs
scoreboard players enable @a[tag=!do2.fakePlayer,tag=do2.staff] do2.trigger.logs

scoreboard objectives add do2.trigger.version trigger "detect version trigger"
scoreboard players enable @a do2.trigger.version
scoreboard players enable @a[tag=!do2.fakePlayer] do2.trigger.version

scoreboard objectives add do2.trigger.map trigger "detect map trigger"
scoreboard players enable @a do2.trigger.map
scoreboard players enable @a[tag=!do2.fakePlayer] do2.trigger.map

scoreboard objectives add do2.trigger.playsound trigger "detect playsound trigger"
scoreboard players enable @a do2.trigger.playsound
scoreboard players enable @a[tag=!do2.fakePlayer] do2.trigger.playsound

scoreboard objectives add do2.trigger.gui trigger "detect gui trigger"
scoreboard players enable @a do2.trigger.gui
scoreboard players enable @a[tag=!do2.fakePlayer] do2.trigger.gui

scoreboard objectives add do2.trigger.settings trigger "detect settings trigger"
scoreboard players enable @a[tag=!do2.fakePlayer,tag=do2.staff] do2.trigger.settings

scoreboard objectives add do2.trigger.silenceWardens trigger "detect silenceWardens trigger"
#scoreboard players enable @a[team=do2.players] do2.trigger.silenceWardens

# Agronet event
function do2:external/agronet/logs/dev/scoreboard_triggers_setup
function do2:external/agronet/logs/dev/scoreboard_triggers_setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
scoreboard players set @s do2.trigger.settings 0

execute unless score @p[tag=do2.received_shulker] do2.utility.runType matches 1 run return 0
execute unless score $dungeon do2.run.active matches 0 run return 0

scoreboard players enable @s do2.trigger.settings
tp @s -519 114 1956 90 0

This file was deleted.

4 changes: 2 additions & 2 deletions Brilliance Datapack/data/do2/functions/version.mcfunction
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# DATAPACK VERSION NUMBER: 0.14.36
# DATAPACK VERSION NUMBER: 0.14.37

tellraw @s ["",{"text":"The §o§n§aBrilliance Datapack§r's version is: [§b0.14.36§r] Check latest version "},{"text":"§o§b§nhere§r","clickEvent":{"action":"open_url","value":"https://github.com/trackedout/Brilliance/blob/main/Brilliance%20Datapack/data/do2/functions/version.mcfunction"}},{"text":"."}]
tellraw @s ["",{"text":"The §o§n§aBrilliance Datapack§r's version is: [§b0.14.37§r] Check latest version "},{"text":"§o§b§nhere§r","clickEvent":{"action":"open_url","value":"https://github.com/trackedout/Brilliance/blob/main/Brilliance%20Datapack/data/do2/functions/version.mcfunction"}},{"text":"."}]

0 comments on commit a58295a

Please sign in to comment.