Skip to content

Commit

Permalink
On tome buy event: track lifetime total and enable add-item call
Browse files Browse the repository at this point in the history
  • Loading branch information
4Ply committed Aug 11, 2024
1 parent d0d2903 commit 229aaa1
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# execute if score $dungeon do2.agronet.card_bought matches -3 run add-item victory-tome 5
# execute if score $dungeon do2.agronet.card_bought matches -2 run add-item victory-tome 3
# execute if score $dungeon do2.agronet.card_bought matches -1 run add-item victory-tome 1
execute if score $dungeon do2.agronet.card_bought matches -3 run add-item victory-tome 5
execute if score $dungeon do2.agronet.card_bought matches -2 run add-item victory-tome 3
execute if score $dungeon do2.agronet.card_bought matches -1 run add-item victory-tome 1

execute if score $dungeon do2.agronet.card_bought matches 0 run card-bought moment-of-clarity
execute if score $dungeon do2.agronet.card_bought matches 1 run card-bought sneak
execute if score $dungeon do2.agronet.card_bought matches 2 run card-bought stability
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
execute as @a[scores={do2.logs.cards=1..}] run tellraw @s ["",{"text":"§f[§9B§r]: Tome Bought: ("},{"text":"§3❄☠ Victory Tome ☠❄","hoverEvent":{"action":"show_item","value":"{id:\"minecraft:iron_nugget\",tag:{NameFormat:{italic:1,bold:0,OriginalName:'{\"bold\":false,\"italic\":true,\"text\":\"❄☠ Victory Tome ☠❄\"}',ModifiedName:'{\"bold\":false,\"italic\":true,\"text\":\"❄☠ Victory Tome ☠❄\"}'},CustomRoleplayData:1b,CustomModelData:6,display:{Name:'{\"bold\":false,\"italic\":true,\"text\":\"❄☠ Victory Tome ☠❄\"}'}},Count:1b}"}},{"text":")"}]
# - End Log -

execute as @p[tag=do2.received_shulker] run scoreboard players add @s do2.lifetime.escaped.tomes 1
execute as @p[tag=do2.received_shulker] run scoreboard players add @s do2.cards.bought.1TM 1
execute as @p[tag=do2.received_shulker] run scoreboard players set @s do2.run.cards.bought.1TM 1
execute as @p[tag=do2.received_shulker] run scoreboard players operation @s do2.lifetime.spent.embers += $dungeon do2.cards.price.1TM
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
execute as @a[scores={do2.logs.cards=1..}] run tellraw @s ["",{"text":"§f[§9B§r]: 3 Tomes Bought: ("},{"text":"§3❄☠ Victory Tome ☠❄","hoverEvent":{"action":"show_item","value":"{id:\"minecraft:iron_nugget\",tag:{NameFormat:{italic:1,bold:0,OriginalName:'{\"bold\":false,\"italic\":true,\"text\":\"❄☠ Victory Tome ☠❄\"}',ModifiedName:'{\"bold\":false,\"italic\":true,\"text\":\"❄☠ Victory Tome ☠❄\"}'},CustomRoleplayData:1b,CustomModelData:6,display:{Name:'{\"bold\":false,\"italic\":true,\"text\":\"❄☠ Victory Tome ☠❄\"}'}},Count:3b}"}},{"text":")"}]
# - End Log -

