Skip to content

Commit

Permalink
update level controller.
Browse files Browse the repository at this point in the history
  • Loading branch information
Frustrated-Programmer committed Jul 9, 2024
1 parent 7762263 commit 12046c0
Show file tree
Hide file tree
Showing 14 changed files with 169 additions and 2 deletions.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Setup
function do2:level_controller/get_mob_count/count_mobs
function do2:level_controller/get_mob_names/get_mob_names


# L1Z1
function do2:level_controller/generate_mobs/l1z1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Coords -500 70 2000
# Summon mob with tag: newly_generated_mob
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Setup
scoreboard players operation $dungeon do2.utility.mobGeneration = $dungeon do2.config.mc.level1Zone1MobCount
data modify storage do2:mobs mobNames set from storage do2:mobs level1_zone1

function do2:level_controller/generate_mobs/generate_a_mob

# Finish
execute as @e[tag=newly_generated_mob] run tp @s @e[type=marker,tag=L1Z1,limit=1,sort=random]
execute as @e[tag=newly_generated_mob] run tag @s add L1Z1
execute as @e[tag=newly_generated_mob] run tag @s remove newly_generated_mob
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@

scoreboard players set $dungeon do2.utility.mobCountCounterTotal 0

# Count each slot
execute store result score $dungeon do2.utility.mobCountCounterTest run data get block ~ ~ ~ Items[0].Count
scoreboard players operation $dungeon do2.utility.mobCountCounterTotal += $dungeon do2.utility.mobCountCounterTest
execute store result score $dungeon do2.utility.mobCountCounterTest run data get block ~ ~ ~ Items[1].Count
scoreboard players operation $dungeon do2.utility.mobCountCounterTotal += $dungeon do2.utility.mobCountCounterTest
execute store result score $dungeon do2.utility.mobCountCounterTest run data get block ~ ~ ~ Items[2].Count
scoreboard players operation $dungeon do2.utility.mobCountCounterTotal += $dungeon do2.utility.mobCountCounterTest
execute store result score $dungeon do2.utility.mobCountCounterTest run data get block ~ ~ ~ Items[3].Count
scoreboard players operation $dungeon do2.utility.mobCountCounterTotal += $dungeon do2.utility.mobCountCounterTest
execute store result score $dungeon do2.utility.mobCountCounterTest run data get block ~ ~ ~ Items[4].Count
scoreboard players operation $dungeon do2.utility.mobCountCounterTotal += $dungeon do2.utility.mobCountCounterTest
execute store result score $dungeon do2.utility.mobCountCounterTest run data get block ~ ~ ~ Items[5].Count
scoreboard players operation $dungeon do2.utility.mobCountCounterTotal += $dungeon do2.utility.mobCountCounterTest
execute store result score $dungeon do2.utility.mobCountCounterTest run data get block ~ ~ ~ Items[6].Count
scoreboard players operation $dungeon do2.utility.mobCountCounterTotal += $dungeon do2.utility.mobCountCounterTest
execute store result score $dungeon do2.utility.mobCountCounterTest run data get block ~ ~ ~ Items[7].Count
scoreboard players operation $dungeon do2.utility.mobCountCounterTotal += $dungeon do2.utility.mobCountCounterTest
execute store result score $dungeon do2.utility.mobCountCounterTest run data get block ~ ~ ~ Items[8].Count
scoreboard players operation $dungeon do2.utility.mobCountCounterTotal += $dungeon do2.utility.mobCountCounterTest
execute store result score $dungeon do2.utility.mobCountCounterTest run data get block ~ ~ ~ Items[9].Count
scoreboard players operation $dungeon do2.utility.mobCountCounterTotal += $dungeon do2.utility.mobCountCounterTest
execute store result score $dungeon do2.utility.mobCountCounterTest run data get block ~ ~ ~ Items[10].Count
scoreboard players operation $dungeon do2.utility.mobCountCounterTotal += $dungeon do2.utility.mobCountCounterTest
execute store result score $dungeon do2.utility.mobCountCounterTest run data get block ~ ~ ~ Items[11].Count
scoreboard players operation $dungeon do2.utility.mobCountCounterTotal += $dungeon do2.utility.mobCountCounterTest
execute store result score $dungeon do2.utility.mobCountCounterTest run data get block ~ ~ ~ Items[12].Count
scoreboard players operation $dungeon do2.utility.mobCountCounterTotal += $dungeon do2.utility.mobCountCounterTest
execute store result score $dungeon do2.utility.mobCountCounterTest run data get block ~ ~ ~ Items[13].Count
scoreboard players operation $dungeon do2.utility.mobCountCounterTotal += $dungeon do2.utility.mobCountCounterTest
execute store result score $dungeon do2.utility.mobCountCounterTest run data get block ~ ~ ~ Items[14].Count
scoreboard players operation $dungeon do2.utility.mobCountCounterTotal += $dungeon do2.utility.mobCountCounterTest
execute store result score $dungeon do2.utility.mobCountCounterTest run data get block ~ ~ ~ Items[15].Count
scoreboard players operation $dungeon do2.utility.mobCountCounterTotal += $dungeon do2.utility.mobCountCounterTest
execute store result score $dungeon do2.utility.mobCountCounterTest run data get block ~ ~ ~ Items[16].Count
scoreboard players operation $dungeon do2.utility.mobCountCounterTotal += $dungeon do2.utility.mobCountCounterTest
execute store result score $dungeon do2.utility.mobCountCounterTest run data get block ~ ~ ~ Items[17].Count
scoreboard players operation $dungeon do2.utility.mobCountCounterTotal += $dungeon do2.utility.mobCountCounterTest
execute store result score $dungeon do2.utility.mobCountCounterTest run data get block ~ ~ ~ Items[18].Count
scoreboard players operation $dungeon do2.utility.mobCountCounterTotal += $dungeon do2.utility.mobCountCounterTest
execute store result score $dungeon do2.utility.mobCountCounterTest run data get block ~ ~ ~ Items[19].Count
scoreboard players operation $dungeon do2.utility.mobCountCounterTotal += $dungeon do2.utility.mobCountCounterTest
execute store result score $dungeon do2.utility.mobCountCounterTest run data get block ~ ~ ~ Items[20].Count
scoreboard players operation $dungeon do2.utility.mobCountCounterTotal += $dungeon do2.utility.mobCountCounterTest
execute store result score $dungeon do2.utility.mobCountCounterTest run data get block ~ ~ ~ Items[21].Count
scoreboard players operation $dungeon do2.utility.mobCountCounterTotal += $dungeon do2.utility.mobCountCounterTest
execute store result score $dungeon do2.utility.mobCountCounterTest run data get block ~ ~ ~ Items[22].Count
scoreboard players operation $dungeon do2.utility.mobCountCounterTotal += $dungeon do2.utility.mobCountCounterTest
execute store result score $dungeon do2.utility.mobCountCounterTest run data get block ~ ~ ~ Items[23].Count
scoreboard players operation $dungeon do2.utility.mobCountCounterTotal += $dungeon do2.utility.mobCountCounterTest
execute store result score $dungeon do2.utility.mobCountCounterTest run data get block ~ ~ ~ Items[24].Count
scoreboard players operation $dungeon do2.utility.mobCountCounterTotal += $dungeon do2.utility.mobCountCounterTest
execute store result score $dungeon do2.utility.mobCountCounterTest run data get block ~ ~ ~ Items[25].Count
scoreboard players operation $dungeon do2.utility.mobCountCounterTotal += $dungeon do2.utility.mobCountCounterTest
execute store result score $dungeon do2.utility.mobCountCounterTest run data get block ~ ~ ~ Items[26].Count
scoreboard players operation $dungeon do2.utility.mobCountCounterTotal += $dungeon do2.utility.mobCountCounterTest




Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
function do2:level_controller/decide_mob_count/l1
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# - WITH ZONES -
execute if score $dungeon do2.config.mc.level1Zones matches 1 positioned -527 122 1945 run function do2:level_controller/get_mob_count/count_inside_barrel
execute if score $dungeon do2.config.mc.level1Zones matches 1 run scoreboard players operation $dungeon do2.config.mc.level1Zone1MobCount = $dungeon do2.utility.mobCountCounterTotal
execute if score $dungeon do2.config.mc.level1Zones matches 1 positioned -527 122 1944 run function do2:level_controller/get_mob_count/count_inside_barrel
execute if score $dungeon do2.config.mc.level1Zones matches 1 run scoreboard players operation $dungeon do2.config.mc.level1Zone2MobCount = $dungeon do2.utility.mobCountCounterTotal
execute if score $dungeon do2.config.mc.level1Zones matches 1 positioned -527 122 1943 run function do2:level_controller/get_mob_count/count_inside_barrel
execute if score $dungeon do2.config.mc.level1Zones matches 1 run scoreboard players operation $dungeon do2.config.mc.level1Zone3MobCount = $dungeon do2.utility.mobCountCounterTotal

