diff --git a/Brilliance Datapack/data/do2/functions/dungeon_setup/preset_difficulty.mcfunction b/Brilliance Datapack/data/do2/functions/dungeon_setup/preset_difficulty.mcfunction index 7b52b6ef..02dc9a3d 100644 --- a/Brilliance Datapack/data/do2/functions/dungeon_setup/preset_difficulty.mcfunction +++ b/Brilliance Datapack/data/do2/functions/dungeon_setup/preset_difficulty.mcfunction @@ -1,5 +1,5 @@ execute unless entity @s[tag=do2.received_shulker] run return 0 -execute if score $dungeon do2.run.active matches 1 run return 0 +execute if score $dungeon do2.run.active matches 1.. run return 0 data merge block -557 113 1987 {Items:[]} diff --git a/Brilliance Datapack/data/do2/functions/events/on_100_ticks.mcfunction b/Brilliance Datapack/data/do2/functions/events/on_100_ticks.mcfunction index a0dc1e6b..3e41a707 100644 --- a/Brilliance Datapack/data/do2/functions/events/on_100_ticks.mcfunction +++ b/Brilliance Datapack/data/do2/functions/events/on_100_ticks.mcfunction @@ -7,7 +7,7 @@ execute as @a[scores={do2.logs.spam=2..}] run tellraw @s ["",{"text":"[§9B§r]: # 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.run.active matches 1.. run function do2:scoreboard/config/config_lock # Check if anything needs to be updated due to Level Controller changes. # TODO: also update mob names, and amount. diff --git a/Brilliance Datapack/data/do2/functions/events/on_datapack_tick.mcfunction b/Brilliance Datapack/data/do2/functions/events/on_datapack_tick.mcfunction index ccb3d994..2449dd01 100644 --- a/Brilliance Datapack/data/do2/functions/events/on_datapack_tick.mcfunction +++ b/Brilliance Datapack/data/do2/functions/events/on_datapack_tick.mcfunction @@ -12,16 +12,16 @@ execute as @a[team=do2.players, scores={do2.run.has_died=1}] run function do2:ev execute as @e[type=player,scores={do2.utility.deathCount=1..}] run function do2:events/on_player_respawned # if all players running do2 dead, end game. -execute if score $dungeon do2.run.active matches 1 if score $dungeon do2.run.player_deaths = $dungeon do2.run.players run function do2:events/on_game_end +execute if score $dungeon do2.run.active matches 2 if score $dungeon do2.run.player_deaths = $dungeon do2.run.players run function do2:events/on_game_end # if no players running do2 but game active for 5 minutes, end game. -execute if score $dungeon do2.run.active matches 1 if score $dungeon do2.run.timeWithNoPlayers matches 300 run function do2:events/on_game_end +execute if score $dungeon do2.run.active matches 2 if score $dungeon do2.run.timeWithNoPlayers matches 300 run function do2:events/on_game_end # Tango mentioned this and I think we removed it on accident. # Remove glowing effect from Evokers. -execute if score $dungeon do2.run.active matches 1 as @e[type=minecraft:evoker] if entity @s[nbt={ActiveEffects:[{Id:24}]}] run effect clear @s minecraft:glowing +execute if score $dungeon do2.run.active matches 2 as @e[type=minecraft:evoker] if entity @s[nbt={ActiveEffects:[{Id:24}]}] run effect clear @s minecraft:glowing # Remove glowing effect from Witches. -execute if score $dungeon do2.run.active matches 1 as @e[type=minecraft:witch] if entity @s[nbt={ActiveEffects:[{Id:24}]}] run effect clear @s minecraft:glowing +execute if score $dungeon do2.run.active matches 2 as @e[type=minecraft:witch] if entity @s[nbt={ActiveEffects:[{Id:24}]}] run effect clear @s minecraft:glowing # Have vex track players better execute if score $dungeon do2.config.vexTracking matches 1 run function do2:force_vex_tracking diff --git a/Brilliance Datapack/data/do2/functions/events/on_game_end.mcfunction b/Brilliance Datapack/data/do2/functions/events/on_game_end.mcfunction index 2f87cf3a..c203ae11 100644 --- a/Brilliance Datapack/data/do2/functions/events/on_game_end.mcfunction +++ b/Brilliance Datapack/data/do2/functions/events/on_game_end.mcfunction @@ -1,7 +1,7 @@ # - Start Log - # Detect which method game ended. -execute as @a[scores={do2.logs.gamestate=1..}] if score $dungeon do2.run.active matches 1 if score $dungeon do2.run.player_deaths = $dungeon do2.run.players run tellraw @s ["",{"text":"§f[§9B§r]: Game Ended. ("},{"text":" ? ","color":"dark_red","hoverEvent":{"action":"show_text","contents":["",{"text":"§rAll "},{"score":{"name":"$dungeon","objective":"do2.run.players"},"color":"aqua"},{"text":" players have died at least once."}]}},{"text":")"}] -execute as @a[scores={do2.logs.gamestate=1..}] if score $dungeon do2.run.active matches 1 if score $dungeon do2.run.timeWithNoPlayers matches 300 run tellraw @s ["",{"text":"§f[§9B§r]: Game Ended. ("},{"text":" ? ","color":"dark_red","hoverEvent":{"action":"show_text","contents":["",{"text":"§rGame has been inactive for too long. §7do.run.empty §rmatches "},{"score":{"name":"$dungeon","objective":"do2.run.timeWithNoPlayers "},"color":"aqua"}]}},{"text":")"}] +execute as @a[scores={do2.logs.gamestate=1..}] if score $dungeon do2.run.active matches 2 if score $dungeon do2.run.player_deaths = $dungeon do2.run.players run tellraw @s ["",{"text":"§f[§9B§r]: Game Ended. ("},{"text":" ? ","color":"dark_red","hoverEvent":{"action":"show_text","contents":["",{"text":"§rAll "},{"score":{"name":"$dungeon","objective":"do2.run.players"},"color":"aqua"},{"text":" players have died at least once."}]}},{"text":")"}] +execute as @a[scores={do2.logs.gamestate=1..}] if score $dungeon do2.run.active matches 2 if score $dungeon do2.run.timeWithNoPlayers matches 300 run tellraw @s ["",{"text":"§f[§9B§r]: Game Ended. ("},{"text":" ? ","color":"dark_red","hoverEvent":{"action":"show_text","contents":["",{"text":"§rGame has been inactive for too long. §7do.run.empty §rmatches "},{"score":{"name":"$dungeon","objective":"do2.run.timeWithNoPlayers "},"color":"aqua"}]}},{"text":")"}] # - End Log - # called when no players are RUNNING the dungeon's instance. (all dead, all left) diff --git a/Brilliance Datapack/data/do2/functions/events/on_game_start.mcfunction b/Brilliance Datapack/data/do2/functions/events/on_game_start.mcfunction index 41f2073d..d8cdd4ea 100644 --- a/Brilliance Datapack/data/do2/functions/events/on_game_start.mcfunction +++ b/Brilliance Datapack/data/do2/functions/events/on_game_start.mcfunction @@ -29,6 +29,7 @@ function do2:scoreboard/dungeon_per_run scoreboard players set @a[team=do2.players] do2.utility.shouldForceFood 0 scoreboard players add @a[team=do2.players] do2.runs 1 scoreboard players add $dungeon do2.runs 1 +scoreboard players set $dungeon do2.run.active 2 #revoke all utility advancements. These are used for additional conditions advancement revoke @a from do2:utility/root diff --git a/Brilliance Datapack/data/do2/functions/events/on_player_join.mcfunction b/Brilliance Datapack/data/do2/functions/events/on_player_join.mcfunction index 3612a312..e91c978f 100644 --- a/Brilliance Datapack/data/do2/functions/events/on_player_join.mcfunction +++ b/Brilliance Datapack/data/do2/functions/events/on_player_join.mcfunction @@ -15,8 +15,8 @@ advancement revoke @s from do2:visible/cards/cards_root advancement revoke @s from do2:visible/survival/survival_root advancement revoke @s from do2:visible/adventuring/adventuring_root -execute if score $dungeon do2.run.active matches 1 unless entity @s[tag=do2.running] run function do2:scoreboard/spectator_per_run -execute if score $dungeon do2.run.active matches 1 unless entity @s[tag=do2.running] run tag @s remove do2.received_shulker +execute if score $dungeon do2.run.active matches 1.. unless entity @s[tag=do2.running] run function do2:scoreboard/spectator_per_run +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 function do2:voice_chat/check @@ -24,7 +24,7 @@ execute if score @s do2.utility.voiceChat matches 0 run tag @s add do2.tags.audi execute unless score @s do2.utility.voiceChat matches 0 run tag @s remove do2.tags.audio.enabled # 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 +execute if score $dungeon do2.run.active 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 @@ -33,4 +33,4 @@ execute positioned -547 113 1980 if entity @s[distance=..5] at @s run tp @s ~ ~ execute positioned -524 103 2167 if entity @s[distance=..10] at @s run tp @s ~ ~ ~ 180 -20 # If game hasn't started. Swap the difficulty, to the user's last used difficulty. -execute unless score $dungeon do2.run.active matches 1 as @p[tag=do2.received_shulker] run function do2:dungeon_setup/preset_difficulty +execute unless score $dungeon do2.run.active matches 1.. as @p[tag=do2.received_shulker] run function do2:dungeon_setup/preset_difficulty diff --git a/Brilliance Datapack/data/do2/functions/events/on_tick.mcfunction b/Brilliance Datapack/data/do2/functions/events/on_tick.mcfunction index 22d05ed2..c12e0bc8 100644 --- a/Brilliance Datapack/data/do2/functions/events/on_tick.mcfunction +++ b/Brilliance Datapack/data/do2/functions/events/on_tick.mcfunction @@ -21,7 +21,7 @@ execute if score $dungeon do2.utility.currentTick matches 10000000.. run scorebo execute as @a if score @s do2.utility.advancementOrdering matches 0 run function do2:advancements/grant_visible/all # track ticks/seconds in the dungeon. Also handles if dungeon is empty. -execute if score $dungeon do2.run.active matches 1 run function do2:dungeon_timer +execute if score $dungeon do2.run.active matches 2 run function do2:dungeon_timer # For every UNTRACKED item, (item entities not tagged) diff --git a/Brilliance Datapack/data/do2/functions/version.mcfunction b/Brilliance Datapack/data/do2/functions/version.mcfunction index 5d6f6103..0ffe49c2 100644 --- a/Brilliance Datapack/data/do2/functions/version.mcfunction +++ b/Brilliance Datapack/data/do2/functions/version.mcfunction @@ -1,4 +1,4 @@ -# DATAPACK VERSION NUMBER: 0.12.0 +# DATAPACK VERSION NUMBER: 0.12.1 -tellraw @s ["",{"text":"The §o§n§aBrilliance Datapack§r's version is: [§b0.12.0§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.12.1§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":"."}]