execute as @p[tag=do2.received_shulker] run scoreboard players add @s do2.lifetime.escaped.tomes 3
execute as @p[tag=do2.received_shulker] run scoreboard players add @s do2.cards.bought.3TM 1
execute as @p[tag=do2.received_shulker] run scoreboard players set @s do2.run.cards.bought.3TM 1
execute as @p[tag=do2.received_shulker] run scoreboard players operation @s do2.lifetime.spent.embers += $dungeon do2.cards.price.3TM
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
execute as @a[scores={do2.logs.cards=1..}] run tellraw @s ["",{"text":"§f[§9B§r]: 5 Tomes Bought: ("},{"text":"§3❄☠ Victory Tome ☠❄","hoverEvent":{"action":"show_item","value":"{id:\"minecraft:iron_nugget\",tag:{NameFormat:{italic:1,bold:0,OriginalName:'{\"bold\":false,\"italic\":true,\"text\":\"❄☠ Victory Tome ☠❄\"}',ModifiedName:'{\"bold\":false,\"italic\":true,\"text\":\"❄☠ Victory Tome ☠❄\"}'},CustomRoleplayData:1b,CustomModelData:6,display:{Name:'{\"bold\":false,\"italic\":true,\"text\":\"❄☠ Victory Tome ☠❄\"}'}},Count:3b}"}},{"text":")"}]
# - End Log -

execute as @p[tag=do2.received_shulker] run scoreboard players add @s do2.lifetime.escaped.tomes 5
execute as @p[tag=do2.received_shulker] run scoreboard players add @s do2.cards.bought.5TM 1
execute as @p[tag=do2.received_shulker] run scoreboard players set @s do2.run.cards.bought.5TM 1
execute as @p[tag=do2.received_shulker] run scoreboard players operation @s do2.lifetime.spent.embers += $dungeon do2.cards.price.5TM
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ scoreboard objectives add do2.depth_charge_success dummy "Total Depth Charge Suc

# - treasure lifetimes -
scoreboard objectives add do2.lifetime.pickedup.crowns dummy "Total §eCrowns§r Picked Up"
scoreboard objectives add do2.lifetime.escaped.crowns dummy "Total §eCrowns§r Escaped With."
scoreboard objectives add do2.lifetime.escaped.crowns dummy "Total §eCrowns§r Escaped With"
scoreboard objectives add do2.lifetime.spent.crowns dummy "Total §eCrowns§r Spent"
scoreboard objectives add do2.lifetime.coinsconverted dummy "Total §eCoins§r Converted"
scoreboard objectives add do2.lifetime.pickedup.coins dummy "Total §eCoins§r Converted"
scoreboard objectives add do2.lifetime.pickedup.embers dummy "Total §3Frost Embers§r Picked Up"
scoreboard objectives add do2.lifetime.escaped.embers dummy "Total §3Frost Embers§r Escaped With."
scoreboard objectives add do2.lifetime.escaped.embers dummy "Total §3Frost Embers§r Escaped With"
scoreboard objectives add do2.lifetime.spent.embers dummy "Total §3Frost Embers§r Spent"
scoreboard objectives add do2.lifetime.escaped.tomes dummy "Total §eTomes§r Escaped With"
scoreboard objectives add do2.lifetime.spent.tomes dummy "Total §3Tomes§r Spent Or Submitted"

# - per run -
scoreboard objectives add do2.run.active dummy "Game in Play"
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.18
# DATAPACK VERSION NUMBER: 0.12.19

tellraw @s ["",{"text":"The §o§n§aBrilliance Datapack§r's version is: [§b0.12.18§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.19§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":"."}]
14 changes: 13 additions & 1 deletion JSON/scoreboards.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"description": "The total amount of Crowns the target has picked up."
},
"do2.lifetime.escaped.crowns": {
"auto": 0,
"auto": 1,
"target": "both",
"category": "totals",
"description": "The total amount of Crowns the target has escaped with."
Expand Down Expand Up @@ -119,6 +119,18 @@
"category": "totals",
"description": "The total amount of Frost Embers the target has spent."
},
"do2.lifetime.escaped.tomes": {
"auto": 1,
"target": "both",
"category": "totals",
"description": "The total amount of Tomes the target has escaped with."
},
"do2.lifetime.spent.tomes": {
"auto": 1,
"target": "both",
"category": "totals",
"description": "The total amount of Tomes the target has spent or submitted."
},
"do2.highest_win_streak": {
"auto": 1,
"target": "both",
Expand Down

0 comments on commit 229aaa1

Please sign in to comment.