# - WITHOUT ZONES -
execute if score $dungeon do2.config.mc.level1Zones matches 0 positioned -527 125 1946 run function do2:level_controller/get_mob_count/count_inside_barrel
execute if score $dungeon do2.config.mc.level1Zones matches 0 run scoreboard players operation $dungeon do2.config.mc.level1Zone1MobCount = $dungeon do2.utility.mobCountCounterTotal
execute if score $dungeon do2.config.mc.level1Zones matches 0 positioned -527 125 1945 run function do2:level_controller/get_mob_count/count_inside_barrel
execute if score $dungeon do2.config.mc.level1Zones matches 0 run scoreboard players operation $dungeon do2.config.mc.level1Zone2MobCount = $dungeon do2.utility.mobCountCounterTotal
execute if score $dungeon do2.config.mc.level1Zones matches 0 positioned -527 125 1944 run function do2:level_controller/get_mob_count/count_inside_barrel
execute if score $dungeon do2.config.mc.level1Zones matches 0 run scoreboard players operation $dungeon do2.config.mc.level1Zone3MobCount = $dungeon do2.utility.mobCountCounterTotal
execute if score $dungeon do2.config.mc.level1Zones matches 0 positioned -527 125 1943 run function do2:level_controller/get_mob_count/count_inside_barrel
execute if score $dungeon do2.config.mc.level1Zones matches 0 run scoreboard players operation $dungeon do2.config.mc.level1Zone4MobCount = $dungeon do2.utility.mobCountCounterTotal
execute if score $dungeon do2.config.mc.level1Zones matches 0 positioned -527 125 1942 run function do2:level_controller/get_mob_count/count_inside_barrel
execute if score $dungeon do2.config.mc.level1Zones matches 0 run scoreboard players operation $dungeon do2.config.mc.level1Zone5MobCount = $dungeon do2.utility.mobCountCounterTotal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
function do2:level_controller/get_mob_names/l1
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
data modify storage do2:mob_names temp set value []

