Skip to content

Commit

Permalink
Add ember and crowns to lifetime totals only after a win
Browse files Browse the repository at this point in the history
  • Loading branch information
4Ply authored Nov 25, 2024
1 parent f7a444c commit bb29039
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Called when a player submits their artifact

# - Start Log -
tag @s add artifactSubmittedTarget
execute at @s as @a[scores={do2.logs.gamestate=1..}] run tellraw @s ["",{"text":"[§9B§r]: "},{"selector":"@p[tag=artifactSubmittedTarget]"},{"text":" has submitted an artifact."}]
tag @s remove artifactSubmittedTarget
# - End Log -

# Add the artifact value to the player's total, as they haven't picked up the artifact embers yet,
# and when they do, they won't be counted to towards these totals anyway, so we do it here.
scoreboard players operation @s do2.lifetime.escaped.embers += $dungeon do2.run.artifactValue
scoreboard players operation $dungeon do2.lifetime.escaped.embers += $dungeon do2.run.artifactValue
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,3 @@ 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

Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,14 @@ execute if score $dungeon do2.win_streak >= $dungeon do2.highest_win_streak run
# store run time when player dies
scoreboard players operation @s do2.run.seconds = $dungeon do2.run.seconds

# increase player lifetime totals for embers and crowns collected
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

# store artifact embers as part of lifetime totals
execute as @s run function do2:events/on_player_artifact_submitted


# ADVANCEMENT STUFF GOES HERE
Expand Down
4 changes: 2 additions & 2 deletions Brilliance Datapack/data/do2/functions/version.mcfunction
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

# DATAPACK VERSION NUMBER: 0.12.27
# DATAPACK VERSION NUMBER: 0.12.28

tellraw @s ["",{"text":"The §o§n§aBrilliance Datapack§r's version is: [§b0.12.27§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.28§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":"."}]
2 changes: 1 addition & 1 deletion docs/scoreboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ The name immediately after the `do2.` will generally be describing it's category
|| 🟤 | do2.highest_win_streak | totals | The highest win streak the target has. |
|| 🟤 | do2.lifetime.coinsconverted | totals | The total amount of Coins the target has Converted. |
|| 🟤 | do2.lifetime.escaped.crowns | totals | The total amount of Crowns the target has escaped with. |
| | 🟤 | do2.lifetime.escaped.embers | totals | The total amount of Frost Embers the target has escaped with. |
| | 🟤 | do2.lifetime.escaped.embers | totals | The total amount of Frost Embers the target has escaped with (including artifact value). |
|| 🟤 | do2.lifetime.escaped.tomes | totals | The total amount of Tomes the target has escaped with. |
|| 🟤 | do2.lifetime.pickedup.coins | totals | The total amount of Coins the target has picked up. |
|| 🟤 | do2.lifetime.pickedup.crowns | totals | The total amount of Crowns the target has picked up. |
Expand Down

0 comments on commit bb29039

Please sign in to comment.