From 5b27bfaf55d9c6beb0bde8a1b2fdcca749567736 Mon Sep 17 00:00:00 2001 From: FrustratedProgrammer Date: Tue, 9 Jul 2024 19:09:59 -0600 Subject: [PATCH] Stats can be personal/global based on playercount --- .../functions/events/on_100_ticks.mcfunction | 4 ++ .../on_player_exited_dungeon.mcfunction | 6 ++ .../scoreboard/setup/utility.mcfunction | 1 + .../{ => global}/summon_general.mcfunction | 0 .../{ => global}/summon_last_run.mcfunction | 0 .../{ => global}/summon_runs.mcfunction | 0 .../{ => global}/summon_spoilers.mcfunction | 0 .../{ => global}/summon_treasures.mcfunction | 5 +- .../statistics_room/on_tick.mcfunction | 19 ++++-- .../personal/summon_general.mcfunction | 12 ++++ .../personal/summon_last_run.mcfunction | 58 +++++++++++++++++++ .../personal/summon_runs.mcfunction | 13 +++++ .../personal/summon_spoilers.mcfunction | 32 ++++++++++ .../personal/summon_treasures.mcfunction | 13 +++++ 14 files changed, 156 insertions(+), 7 deletions(-) rename Brilliance Datapack/data/do2/functions/statistics_room/{ => global}/summon_general.mcfunction (100%) rename Brilliance Datapack/data/do2/functions/statistics_room/{ => global}/summon_last_run.mcfunction (100%) rename Brilliance Datapack/data/do2/functions/statistics_room/{ => global}/summon_runs.mcfunction (100%) rename Brilliance Datapack/data/do2/functions/statistics_room/{ => global}/summon_spoilers.mcfunction (100%) rename Brilliance Datapack/data/do2/functions/statistics_room/{ => global}/summon_treasures.mcfunction (52%) create mode 100644 Brilliance Datapack/data/do2/functions/statistics_room/personal/summon_general.mcfunction create mode 100644 Brilliance Datapack/data/do2/functions/statistics_room/personal/summon_last_run.mcfunction create mode 100644 Brilliance Datapack/data/do2/functions/statistics_room/personal/summon_runs.mcfunction create mode 100644 Brilliance Datapack/data/do2/functions/statistics_room/personal/summon_spoilers.mcfunction create mode 100644 Brilliance Datapack/data/do2/functions/statistics_room/personal/summon_treasures.mcfunction 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 3e41a707..2bfcc5c1 100644 --- a/Brilliance Datapack/data/do2/functions/events/on_100_ticks.mcfunction +++ b/Brilliance Datapack/data/do2/functions/events/on_100_ticks.mcfunction @@ -15,3 +15,7 @@ execute if score $dungeon do2.run.active matches 0 run function do2:dungeon_setu execute if score $dungeon do2.run.active matches 0 run function do2:dungeon_setup/test_for_wardens execute if score $dungeon do2.run.active matches 0 run function do2:dungeon_setup/test_for_other_killers execute if score $dungeon do2.run.active matches 0 run function do2:dungeon_setup/test_for_markers + +# Count players on the server. +scoreboard players set $dungeon do2.utility.playerCount 0 +execute as @a[name=!tangocam,name=!TangoCam] run scoreboard players add $dungeon do2.utility.playerCount 1 diff --git a/Brilliance Datapack/data/do2/functions/events/on_player_exited_dungeon.mcfunction b/Brilliance Datapack/data/do2/functions/events/on_player_exited_dungeon.mcfunction index 6daf025a..652e37d3 100644 --- a/Brilliance Datapack/data/do2/functions/events/on_player_exited_dungeon.mcfunction +++ b/Brilliance Datapack/data/do2/functions/events/on_player_exited_dungeon.mcfunction @@ -7,3 +7,9 @@ tag @s remove exitedLogTarget # - End Log - kill @e[type=vex] + +scoreboard players operation @s do2.lifetime.escaped.embers += @s do2.run.items.embers +scoreboard players operation $dungeon do2.lifetime.escaped.embers += @s do2.run.items.embers +scoreboard players operation @s do2.lifetime.escaped.crowns += @s do2.run.items.crowns +scoreboard players operation $dungeon do2.lifetime.escaped.crowns += @s do2.run.items.crowns + diff --git a/Brilliance Datapack/data/do2/functions/scoreboard/setup/utility.mcfunction b/Brilliance Datapack/data/do2/functions/scoreboard/setup/utility.mcfunction index 1cdf289c..8e9c4626 100644 --- a/Brilliance Datapack/data/do2/functions/scoreboard/setup/utility.mcfunction +++ b/Brilliance Datapack/data/do2/functions/scoreboard/setup/utility.mcfunction @@ -1,4 +1,5 @@ scoreboard objectives add do2.utility.deathCount deathCount "Check whether player has died." +scoreboard objectives add do2.utility.playerCount dummy "How many players are in the server" scoreboard objectives add do2.utility.randomNum dummy "Random Number Generator" scoreboard objectives add do2.utility.currentTick dummy "The current tick number." scoreboard objectives add do2.utility.checkTick dummy "Used for checking ticks." diff --git a/Brilliance Datapack/data/do2/functions/statistics_room/summon_general.mcfunction b/Brilliance Datapack/data/do2/functions/statistics_room/global/summon_general.mcfunction similarity index 100% rename from Brilliance Datapack/data/do2/functions/statistics_room/summon_general.mcfunction rename to Brilliance Datapack/data/do2/functions/statistics_room/global/summon_general.mcfunction diff --git a/Brilliance Datapack/data/do2/functions/statistics_room/summon_last_run.mcfunction b/Brilliance Datapack/data/do2/functions/statistics_room/global/summon_last_run.mcfunction similarity index 100% rename from Brilliance Datapack/data/do2/functions/statistics_room/summon_last_run.mcfunction rename to Brilliance Datapack/data/do2/functions/statistics_room/global/summon_last_run.mcfunction diff --git a/Brilliance Datapack/data/do2/functions/statistics_room/summon_runs.mcfunction b/Brilliance Datapack/data/do2/functions/statistics_room/global/summon_runs.mcfunction similarity index 100% rename from Brilliance Datapack/data/do2/functions/statistics_room/summon_runs.mcfunction rename to Brilliance Datapack/data/do2/functions/statistics_room/global/summon_runs.mcfunction diff --git a/Brilliance Datapack/data/do2/functions/statistics_room/summon_spoilers.mcfunction b/Brilliance Datapack/data/do2/functions/statistics_room/global/summon_spoilers.mcfunction similarity index 100% rename from Brilliance Datapack/data/do2/functions/statistics_room/summon_spoilers.mcfunction rename to Brilliance Datapack/data/do2/functions/statistics_room/global/summon_spoilers.mcfunction diff --git a/Brilliance Datapack/data/do2/functions/statistics_room/summon_treasures.mcfunction b/Brilliance Datapack/data/do2/functions/statistics_room/global/summon_treasures.mcfunction similarity index 52% rename from Brilliance Datapack/data/do2/functions/statistics_room/summon_treasures.mcfunction rename to Brilliance Datapack/data/do2/functions/statistics_room/global/summon_treasures.mcfunction index 2c386835..762e7bee 100644 --- a/Brilliance Datapack/data/do2/functions/statistics_room/summon_treasures.mcfunction +++ b/Brilliance Datapack/data/do2/functions/statistics_room/global/summon_treasures.mcfunction @@ -6,7 +6,8 @@ execute unless score $dungeon do2.lifetime.coinsconverted matches 0.. run scoreb execute unless score $dungeon do2.lifetime.pickedup.crowns matches 0.. run scoreboard players set $dungeon do2.lifetime.pickedup.crowns 0 execute unless score $dungeon do2.lifetime.pickedup.coins matches 0.. run scoreboard players set $dungeon do2.lifetime.pickedup.coins 0 execute unless score $dungeon do2.lifetime.pickedup.embers matches 0.. run scoreboard players set $dungeon do2.lifetime.pickedup.embers 0 -execute unless score $dungeon do2.run.active matches 0.. run scoreboard players set $dungeon do2.run.active 0 +execute unless score $dungeon do2.lifetime.escaped.embers matches 0.. run scoreboard players set $dungeon do2.lifetime.escaped.embers 0 +execute unless score $dungeon do2.lifetime.escaped.crowns matches 0.. run scoreboard players set $dungeon do2.lifetime.escaped.crowns 0 execute unless entity @e[tag=do2.statistics_room,tag=do2.stats.treasures] run summon minecraft:text_display -492 124.3 1990 {Rotation:[90f,0f], billboard:"fixed",background:26,Tags:["do2.statistics_room","do2.stats.treasures"]} -execute as @e[tag=do2.statistics_room,tag=do2.stats.treasures] if entity @s run data merge entity @s {text:'[{"text":"§l§eTreasure §fStatistics!§r\\n\\n§fCrowns Picked Up: §o§c"},{"score":{"name":"$dungeon","objective":"do2.lifetime.pickedup.crowns"},"color":"aqua","italic":"true"},{"text":"\\n§fCrowns Escaped With: §o§c"},{"score":{"name":"$dungeon","objective":"do2.run.active"},"color":"red","italic":"true"},{"text":"\\n§fCoins Picked Up: §o§c"},{"score":{"name":"$dungeon","objective":"do2.lifetime.pickedup.coins"},"color":"aqua","italic":"true"},{"text":"\\n§fCoins Converted: §o§c"},{"score":{"name":"$dungeon","objective":"do2.lifetime.coinsconverted"},"color":"aqua","italic":"true"},{"text":"\\n§fCrowns Spent: §o§b"},{"score":{"name":"$dungeon","objective":"do2.lifetime.spent.crowns"},"color":"aqua","italic":"true"},{"text":"\\n\\n§l§bFrost Embers §fStatistics!§r\\n\\nFrost Embers Picked Up: "},{"score":{"name":"$dungeon","objective":"do2.lifetime.pickedup.embers"},"color":"aqua","italic":"true"},{"text":"\\n§fFrost Embers Escaped With: §o§c"},{"score":{"name":"$dungeon","objective":"do2.run.active"},"color":"red","italic":"true"},{"text":"\\n§fFrost Embers Spent: §o§b"},{"score":{"name":"$dungeon","objective":"do2.lifetime.spent.embers"},"color":"aqua","italic":"true"}]'} +execute as @e[tag=do2.statistics_room,tag=do2.stats.treasures] if entity @s run data merge entity @s {text:'[{"text":"§l§eTreasure §fStatistics!§r\\n\\n§fCrowns Picked Up: §o§c"},{"score":{"name":"$dungeon","objective":"do2.lifetime.pickedup.crowns"},"color":"aqua","italic":"true"},{"text":"\\n§fCrowns Escaped With: §o§c"},{"score":{"name":"$dungeon","objective":"do2.lifetime.escaped.crowns"},"color":"aqua","italic":"true"},{"text":"\\n§fCoins Picked Up: §o§c"},{"score":{"name":"$dungeon","objective":"do2.lifetime.pickedup.coins"},"color":"aqua","italic":"true"},{"text":"\\n§fCoins Converted: §o§c"},{"score":{"name":"$dungeon","objective":"do2.lifetime.coinsconverted"},"color":"aqua","italic":"true"},{"text":"\\n§fCrowns Spent: §o§b"},{"score":{"name":"$dungeon","objective":"do2.lifetime.spent.crowns"},"color":"aqua","italic":"true"},{"text":"\\n\\n§l§bFrost Embers §fStatistics!§r\\n\\nFrost Embers Picked Up: "},{"score":{"name":"$dungeon","objective":"do2.lifetime.pickedup.embers"},"color":"aqua","italic":"true"},{"text":"\\n§fFrost Embers Escaped With: §o§c"},{"score":{"name":"$dungeon","objective":"do2.lifetime.escaped.embers"},"color":"aqua","italic":"true"},{"text":"\\n§fFrost Embers Spent: §o§b"},{"score":{"name":"$dungeon","objective":"do2.lifetime.spent.embers"},"color":"aqua","italic":"true"}]'} diff --git a/Brilliance Datapack/data/do2/functions/statistics_room/on_tick.mcfunction b/Brilliance Datapack/data/do2/functions/statistics_room/on_tick.mcfunction index b48346de..bbca4af2 100644 --- a/Brilliance Datapack/data/do2/functions/statistics_room/on_tick.mcfunction +++ b/Brilliance Datapack/data/do2/functions/statistics_room/on_tick.mcfunction @@ -11,9 +11,18 @@ execute unless entity @a[tag=do2.inStatsRoom] run kill @e[tag=do2.statistics_roo # Don't allow spawning stats display unless player nearby execute unless entity @a[tag=do2.inStatsRoom] run return 0 + + # Eventually able to swap tabs of stats -execute if score $dungeon do2.utility.statsScreen matches 0 run function do2:statistics_room/summon_general -execute if score $dungeon do2.utility.statsScreen matches 1 run function do2:statistics_room/summon_treasures -execute if score $dungeon do2.utility.statsScreen matches 2 run function do2:statistics_room/summon_runs -execute if score $dungeon do2.utility.statsScreen matches 3 run function do2:statistics_room/summon_last_run -execute if score $dungeon do2.utility.statsScreen matches 5 run function do2:statistics_room/summon_spoilers +# For cases with more than one player online, show GLOBAL stats +execute unless score $dungeon do2.utility.playerCount matches 1 if score $dungeon do2.utility.statsScreen matches 0 run function do2:statistics_room/global/summon_general +execute unless score $dungeon do2.utility.playerCount matches 1 if score $dungeon do2.utility.statsScreen matches 1 run function do2:statistics_room/global/summon_treasures +execute unless score $dungeon do2.utility.playerCount matches 1 if score $dungeon do2.utility.statsScreen matches 2 run function do2:statistics_room/global/summon_runs +execute unless score $dungeon do2.utility.playerCount matches 1 if score $dungeon do2.utility.statsScreen matches 3 run function do2:statistics_room/global/summon_last_run +execute unless score $dungeon do2.utility.playerCount matches 1 if score $dungeon do2.utility.statsScreen matches 5 run function do2:statistics_room/global/summon_spoilers +# For cases with exactly one player online, show PERSONAL stats +execute if score $dungeon do2.utility.playerCount matches 1 if score $dungeon do2.utility.statsScreen matches 0 run function do2:statistics_room/personal/summon_general +execute if score $dungeon do2.utility.playerCount matches 1 if score $dungeon do2.utility.statsScreen matches 1 run function do2:statistics_room/personal/summon_treasures +execute if score $dungeon do2.utility.playerCount matches 1 if score $dungeon do2.utility.statsScreen matches 2 run function do2:statistics_room/personal/summon_runs +execute if score $dungeon do2.utility.playerCount matches 1 if score $dungeon do2.utility.statsScreen matches 3 run function do2:statistics_room/personal/summon_last_run +execute if score $dungeon do2.utility.playerCount matches 1 if score $dungeon do2.utility.statsScreen matches 5 run function do2:statistics_room/personal/summon_spoilers diff --git a/Brilliance Datapack/data/do2/functions/statistics_room/personal/summon_general.mcfunction b/Brilliance Datapack/data/do2/functions/statistics_room/personal/summon_general.mcfunction new file mode 100644 index 00000000..f24d1e5c --- /dev/null +++ b/Brilliance Datapack/data/do2/functions/statistics_room/personal/summon_general.mcfunction @@ -0,0 +1,12 @@ +kill @e[tag=do2.statistics_room,tag=!do2.stats.general] + +execute unless score @p do2.runs matches 0.. run scoreboard players set @p do2.runs 0 +execute unless score @p do2.wins matches 0.. run scoreboard players set @p do2.wins 0 +execute unless score @p do2.losses matches 0.. run scoreboard players set @p do2.losses 0 +execute unless score @p do2.eggs.total matches 0.. run scoreboard players set @p do2.eggs.total 0 +execute unless score @p do2.highest_win_streak matches 0.. run scoreboard players set @p do2.highest_win_streak 0 +execute unless score @p do2.win_streak matches 0.. run scoreboard players set @p do2.win_streak 0 + + +execute unless entity @e[tag=do2.statistics_room,tag=do2.stats.general] run summon minecraft:text_display -492 125 1990 {Rotation:[90f,0f], billboard:"fixed",background:26,Tags:["do2.statistics_room","do2.stats.general"]} +execute as @e[tag=do2.statistics_room,tag=do2.stats.general] if entity @s run data merge entity @s {text:'[{"text":"§lStatistics!§r\\n\\n§fTotal Runs: §o§b"},{"score":{"name":"@p","objective":"do2.runs"},"color":"aqua","italic":"true"},{"text":"\\n§fTotal Wins: §o§b"},{"score":{"name":"@p","objective":"do2.wins"},"color":"aqua","italic":"true"},{"text":"\\n§fTotal Losses: §o§b"},{"score":{"name":"@p","objective":"do2.losses"},"color":"aqua","italic":"true"},{"text":"\\n§fHighest Win Streak: §o§b"},{"score":{"name":"@p","objective":"do2.highest_win_streak"},"color":"aqua","italic":"true"},{"text":"\\n§fCurrent Win Streak: §o§b"},{"score":{"name":"@p","objective":"do2.win_streak"},"color":"aqua","italic":"true"},{"text":"\\n§fEggs Found: §o§b"},{"score":{"name":"@p","objective":"do2.eggs.total"},"color":"aqua","italic":"true"},{"text":"§f/§o§b20"}]'} diff --git a/Brilliance Datapack/data/do2/functions/statistics_room/personal/summon_last_run.mcfunction b/Brilliance Datapack/data/do2/functions/statistics_room/personal/summon_last_run.mcfunction new file mode 100644 index 00000000..fcb55f78 --- /dev/null +++ b/Brilliance Datapack/data/do2/functions/statistics_room/personal/summon_last_run.mcfunction @@ -0,0 +1,58 @@ +kill @e[tag=do2.statistics_room,tag=!do2.stats.lastRun] + +execute unless entity @e[tag=do2.statistics_room,tag=do2.stats.lastRun] run summon minecraft:text_display -492 124.3 1990 {Rotation:[90f,0f], billboard:"fixed",background:26,Tags:["do2.statistics_room","do2.stats.lastRun"]} + +# Empty Storages +data modify storage stats_display win_result set value "§c???§r§f" +data modify storage stats_display player_count set value "§c???§r§f" +data modify storage stats_display artifact_symbol set value "§c???§r§f" +data modify storage stats_display floor_embers set value "§c???§r§f" +data modify storage stats_display difficulty set value "§c???§r§f" +# Store WIN/LOSS +execute if score @p do2.run.has_won matches 1 run data modify storage stats_display win_result set value "§aWIN" +execute unless score @p do2.run.has_won matches 1 run data modify storage stats_display win_result set value "§cLOSS" +# Store Player/s +execute if score @p do2.run.players matches 1 run data modify storage stats_display player_count set value " player" +execute unless score @p do2.run.players matches 1 run data modify storage stats_display player_count set value " players" +# Store Artifact +execute if score @p do2.run.has_won matches 1 if score @p do2.run.foundArtifact matches 10 run data modify storage stats_display artifact_symbol set value "" +execute if score @p do2.run.has_won matches 1 if score @p do2.run.foundArtifact matches 11 run data modify storage stats_display artifact_symbol set value "" +execute if score @p do2.run.has_won matches 1 if score @p do2.run.foundArtifact matches 12 run data modify storage stats_display artifact_symbol set value "" +execute if score @p do2.run.has_won matches 1 if score @p do2.run.foundArtifact matches 13 run data modify storage stats_display artifact_symbol set value "" +execute if score @p do2.run.has_won matches 1 if score @p do2.run.foundArtifact matches 14 run data modify storage stats_display artifact_symbol set value "" +execute if score @p do2.run.has_won matches 1 if score @p do2.run.foundArtifact matches 15 run data modify storage stats_display artifact_symbol set value "" +execute if score @p do2.run.has_won matches 1 if score @p do2.run.foundArtifact matches 16 run data modify storage stats_display artifact_symbol set value "" +execute if score @p do2.run.has_won matches 1 if score @p do2.run.foundArtifact matches 17 run data modify storage stats_display artifact_symbol set value "" +execute if score @p do2.run.has_won matches 1 if score @p do2.run.foundArtifact matches 18 run data modify storage stats_display artifact_symbol set value "" +execute if score @p do2.run.has_won matches 1 if score @p do2.run.foundArtifact matches 19 run data modify storage stats_display artifact_symbol set value "" +execute if score @p do2.run.has_won matches 1 if score @p do2.run.foundArtifact matches 20 run data modify storage stats_display artifact_symbol set value "" +execute if score @p do2.run.has_won matches 1 if score @p do2.run.foundArtifact matches 28 run data modify storage stats_display artifact_symbol set value "" +execute if score @p do2.run.has_won matches 1 if score @p do2.run.foundArtifact matches 29 run data modify storage stats_display artifact_symbol set value "" +execute if score @p do2.run.has_won matches 1 if score @p do2.run.foundArtifact matches 30 run data modify storage stats_display artifact_symbol set value "" +execute if score @p do2.run.has_won matches 1 if score @p do2.run.foundArtifact matches 31 run data modify storage stats_display artifact_symbol set value "" +execute if score @p do2.run.has_won matches 1 if score @p do2.run.foundArtifact matches 32 run data modify storage stats_display artifact_symbol set value "" +execute if score @p do2.run.has_won matches 1 if score @p do2.run.foundArtifact matches 33 run data modify storage stats_display artifact_symbol set value "" +execute if score @p do2.run.has_won matches 1 if score @p do2.run.foundArtifact matches 34 run data modify storage stats_display artifact_symbol set value "" +execute if score @p do2.run.has_won matches 1 if score @p do2.run.foundArtifact matches 35 run data modify storage stats_display artifact_symbol set value "" +execute if score @p do2.run.has_won matches 1 if score @p do2.run.foundArtifact matches 36 run data modify storage stats_display artifact_symbol set value "" +execute if score @p do2.run.has_won matches 1 if score @p do2.run.foundArtifact matches 37 run data modify storage stats_display artifact_symbol set value "" +execute if score @p do2.run.has_won matches 1 if score @p do2.run.foundArtifact matches 38 run data modify storage stats_display artifact_symbol set value "" +execute if score @p do2.run.has_won matches 1 if score @p do2.run.foundArtifact matches 39 run data modify storage stats_display artifact_symbol set value "" +execute if score @p do2.run.has_won matches 1 if score @p do2.run.foundArtifact matches 40 run data modify storage stats_display artifact_symbol set value "" +execute if score @p do2.run.has_won matches 1 if score @p do2.run.foundArtifact matches 41 run data modify storage stats_display artifact_symbol set value "" +execute if score @p do2.run.has_won matches 1 if score @p do2.run.foundArtifact matches 42 run data modify storage stats_display artifact_symbol set value "" +execute if score @p do2.run.has_won matches 1 if score @p do2.run.foundArtifact matches 43 run data modify storage stats_display artifact_symbol set value "" +execute if score @p do2.run.has_won matches 1 if score @p do2.run.foundArtifact matches 44 run data modify storage stats_display artifact_symbol set value "" +execute unless score @p do2.run.has_won matches 1 run data modify storage stats_display artifact_symbol set value "§cN/A§r§f" +# Store Floor Embers +scoreboard players operation @p do2.utility.floorEmbers = @p do2.run.items.embers +scoreboard players operation @p do2.utility.floorEmbers -= @p do2.run.artifactValue +# Store Difficulty +execute if score @p do2.run.difficulty matches 1 run data modify storage stats_display difficulty set value "§1Easy§r§f" +execute if score @p do2.run.difficulty matches 2 run data modify storage stats_display difficulty set value "§aMedium§r§f" +execute if score @p do2.run.difficulty matches 3 run data modify storage stats_display difficulty set value "§6Hard§r§f" +execute if score @p do2.run.difficulty matches 4 run data modify storage stats_display difficulty set value "§4Deadly§r§f" +execute if score @p do2.run.difficulty matches 5 run data modify storage stats_display difficulty set value "§5Deepfrost§r§f" + + +execute as @e[tag=do2.statistics_room,tag=do2.stats.lastRun] if entity @s run data merge entity @s {text:'[{"text": "§l§5Last Run Stats!§r\\n\\n§fRun #§o§b"},{"score": {"name": "@p","objective": "do2.runs"},"color": "aqua"},{"text": " §fResult: "},{"storage": "stats_display","nbt": "win_result"},{"text": "\\n"},{"score": {"name": "@p","objective": "do2.run.players"},"color": "aqua"},{"storage": "stats_display","nbt": "player_count"},{"text": " played for "},{"score": {"name": "@p","objective": "do2.run.seconds"},"color": "aqua"},{"text": " seconds."},{"text": "\\nDeck Size: "},{"score": {"name": "@p","objective": "do2.run.cards.deck.total"},"color": "aqua"},{"text": "/§b40"},{"text": " | Difficulty: "},{"storage": "stats_display","nbt": "difficulty"},{"text": "\\n§lGenerated:\\n"},{"score": {"name": "@p","objective": "do2.run.systems.embers.released"},"color": "aqua"},{"text": "\\uE0A3 | "},{"score": {"name": "@p","objective": "do2.run.systems.treasure.released"},"color": "aqua"},{"text": "\\uE0CA | "},{"score": {"name": "@p","objective": "do2.run.systems.hazard.generated"},"color": "aqua"},{"text": "\\uE0CB | "},{"score": {"name": "@p","objective": "do2.run.systems.clank.generated"},"color": "aqua"},{"text": "\\uE0C3"},{"text": "\\n§lPicked Up:\\n"},{"score": {"name": "@p","objective": "do2.utility.floorEmbers"},"color": "aqua"},{"text": "\\uE0A3 | "},{"score": {"name": "@p","objective": "do2.run.items.crowns"},"color": "aqua"},{"text": "\\uE0A2 | "},{"score": {"name": "@p","objective": "do2.run.items.coins"},"color": "aqua"},{"text": "\\uE0A1"},{"text": "\\n§lBlocked:\\n"},{"score": {"name": "@p","objective": "do2.run.systems.hazard.blocked"},"color": "aqua"},{"text": "\\uE0CB | "},{"score": {"name": "@p","objective": "do2.run.systems.clank.blocked"},"color": "aqua"},{"text": "\\uE0C3"},{"text": "\\n§lArtifact:\\n§r§fFound "},{"storage": "stats_display","nbt": "artifact_symbol"},{"text": " valued at "},{"score": {"name": "@p","objective": "do2.run.artifactValue"},"color": "aqua"},{"text": "\\uE0A3"}]'} diff --git a/Brilliance Datapack/data/do2/functions/statistics_room/personal/summon_runs.mcfunction b/Brilliance Datapack/data/do2/functions/statistics_room/personal/summon_runs.mcfunction new file mode 100644 index 00000000..49f81ea6 --- /dev/null +++ b/Brilliance Datapack/data/do2/functions/statistics_room/personal/summon_runs.mcfunction @@ -0,0 +1,13 @@ +kill @e[tag=do2.statistics_room,tag=!do2.stats.runs] + +execute unless score @p do2.run.active matches 0.. run scoreboard players set @p do2.run.active 0 +execute unless score @p do2.systems.embers.released matches 0.. run scoreboard players set @p do2.systems.embers.released 0 +execute unless score @p do2.systems.treasure.released matches 0.. run scoreboard players set @p do2.systems.treasure.released 0 +execute unless score @p do2.systems.hazard.generated matches 0.. run scoreboard players set @p do2.systems.hazard.generated 0 +execute unless score @p do2.systems.clank.generated matches 0.. run scoreboard players set @p do2.systems.clank.generated 0 +execute unless score @p do2.systems.hazard.blocked matches 0.. run scoreboard players set @p do2.systems.hazard.blocked 0 +execute unless score @p do2.systems.clank.blocked matches 0.. run scoreboard players set @p do2.systems.clank.blocked 0 + + +execute unless entity @e[tag=do2.statistics_room,tag=do2.stats.runs] run summon minecraft:text_display -492 125 1990 {Rotation:[90f,0f], billboard:"fixed",background:26,Tags:["do2.statistics_room","do2.stats.runs"]} +execute as @e[tag=do2.statistics_room,tag=do2.stats.runs] if entity @s run data merge entity @s {text:'[{"text":"§2Run §fStatistics!§r\\n\\n"},{"text":"Total Generated:\\n"},{"score": {"name": "@p","objective": "do2.systems.embers.released"},"color": "aqua"},{"text": "\\uE0A3 | "},{"score": {"name": "@p","objective": "do2.systems.treasure.released"},"color": "aqua"},{"text": "\\uE0CA | "},{"score": {"name": "@p","objective": "do2.systems.hazard.generated"},"color": "aqua"},{"text": "\\uE0CB | "},{"score": {"name": "@p","objective": "do2.systems.clank.generated"},"color": "aqua"},{"text": "\\uE0C3"},{"text": "\\n§lTotal Blocked:\\n"},{"score": {"name": "@p","objective": "do2.systems.hazard.blocked"},"color": "aqua"},{"text": "\\uE0CB | "},{"score": {"name": "@p","objective": "do2.systems.clank.blocked"},"color": "aqua"},{"text": "\\uE0C3"},{"text":"\\n\\nCards Played:\\n WIP"}]'} diff --git a/Brilliance Datapack/data/do2/functions/statistics_room/personal/summon_spoilers.mcfunction b/Brilliance Datapack/data/do2/functions/statistics_room/personal/summon_spoilers.mcfunction new file mode 100644 index 00000000..a10a3069 --- /dev/null +++ b/Brilliance Datapack/data/do2/functions/statistics_room/personal/summon_spoilers.mcfunction @@ -0,0 +1,32 @@ +kill @e[tag=do2.statistics_room,tag=!do2.stats.spoilers] + +execute unless score @p do2.run.active matches 0.. run scoreboard players set @p do2.run.active 0 +execute unless score @p do2.depth_charge_success matches 0.. run scoreboard players set @p do2.depth_charge_success 0 + +execute unless entity @e[tag=do2.statistics_room,tag=do2.stats.spoilers] run summon minecraft:text_display -492 125 1990 {Rotation:[90f,0f], billboard:"fixed",background:26,Tags:["do2.statistics_room","do2.stats.spoilers"]} + +# - Spoilers - +# TnT depth dives +# Rusty Repairs +# DM keys submitted +# Bombs Found +# Bombs Submitted +# Tendrils Found + +data modify storage stats_display bombsPickedUp_name set value "§fBombs Picked Up: " +data modify storage stats_display bombsSubmitted_name set value "§fBombs Submitted: " +data modify storage stats_display keysSubmitted_name set value "§fKeys Submitted: " +data modify storage stats_display tntDepthDives_name set value "§fTotal TnT Depth Charges: " +data modify storage stats_display rustyRepairs_name set value "§fRusty Repairs: " +data modify storage stats_display tendrilsFound_name set value "§fTendrils Found: " + +data modify storage stats_display redacted set value "§7[§k-- §7REDACTED §k--§7]: " +execute if score @p do2.depth_charge_success matches 0 run data modify storage stats_display tntDepthDives_name set from storage stats_display redacted +execute if score @p do2.run.active matches 0 run data modify storage stats_display bombsPickedUp_name set from storage stats_display redacted +execute if score @p do2.run.active matches 0 run data modify storage stats_display bombsSubmitted_name set from storage stats_display redacted +execute if score @p do2.run.active matches 0 run data modify storage stats_display keysSubmitted_name set from storage stats_display redacted +execute if score @p do2.run.active matches 0 run data modify storage stats_display rustyRepairs_name set from storage stats_display redacted +execute if score @p do2.run.active matches 0 run data modify storage stats_display tendrilsFound_name set from storage stats_display redacted +#§4[§mREDACTED§4]: + +execute as @e[tag=do2.statistics_room,tag=do2.stats.spoilers] if entity @s run data merge entity @s {text:'[{"text":"§l§dSpoilers §fStatistics!§r\\n"},{"text":"\\n"},{"storage": "stats_display","nbt": "bombsPickedUp_name"},{"score":{"name":"@p","objective":"do2.active"},"color":"red","italic":"true"},{"text":"\\n"},{"storage": "stats_display","nbt": "bombsSubmitted_name"},{"score":{"name":"@p","objective":"do2.active"},"color":"red","italic":"true"},{"text":"\\n"},{"storage": "stats_display","nbt": "keysSubmitted_name"},{"score":{"name":"@p","objective":"do2.active"},"color":"red","italic":"true"},{"text":"\\n"},{"storage": "stats_display","nbt": "tntDepthDives_name"},{"score":{"name":"@p","objective":"do2.depth_charge_success"},"color":"aqua","italic":"true"},{"text":"\\n"},{"storage": "stats_display","nbt": "rustyRepairs_name"},{"score":{"name":"@p","objective":"do2.active"},"color":"red","italic":"true"},{"text":"\\n"},{"storage": "stats_display","nbt": "tendrilsFound_name"},{"score":{"name":"@p","objective":"do2.active"},"color":"red","italic":"true"}]'} diff --git a/Brilliance Datapack/data/do2/functions/statistics_room/personal/summon_treasures.mcfunction b/Brilliance Datapack/data/do2/functions/statistics_room/personal/summon_treasures.mcfunction new file mode 100644 index 00000000..98faf9be --- /dev/null +++ b/Brilliance Datapack/data/do2/functions/statistics_room/personal/summon_treasures.mcfunction @@ -0,0 +1,13 @@ +kill @e[tag=do2.statistics_room,tag=!do2.stats.treasures] + +execute unless score @p do2.lifetime.spent.crowns matches 0.. run scoreboard players set @p do2.lifetime.spent.crowns 0 +execute unless score @p do2.lifetime.spent.embers matches 0.. run scoreboard players set @p do2.lifetime.spent.embers 0 +execute unless score @p do2.lifetime.coinsconverted matches 0.. run scoreboard players set @p do2.lifetime.coinsconverted 0 +execute unless score @p do2.lifetime.pickedup.crowns matches 0.. run scoreboard players set @p do2.lifetime.pickedup.crowns 0 +execute unless score @p do2.lifetime.pickedup.coins matches 0.. run scoreboard players set @p do2.lifetime.pickedup.coins 0 +execute unless score @p do2.lifetime.pickedup.embers matches 0.. run scoreboard players set @p do2.lifetime.pickedup.embers 0 +execute unless score @p do2.lifetime.escaped.embers matches 0.. run scoreboard players set @p do2.lifetime.escaped.embers 0 +execute unless score @p do2.lifetime.escaped.crowns matches 0.. run scoreboard players set @p do2.lifetime.escaped.crowns 0 + +execute unless entity @e[tag=do2.statistics_room,tag=do2.stats.treasures] run summon minecraft:text_display -492 124.3 1990 {Rotation:[90f,0f], billboard:"fixed",background:26,Tags:["do2.statistics_room","do2.stats.treasures"]} +execute as @e[tag=do2.statistics_room,tag=do2.stats.treasures] if entity @s run data merge entity @s {text:'[{"text":"§l§eTreasure §fStatistics!§r\\n\\n§fCrowns Picked Up: §o§c"},{"score":{"name":"@p","objective":"do2.lifetime.pickedup.crowns"},"color":"aqua","italic":"true"},{"text":"\\n§fCrowns Escaped With: §o§c"},{"score":{"name":"@p","objective":"do2.lifetime.escaped.crowns"},"color":"aqua","italic":"true"},{"text":"\\n§fCoins Picked Up: §o§c"},{"score":{"name":"@p","objective":"do2.lifetime.pickedup.coins"},"color":"aqua","italic":"true"},{"text":"\\n§fCoins Converted: §o§c"},{"score":{"name":"@p","objective":"do2.lifetime.coinsconverted"},"color":"aqua","italic":"true"},{"text":"\\n§fCrowns Spent: §o§b"},{"score":{"name":"@p","objective":"do2.lifetime.spent.crowns"},"color":"aqua","italic":"true"},{"text":"\\n\\n§l§bFrost Embers §fStatistics!§r\\n\\nFrost Embers Picked Up: "},{"score":{"name":"@p","objective":"do2.lifetime.pickedup.embers"},"color":"aqua","italic":"true"},{"text":"\\n§fFrost Embers Escaped With: §o§c"},{"score":{"name":"@p","objective":"do2.lifetime.escaped.embers"},"color":"aqua","italic":"true"},{"text":"\\n§fFrost Embers Spent: §o§b"},{"score":{"name":"@p","objective":"do2.lifetime.spent.embers"},"color":"aqua","italic":"true"}]'}