data modify storage do2:mob_names temp append from block ~ ~ ~ Items[0].tag.display.Name
data modify storage do2:mob_names temp append from block ~ ~ ~ Items[1].tag.display.Name
data modify storage do2:mob_names temp append from block ~ ~ ~ Items[2].tag.display.Name
data modify storage do2:mob_names temp append from block ~ ~ ~ Items[3].tag.display.Name
data modify storage do2:mob_names temp append from block ~ ~ ~ Items[4].tag.display.Name
data modify storage do2:mob_names temp append from block ~ ~ ~ Items[5].tag.display.Name
data modify storage do2:mob_names temp append from block ~ ~ ~ Items[6].tag.display.Name
data modify storage do2:mob_names temp append from block ~ ~ ~ Items[7].tag.display.Name
data modify storage do2:mob_names temp append from block ~ ~ ~ Items[8].tag.display.Name
data modify storage do2:mob_names temp append from block ~ ~ ~ Items[9].tag.display.Name
data modify storage do2:mob_names temp append from block ~ ~ ~ Items[10].tag.display.Name
data modify storage do2:mob_names temp append from block ~ ~ ~ Items[11].tag.display.Name
data modify storage do2:mob_names temp append from block ~ ~ ~ Items[12].tag.display.Name
data modify storage do2:mob_names temp append from block ~ ~ ~ Items[13].tag.display.Name
data modify storage do2:mob_names temp append from block ~ ~ ~ Items[14].tag.display.Name
data modify storage do2:mob_names temp append from block ~ ~ ~ Items[15].tag.display.Name
data modify storage do2:mob_names temp append from block ~ ~ ~ Items[16].tag.display.Name
data modify storage do2:mob_names temp append from block ~ ~ ~ Items[17].tag.display.Name
data modify storage do2:mob_names temp append from block ~ ~ ~ Items[18].tag.display.Name
data modify storage do2:mob_names temp append from block ~ ~ ~ Items[19].tag.display.Name
data modify storage do2:mob_names temp append from block ~ ~ ~ Items[20].tag.display.Name
data modify storage do2:mob_names temp append from block ~ ~ ~ Items[21].tag.display.Name
data modify storage do2:mob_names temp append from block ~ ~ ~ Items[22].tag.display.Name
data modify storage do2:mob_names temp append from block ~ ~ ~ Items[23].tag.display.Name
data modify storage do2:mob_names temp append from block ~ ~ ~ Items[24].tag.display.Name
data modify storage do2:mob_names temp append from block ~ ~ ~ Items[25].tag.display.Name
data modify storage do2:mob_names temp append from block ~ ~ ~ Items[26].tag.display.Name
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# - WITH ZONES -
execute if score $dungeon do2.config.mc.level1Zones matches 1 positioned -527 123 1945 run function do2:level_controller/get_mob_names/get_names_from_barrel
execute if score $dungeon do2.config.mc.level1Zones matches 1 run data modify storage do2:mobs level1_zone1 set from storage do2:mobs temp
execute if score $dungeon do2.config.mc.level1Zones matches 1 positioned -527 123 1944 run function do2:level_controller/get_mob_names/get_names_from_barrel
execute if score $dungeon do2.config.mc.level1Zones matches 1 run data modify storage do2:mobs level1_zone2 set from storage do2:mobs temp
execute if score $dungeon do2.config.mc.level1Zones matches 1 positioned -527 123 1943 run function do2:level_controller/get_mob_names/get_names_from_barrel
execute if score $dungeon do2.config.mc.level1Zones matches 1 run data modify storage do2:mobs level1_zone3 set from storage do2:mobs temp

# - WITHOUT ZONES -
execute if score $dungeon do2.config.mc.level1Zones matches 0 positioned -527 126 1946 run function do2:level_controller/get_mob_names/get_names_from_barrel
execute if score $dungeon do2.config.mc.level1Zones matches 0 run data modify storage do2:mobs level1_zone1 set from storage do2:mobs temp
execute if score $dungeon do2.config.mc.level1Zones matches 0 positioned -527 126 1945 run function do2:level_controller/get_mob_names/get_names_from_barrel
execute if score $dungeon do2.config.mc.level1Zones matches 0 run data modify storage do2:mobs level1_zone2 set from storage do2:mobs temp
execute if score $dungeon do2.config.mc.level1Zones matches 0 positioned -527 126 1944 run function do2:level_controller/get_mob_names/get_names_from_barrel
execute if score $dungeon do2.config.mc.level1Zones matches 0 run data modify storage do2:mobs level1_zone3 set from storage do2:mobs temp
execute if score $dungeon do2.config.mc.level1Zones matches 0 positioned -527 126 1943 run function do2:level_controller/get_mob_names/get_names_from_barrel
execute if score $dungeon do2.config.mc.level1Zones matches 0 run data modify storage do2:mobs level1_zone4 set from storage do2:mobs temp
execute if score $dungeon do2.config.mc.level1Zones matches 0 positioned -527 126 1942 run function do2:level_controller/get_mob_names/get_names_from_barrel
execute if score $dungeon do2.config.mc.level1Zones matches 0 run data modify storage do2:mobs level1_zone5 set from storage do2:mobs temp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Clone Storage
function do2:level_controller/clone_storages

# Level 1
execute if score $dungeon do2.config.mc.levelEditing matches 1 if score $dungeon do2.config.mc.level1Zones matches 1 run scoreboard players set $dungeon do2.config.mc.level1Zones 2
execute if score $dungeon do2.config.mc.levelEditing matches 1 if score $dungeon do2.config.mc.level1Zones matches 0 run scoreboard players set $dungeon do2.config.mc.level1Zones 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,17 @@ scoreboard objectives add do2.config.mc.level2Zones dummy "Whether level 2 shoul
execute unless score $dungeon do2.config.mc.level2Zones matches 0.. run scoreboard players set $dungeon do2.config.mc.level2Zones 1
scoreboard objectives add do2.config.mc.level4Zones dummy "Whether level 4 should have zones"
execute unless score $dungeon do2.config.mc.level4Zones matches 0.. run scoreboard players set $dungeon do2.config.mc.level4Zones 1
scoreboard objectives add do2.config.mc.level1Zone1MobCount dummy "How many mobs in L1 Z1"
execute unless score $dungeon do2.config.mc.level1Zone1MobCount matches 0.. run scoreboard players set $dungeon do2.config.mc.level1Zone1MobCount 1
scoreboard objectives add do2.config.mc.level1Zone2MobCount dummy "How many mobs in L1 Z2"
execute unless score $dungeon do2.config.mc.level1Zone2MobCount matches 0.. run scoreboard players set $dungeon do2.config.mc.level1Zone2MobCount 1
scoreboard objectives add do2.config.mc.level1Zone3MobCount dummy "How many mobs in L1 Z3"
execute unless score $dungeon do2.config.mc.level1Zone3MobCount matches 0.. run scoreboard players set $dungeon do2.config.mc.level1Zone3MobCount 1
scoreboard objectives add do2.config.mc.level1Zone4MobCount dummy "How many mobs in L1 Z4"
execute unless score $dungeon do2.config.mc.level1Zone4MobCount matches 0.. run scoreboard players set $dungeon do2.config.mc.level1Zone4MobCount 1
scoreboard objectives add do2.config.mc.level1Zone5MobCount dummy "How many mobs in L1 Z5"
execute unless score $dungeon do2.config.mc.level1Zone5MobCount matches 0.. run scoreboard players set $dungeon do2.config.mc.level1Zone5MobCount 1


# Player Config: Player's last used Dungeon Difficulty.
scoreboard objectives add do2.config.dungeonDifficulty dummy "Dungeon Difficulty"
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ scoreboard objectives add do2.utility.statsScreen dummy "What screen the stats a
execute unless score $dungeon do2.utility.statsScreen matches 0.. run scoreboard players set $dungeon do2.utility.statsScreen 0
scoreboard objectives add do2.utility.priceChecker dummy "Used to count the price of cards in shops"
scoreboard objectives add do2.utility.receivedJackpot dummy "Used to count the keys in loot boxes to see if Jackpot was won"
scoreboard objectives add do2.utility.mobCountCounterTest dummy "Used to count the how many mobs are in a barrel"
scoreboard objectives add do2.utility.mobCountCounterTotal dummy "Used to count the how many mobs are in a barrel"
scoreboard objectives add do2.utility.mobGeneration dummy "Used to count how many mobs to generate"

scoreboard objectives add do2.utility.onServer dummy "Checking if this Brilliance is loaded on the server"
execute unless score $dungeon do2.utility.onServer matches 0.. run scoreboard players set $dungeon do2.utility.onServer 0
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.13
# DATAPACK VERSION NUMBER: 0.12.14

tellraw @s ["",{"text":"The §o§n§aBrilliance Datapack§r's version is: [§b0.12.13§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.14§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 12046c0

Please sign in to comment.