From 02010e08a8db8cc5e54dbf228dada33044d1e9e9 Mon Sep 17 00:00:00 2001 From: FrustratedProgrammer Date: Mon, 2 Dec 2024 17:58:12 -0600 Subject: [PATCH] Large update to the level controller. Still WIP --- Brilliance Datapack/TODO.md | 8 +-- .../dungeon_setup/summon/ravagers.mcfunction | 1 - .../functions/events/on_100_ticks.mcfunction | 7 ++- .../add_numbered_ravager_name.mcfunction | 20 +++++++ .../add_ravager_name_to_list.mcfunction | 28 ++++++++++ .../add_mob_names/ravager_names.mcfunction | 2 + .../get_from_index.mcfunction | 17 ++++++ .../splice_from_index.mcfunction | 24 ++++++++ .../splice_from_index_helper.mcfunction | 5 ++ .../level_controller/generate_mobs.mcfunction | 21 +++++++ .../generate_a_ravager.mcfunction | 28 ---------- .../generate_enough_ravagers.mcfunction | 39 +++++++++++++ .../get_from_random_number.mcfunction | 8 --- .../generate_mobs/l1z1.mcfunction | 19 ++++--- .../generate_mobs/l1z2.mcfunction | 22 +++++--- .../generate_mobs/l1z3.mcfunction | 22 +++++--- .../generate_mobs/l1z4.mcfunction | 22 +++++--- .../generate_mobs/l1z5.mcfunction | 22 +++++--- .../generate_mobs/l2z1.mcfunction | 22 +++++--- .../generate_mobs/l2z2.mcfunction | 23 +++++--- .../generate_mobs/l2z3.mcfunction | 23 +++++--- .../generate_mobs/l2z4.mcfunction | 23 +++++--- .../generate_mobs/l2z5.mcfunction | 23 +++++--- .../killers/individual_tests/l1z1.mcfunction | 8 +++ .../individual_tests/reduce_mobs.mcfunction | 0 .../test_for_zone_ravagers.mcfunction | 1 + .../killers/test_for_ravagers.mcfunction | 3 + .../data/do2/functions/version.mcfunction | 5 +- JSON/mob_names.json | 56 +++++++++++++++++++ 29 files changed, 364 insertions(+), 138 deletions(-) create mode 100644 Brilliance Datapack/data/do2/functions/level_controller/add_mob_names/add_numbered_ravager_name.mcfunction create mode 100644 Brilliance Datapack/data/do2/functions/level_controller/add_mob_names/add_ravager_name_to_list.mcfunction create mode 100644 Brilliance Datapack/data/do2/functions/level_controller/add_mob_names/ravager_names.mcfunction create mode 100644 Brilliance Datapack/data/do2/functions/level_controller/array_manipulation/get_from_index.mcfunction create mode 100644 Brilliance Datapack/data/do2/functions/level_controller/array_manipulation/splice_from_index.mcfunction create mode 100644 Brilliance Datapack/data/do2/functions/level_controller/array_manipulation/splice_from_index_helper.mcfunction delete mode 100644 Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/generate_a_ravager.mcfunction create mode 100644 Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/generate_enough_ravagers.mcfunction delete mode 100644 Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/get_from_random_number.mcfunction create mode 100644 Brilliance Datapack/data/do2/functions/mob_spawning/killers/individual_tests/l1z1.mcfunction create mode 100644 Brilliance Datapack/data/do2/functions/mob_spawning/killers/individual_tests/reduce_mobs.mcfunction create mode 100644 Brilliance Datapack/data/do2/functions/mob_spawning/killers/individual_tests/test_for_zone_ravagers.mcfunction create mode 100644 Brilliance Datapack/data/do2/functions/mob_spawning/killers/test_for_ravagers.mcfunction create mode 100644 JSON/mob_names.json diff --git a/Brilliance Datapack/TODO.md b/Brilliance Datapack/TODO.md index d863ff5a..e8bb89c2 100644 --- a/Brilliance Datapack/TODO.md +++ b/Brilliance Datapack/TODO.md @@ -1,5 +1,5 @@ # Other TODO: -- Barrels with items in it, drop their items when level controller swaps around. +- Limit mobs per level to 30 for level controller. - Add Level 3, Level 4 & Backrooms to level controller mob control. - Config Info "booklet" needs to be updated with the new force saturation level - Go into more detail on the Fresh Runs & Balance Changes in the config book. @@ -10,16 +10,12 @@ - Track embers DROPPED in dungeon - Track embers ATTEMPTED to be RELEASED. - Track treasure DROPPED in dungeon -- Track treasure ATTEMPTED to be RELEASED._ +- Track treasure ATTEMPTED to be RELEASED. - Fresh runs, reset_stat_containers contains a link to the document. Should the doc be moved to a more permanent location OR as a PDF on tracked out's website URL needs to be adjusted. - Finish the level interface book. - Need Mob Amount & Names implemented. - Fish markers have same issue as ravager markers, can be duplicated as it takes several ticks to summon markers so it can attempt to summon 99 of them for multiple ticks letting them stack up. - Have dropper config book have LINKS to each of the dropper categories. -- Debate adding either `tracked:0b` or `tracked:1b` to egg rewards. - - `tracked:0b` counts the crowns as floor crowns. Makes it easier to find out total crowns this run. - - `tracked:1b` counts the crowns as already tracked crowns. - - **_Currently_**: is `tracked:1b` just so the crowns aren't broken until we discuss this. - DM each person on the list of players in the credits tab ask them for a short description/saying/quote for their advancement. - Check credit list to add ALL players to the credits tab. - Move all HERMITCRAFT items from resourcepack/assets/do2 to resourcepack/assets/hermitcraft diff --git a/Brilliance Datapack/data/do2/functions/dungeon_setup/summon/ravagers.mcfunction b/Brilliance Datapack/data/do2/functions/dungeon_setup/summon/ravagers.mcfunction index 9a1043df..7ae3d9cb 100644 --- a/Brilliance Datapack/data/do2/functions/dungeon_setup/summon/ravagers.mcfunction +++ b/Brilliance Datapack/data/do2/functions/dungeon_setup/summon/ravagers.mcfunction @@ -1,4 +1,3 @@ # - Make sure we don't have duplicates - kill @e[type=ravager] - schedule function do2:dungeon_setup/summon/summon_ravagers 3t 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 2bfcc5c1..889a2924 100644 --- a/Brilliance Datapack/data/do2/functions/events/on_100_ticks.mcfunction +++ b/Brilliance Datapack/data/do2/functions/events/on_100_ticks.mcfunction @@ -11,9 +11,10 @@ execute if score $dungeon do2.run.active matches 1.. run function do2:scoreboard # Check if anything needs to be updated due to Level Controller changes. # TODO: also update mob names, and amount. -execute if score $dungeon do2.run.active matches 0 run function do2:dungeon_setup/test_for_ravagers -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 +# TODO: update these tests, after level controller is fixed. +#execute if score $dungeon do2.run.active matches 0 run function do2:dungeon_setup/test_for_ravagers +#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. diff --git a/Brilliance Datapack/data/do2/functions/level_controller/add_mob_names/add_numbered_ravager_name.mcfunction b/Brilliance Datapack/data/do2/functions/level_controller/add_mob_names/add_numbered_ravager_name.mcfunction new file mode 100644 index 00000000..3d7ecbc5 --- /dev/null +++ b/Brilliance Datapack/data/do2/functions/level_controller/add_mob_names/add_numbered_ravager_name.mcfunction @@ -0,0 +1,20 @@ +# TODO: Currently only counts ravagers in their ZONE, not across the entire level. Need to fix, and exclude special mobs in the count. +# Count Ravagers +scoreboard objectives add do2.tests.amountOfRavagers dummy +execute store result score $dungeon do2.tests.amountOfRavagers run data get storage do2:mobs mobNames + +# Humans count from 1, computers count from 0. Add a fix. +scoreboard players add $dungeon do2.tests.amountOfRavagers 1 + +# Summon a text_display entity, to convert data into raw text, to store the raw text as a mob name. +summon minecraft:text_display -508 123 1956 {Tags:["ConvertToTextHelper"],text:'[{"text":"Ravager: #"},{"score":{"name":"$dungeon","objective":"do2.tests.amountOfRavagers"}}]'} +data modify storage do2:mobs mobNames append from entity @e[type=minecraft:text_display,tag=ConvertToTextHelper,limit=1] text +scoreboard players add $dungeon do2.utility.mobNamesCount 1 + +# Cleanup +kill @e[type=minecraft:text_display,tag=ConvertToTextHelper] +scoreboard objectives remove do2.tests.amountOfRavagers +scoreboard players remove $dungeon do2.tests.amountOfRavagers 1 + +# If there STILL isn't enough mobNames for the amount of names needed, loop this function. +execute if score $dungeon do2.utility.mobNamesCount < $l1z1 do2.config.mc.levelZoneMobCount run function do2:level_controller/add_mob_names/add_numbered_ravager_name diff --git a/Brilliance Datapack/data/do2/functions/level_controller/add_mob_names/add_ravager_name_to_list.mcfunction b/Brilliance Datapack/data/do2/functions/level_controller/add_mob_names/add_ravager_name_to_list.mcfunction new file mode 100644 index 00000000..65b2f1f5 --- /dev/null +++ b/Brilliance Datapack/data/do2/functions/level_controller/add_mob_names/add_ravager_name_to_list.mcfunction @@ -0,0 +1,28 @@ +# If there are no MORE preset names left, add an ID'ed numbered name. +execute unless data storage do2:mobs preset_names[0] run function do2:level_controller/add_mob_names/add_numbered_ravager_name +execute unless data storage do2:mobs preset_names[0] run return 0 + +# Generate a random number, Min = 0, Max = Amount of names in the list +execute store result score $dungeon do2.utility.randomNumberRange run data get storage do2:mobs preset_names +function do2:random_gen/generate_random_number +# Remove names until do2:tests array[0] becomes the randomly chosen name. +scoreboard objectives add do2.tests.arrayIndex dummy +scoreboard players operation $dungeon do2.tests.arrayIndex = $dungeon do2.utility.randomNum +data modify storage do2:tests array set from storage do2:mobs preset_names +function do2:level_controller/array_manipulation/get_from_index + +# add name to the list +data modify storage do2:mobs mobNames append from storage do2:tests array[0] +scoreboard players add $dungeon do2.utility.mobNamesCount 1 + + +# Remove the name as a valid name for future generation this time. +data modify storage do2:tests array set from storage do2:mobs preset_names +data modify storage do2:tests newArray set value [] +scoreboard players operation $dungeon do2.tests.arrayIndex = $dungeon do2.utility.randomNum +function do2:level_controller/array_manipulation/splice_from_index +data modify storage do2:mobs preset_names set from storage do2:tests newArray + + +# If there STILL isn't enough mobNames for the amount of names needed, loop this function. +execute if score $dungeon do2.utility.mobNamesCount < $l1z1 do2.config.mc.levelZoneMobCount run function do2:level_controller/add_mob_names/add_ravager_name_to_list diff --git a/Brilliance Datapack/data/do2/functions/level_controller/add_mob_names/ravager_names.mcfunction b/Brilliance Datapack/data/do2/functions/level_controller/add_mob_names/ravager_names.mcfunction new file mode 100644 index 00000000..1f19ac4e --- /dev/null +++ b/Brilliance Datapack/data/do2/functions/level_controller/add_mob_names/ravager_names.mcfunction @@ -0,0 +1,2 @@ +data modify storage do2:mobs preset_names set value ['{"text":"Lasagna"}','{"text":"Laser Beams!"}','{"text":"Meatball"}','{"text":"Snausages"}','{"text":"Greed"}','{"text":"MrsTango"}','{"text":"Beast #002"}','{"text":"Skill Issue"}','{"text":"Nugget"}','{"text":"Taco"}','{"text":"Hugs and Kisses"}','{"text":"Bad Luck. No really...it was bad luck"}','{"text":"Beast #007"}','{"text":"Pumpkin"}','{"text":"Poor Life Choices"}','{"text":"Jellie"}','{"text":"Hot Breath"}','{"text":"Tango\\\'s Cough"}','{"text":"Beast #003"}','{"text":"Unknown Ravager"}','{"text":"Stumbles"}','{"text":"Shracker"}','{"text":"Beast #004"}','{"text":"Froomkins"}','{"text":"big butts and I cannot lie"}','{"text":"Commander Drool"}','{"text":"Jimmy Jingles"}','{"text":"Deadly Blueberries"}','{"text":"Tinkers"}','{"text":"Flubsy Skadeedles"}','{"text":"Waffles"}','{"text":"Ladders"}','{"text":"Doughnuts"}','{"text":"Wubsy"}','{"text":"Munchies"}','{"text":"Miss Management"}','{"text":"Beast #025"}','{"text":"Sir Fluffykins of the Dungeon"}','{"text":"Skadoodles"}','{"text":"Beast #029"}','{"text":"Dunga Dunga Dunga"}','{"text":"Captain Snoodle Pants"}','{"text":"Mr. Poopy Head"}','{"text":"Trolly McTrollface"}'] +function do2:level_controller/add_mob_names/add_ravager_name_to_list diff --git a/Brilliance Datapack/data/do2/functions/level_controller/array_manipulation/get_from_index.mcfunction b/Brilliance Datapack/data/do2/functions/level_controller/array_manipulation/get_from_index.mcfunction new file mode 100644 index 00000000..2f576a29 --- /dev/null +++ b/Brilliance Datapack/data/do2/functions/level_controller/array_manipulation/get_from_index.mcfunction @@ -0,0 +1,17 @@ +# $dungeon do2.tests.arrayIndex = TARGET INDEX +# do2:tests array = FULL ARRAY +# after running do2:tests array[0] = TARGET VALUE + + +# CHECK INDEX 0 EXISTS +execute unless data storage do2:tests array[0] run return 0 + +# REMOVING BEFORE INDEX +execute if score $dungeon do2.tests.arrayIndex matches 1.. run data remove storage do2:tests array[0] +execute if score $dungeon do2.tests.arrayIndex matches 1.. run scoreboard players remove $dungeon do2.tests.arrayIndex 1 +# REMOVING AFTER INDEX +execute if score $dungeon do2.tests.arrayIndex matches ..0 if data storage do2:tests array[1] run data remove storage do2:tests array[1] + +# CHECK IF REPEAT +execute if score $dungeon do2.tests.arrayIndex matches ..0 if data storage do2:tests array[1] run function do2:level_controller/array_manipulation/get_from_index +execute if score $dungeon do2.tests.arrayIndex matches 1.. run function do2:level_controller/array_manipulation/get_from_index diff --git a/Brilliance Datapack/data/do2/functions/level_controller/array_manipulation/splice_from_index.mcfunction b/Brilliance Datapack/data/do2/functions/level_controller/array_manipulation/splice_from_index.mcfunction new file mode 100644 index 00000000..912ad910 --- /dev/null +++ b/Brilliance Datapack/data/do2/functions/level_controller/array_manipulation/splice_from_index.mcfunction @@ -0,0 +1,24 @@ +# do2:tests array = FULL ARRAY +# do2:tests newArray = NEW ARRAY +# $dungeon do2.tests.arrayIndex = TARGET INDEX +# After completion, newArray will equal array minus the value at TARGET INDEX + + + +# ---- Have we reached the spliced index? + +# --- FALSE: +# copy array[0] into newArray +execute if score $dungeon do2.tests.arrayIndex matches 1.. run data modify storage do2:tests newArray append from storage do2:tests array[0] +# remove array[0] +execute if score $dungeon do2.tests.arrayIndex matches 1.. run data remove storage do2:tests array[0] +execute if score $dungeon do2.tests.arrayIndex matches 1.. run scoreboard players remove $dungeon do2.tests.arrayIndex 1 +execute if score $dungeon do2.tests.arrayIndex matches 1.. run function do2:level_controller/array_manipulation/splice_from_index + +# --- TRUE: +# remove array[0] +execute if score $dungeon do2.tests.arrayIndex matches ..0 run data remove storage do2:tests array[0] +# append rest of array into newArray +execute if score $dungeon do2.tests.arrayIndex matches ..0 run function do2:level_controller/array_manipulation/splice_from_index_helper +# exit loop +execute if score $dungeon do2.tests.arrayIndex matches ..0 run return 0 diff --git a/Brilliance Datapack/data/do2/functions/level_controller/array_manipulation/splice_from_index_helper.mcfunction b/Brilliance Datapack/data/do2/functions/level_controller/array_manipulation/splice_from_index_helper.mcfunction new file mode 100644 index 00000000..33b8ceac --- /dev/null +++ b/Brilliance Datapack/data/do2/functions/level_controller/array_manipulation/splice_from_index_helper.mcfunction @@ -0,0 +1,5 @@ +# append rest of array into newArray +execute unless data storage do2:tests array[0] run return 0 +data modify storage do2:tests newArray append from storage do2:tests array[0] +data remove storage do2:tests array[0] +function do2:level_controller/array_manipulation/splice_from_index_helper diff --git a/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs.mcfunction b/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs.mcfunction index 957d48ae..ae70d0f4 100644 --- a/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs.mcfunction +++ b/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs.mcfunction @@ -1,13 +1,34 @@ # Setup +function do2:level_controller/clone_storages function do2:level_controller/get_mob_count/count_mobs function do2:level_controller/get_mob_names/get_mob_names # L1 +kill @e[type=ravager,tag=L1Z1] +kill @e[type=ravager,tag=L1Z2] +kill @e[type=ravager,tag=L1Z3] +kill @e[type=ravager,tag=L1Z4] +kill @e[type=ravager,tag=L1Z5] + function do2:level_controller/generate_mobs/l1z1 function do2:level_controller/generate_mobs/l1z2 function do2:level_controller/generate_mobs/l1z3 execute if score $dungeon do2.config.mc.level1Zones matches 0 run function do2:level_controller/generate_mobs/l1z4 execute if score $dungeon do2.config.mc.level1Zones matches 0 run function do2:level_controller/generate_mobs/l1z5 + +# L2 +kill @e[type=ravager,tag=L2Z1] +kill @e[type=ravager,tag=L2Z2] +kill @e[type=ravager,tag=L2Z3] +kill @e[type=ravager,tag=L2Z4] +kill @e[type=ravager,tag=L2Z5] + +function do2:level_controller/generate_mobs/l2z1 +function do2:level_controller/generate_mobs/l2z2 +function do2:level_controller/generate_mobs/l2z3 +execute if score $dungeon do2.config.mc.level2Zones matches 0 run function do2:level_controller/generate_mobs/l2z4 +execute if score $dungeon do2.config.mc.level2Zones matches 0 run function do2:level_controller/generate_mobs/l2z5 + diff --git a/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/generate_a_ravager.mcfunction b/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/generate_a_ravager.mcfunction deleted file mode 100644 index 327ea805..00000000 --- a/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/generate_a_ravager.mcfunction +++ /dev/null @@ -1,28 +0,0 @@ -# If no more mobs need to be made, return -execute if score $dungeon do2.utility.mobGeneration matches 0 run return - -# Summon a ravager -summon minecraft:ravager -500 70 2000 {PersistenceRequired:1b, Invulnerable: 1b, Tags: ["newly_generated_mob","mob_being_worked_on"], Health: 100f, CustomName: '{"text":"NAME-NOT-INCLUDED"}', Fire: -1s} - -# Count how many names are in the list. -execute store result score $dungeon do2.utility.mobNamesCount run data get storage do2:mobs mobNames - -# Generate a random number, Min = 0, Max = Amount of names in the list -scoreboard players operation $dungeon do2.utility.randomNumberRange = $dungeon do2.utility.mobNamesCount -function do2:random_gen/generate_random_number - -# Copy both the SCORE and the DATA as we will be making modifications -scoreboard players operation $dungeon_2 do2.utility.mobNamesCount = $dungeon do2.utility.randomNum -data modify storage do2:mobs copy set from storage do2:mobs mobNames -# Remove names until do2:mobs copy[0] becomes the randomly chosen name. -function do2:level_controller/generate_mobs/get_from_random_number - -# Merge the randomly chosen name INTO the mob -data modify entity @e[tag=mob_being_worked_on,limit=1] CustomName set from storage do2:mobs copy[0] - - -# Note a mob has been generated -tag @e[tag=mob_being_worked_on] remove mob_being_worked_on -scoreboard players remove $dungeon do2.utility.mobGeneration 1 -# If more mobs need to be summoned, run this function again -execute if score $dungeon do2.utility.mobGeneration matches 1.. run function do2:level_controller/generate_mobs/generate_a_ravager diff --git a/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/generate_enough_ravagers.mcfunction b/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/generate_enough_ravagers.mcfunction new file mode 100644 index 00000000..0840392e --- /dev/null +++ b/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/generate_enough_ravagers.mcfunction @@ -0,0 +1,39 @@ + +# If no more mobs need to be made, return +execute if score $dungeon do2.utility.mobGeneration matches ..0 run return 0 + +# Summon a ravager +summon minecraft:ravager -500 70 2000 {PersistenceRequired:1b, Invulnerable: 1b, Tags: ["newly_generated_mob","mob_being_worked_on"], Health: 100f, CustomName: '{"text":"NAME-NOT-INCLUDED"}', Fire: -1s} + +# Count how many names are in the list. +execute store result score $dungeon do2.utility.mobNamesCount run data get storage do2:mobs mobNames +# Generate a random number, Min = 0, Max = Amount of names in the list +scoreboard players operation $dungeon do2.utility.randomNumberRange = $dungeon do2.utility.mobNamesCount +function do2:random_gen/generate_random_number + +# Remove names until do2:tests array[0] becomes the randomly chosen name. +scoreboard objectives add do2.tests.arrayIndex dummy +scoreboard players operation $dungeon do2.tests.arrayIndex = $dungeon do2.utility.randomNum +data modify storage do2:tests array set from storage do2:mobs mobNames +function do2:level_controller/array_manipulation/get_from_index +# Merge the randomly chosen name INTO the mob +data modify entity @e[tag=mob_being_worked_on,limit=1] CustomName set from storage do2:tests array[0] + +# Remove the name as a valid name for future generation this time. +data modify storage do2:tests array set from storage do2:mobs mobNames +data modify storage do2:tests newArray set value [] +scoreboard players operation $dungeon do2.tests.arrayIndex = $dungeon do2.utility.randomNum +function do2:level_controller/array_manipulation/splice_from_index +data modify storage do2:mobs mobNames set from storage do2:tests newArray + +# Note a mob has been generated +tag @e[tag=mob_being_worked_on] remove mob_being_worked_on +scoreboard players remove $dungeon do2.utility.mobGeneration 1 + +# delete testing items +execute if score $dungeon do2.tests.arrayIndex matches ..0 run data remove storage do2:tests array +execute if score $dungeon do2.tests.arrayIndex matches ..0 run data remove storage do2:tests newArray +scoreboard objectives remove do2.tests.arrayIndex + +# If more mobs need to be summoned, run this function again +execute if score $dungeon do2.utility.mobGeneration matches 1.. run function do2:level_controller/generate_mobs/generate_enough_ravagers diff --git a/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/get_from_random_number.mcfunction b/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/get_from_random_number.mcfunction deleted file mode 100644 index 7437aa0a..00000000 --- a/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/get_from_random_number.mcfunction +++ /dev/null @@ -1,8 +0,0 @@ -# If NO MORE need to be removed, return out of this function. -execute if score $dungeon_2 do2.utility.mobNamesCount matches ..0 run return 0 -# Remove ONE from both the SCORE -scoreboard players remove $dungeon_2 do2.utility.mobNamesCount 1 -# And remove ONE from the array -data remove storage do2:mobs copy[0] -# If MORE is needed to be remove, repeat this function -execute unless score $dungeon_2 do2.utility.mobNamesCount matches ..0 run function do2:level_controller/generate_mobs/get_from_random_number diff --git a/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/l1z1.mcfunction b/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/l1z1.mcfunction index 37af065d..1735e6f6 100644 --- a/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/l1z1.mcfunction +++ b/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/l1z1.mcfunction @@ -1,15 +1,18 @@ -# Check for issues -execute if score $l1z1 do2.config.mc.levelZoneMobCount matches 0 as @a[scores={do2.logs.dungeon_setup=3..}] run tellraw @s ["",{"text":"[§9B§r]: L1Z1's mob count is empty. No mobs will generate in this zone."}] -execute store result score $dungeon do2.utility.mobNamesCount run data get storage do2:mobs level1_zone1 -execute if score $dungeon do2.utility.mobNamesCount matches 0 as @a[scores={do2.logs.dungeon_setup=3..}] run tellraw @s ["",{"text":"[§9B§r]: L1Z1's mob names are empty. Mob's names will be empty."}] -execute if score $dungeon do2.utility.mobNamesCount matches 0 run data modify storage do2:mobs level1_zone1 set value ['{"text":""}'] - - # Setup +execute store result score $dungeon do2.utility.mobNamesCount run data get storage do2:mobs level1_zone1 scoreboard players operation $dungeon do2.utility.mobGeneration = $l1z1 do2.config.mc.levelZoneMobCount data modify storage do2:mobs mobNames set from storage do2:mobs level1_zone1 -function do2:level_controller/generate_mobs/generate_a_ravager +# - Check for issues - +# Check for mob AMOUNT count +execute if score $l1z1 do2.config.mc.levelZoneMobCount matches ..0 as @a[scores={do2.logs.dungeon_setup=3..}] run tellraw @s ["",{"text":"[§9B§r]: L1Z1's mob count is empty. No mobs will generate in this zone."}] +execute if score $l1z1 do2.config.mc.levelZoneMobCount matches ..0 run scoreboard players set $l1z1 do2.config.mc.levelZoneMobCount 0 +# Check for sufficient mob NAMES +execute if score $dungeon do2.utility.mobNamesCount < $l1z1 do2.config.mc.levelZoneMobCount as @a[scores={do2.logs.dungeon_setup=3..}] run tellraw @s ["",{"text":"[§9B§r]: Not enough L1Z1's mob names for L1Z1's mob count. Adding random names to fix."}] +execute if score $dungeon do2.utility.mobNamesCount < $l1z1 do2.config.mc.levelZoneMobCount run function do2:level_controller/add_mob_names/ravager_names + +# Generate enough ravagers. +function do2:level_controller/generate_mobs/generate_enough_ravagers # Finish execute as @e[tag=newly_generated_mob] run tp @s @e[type=marker,tag=L1Z1,limit=1,sort=random] diff --git a/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/l1z2.mcfunction b/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/l1z2.mcfunction index eaf2276c..b454021a 100644 --- a/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/l1z2.mcfunction +++ b/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/l1z2.mcfunction @@ -1,16 +1,20 @@ -# Check for issues -execute if score $l1z2 do2.config.mc.levelZoneMobCount matches 0 as @a[scores={do2.logs.dungeon_setup=3..}] run tellraw @s ["",{"text":"[§9B§r]: L1Z2's mob count is empty. No mobs will generate in this zone."}] -execute store result score $dungeon do2.utility.mobNamesCount run data get storage do2:mobs level1_zone2 -execute if score $dungeon do2.utility.mobNamesCount matches 0 as @a[scores={do2.logs.dungeon_setup=3..}] run tellraw @s ["",{"text":"[§9B§r]: L1Z2's mob names are empty. Mob's names will be empty."}] -execute if score $dungeon do2.utility.mobNamesCount matches 0 run data modify storage do2:mobs level1_zone2 set value ['{"text":""}'] - # Setup +execute store result score $dungeon do2.utility.mobNamesCount run data get storage do2:mobs level1_zone1 scoreboard players operation $dungeon do2.utility.mobGeneration = $l1z2 do2.config.mc.levelZoneMobCount data modify storage do2:mobs mobNames set from storage do2:mobs level1_zone2 -function do2:level_controller/generate_mobs/generate_a_ravager +# - Check for issues - +# Check for mob AMOUNT count +execute if score $l1z2 do2.config.mc.levelZoneMobCount matches ..0 as @a[scores={do2.logs.dungeon_setup=3..}] run tellraw @s ["",{"text":"[§9B§r]: L1Z2's mob count is empty. No mobs will generate in this zone."}] +execute if score $l1z2 do2.config.mc.levelZoneMobCount matches ..0 run scoreboard players set $l1z2 do2.config.mc.levelZoneMobCount 0 +# Check for sufficient mob NAMES +execute if score $dungeon do2.utility.mobNamesCount < $l1z2 do2.config.mc.levelZoneMobCount as @a[scores={do2.logs.dungeon_setup=3..}] run tellraw @s ["",{"text":"[§9B§r]: Not enough L1Z2's mob names for L1Z2's mob count. Adding random names to fix."}] +execute if score $dungeon do2.utility.mobNamesCount < $l1z2 do2.config.mc.levelZoneMobCount run function do2:level_controller/add_mob_names/ravager_names + +# Generate enough ravagers. +function do2:level_controller/generate_mobs/generate_enough_ravagers # Finish -execute as @e[tag=newly_generated_mob] run tp @s @e[type=marker,tag=L1Z2,limit=1,sort=random] -execute as @e[tag=newly_generated_mob] run tag @s add L1Z2 +execute as @e[tag=newly_generated_mob] run tp @s @e[type=marker,tag=l1z2,limit=1,sort=random] +execute as @e[tag=newly_generated_mob] run tag @s add l1z2 execute as @e[tag=newly_generated_mob] run tag @s remove newly_generated_mob diff --git a/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/l1z3.mcfunction b/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/l1z3.mcfunction index ca59c33c..a0fc335c 100644 --- a/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/l1z3.mcfunction +++ b/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/l1z3.mcfunction @@ -1,16 +1,20 @@ -# Check for issues -execute if score $l1z3 do2.config.mc.levelZoneMobCount matches 0 as @a[scores={do2.logs.dungeon_setup=3..}] run tellraw @s ["",{"text":"[§9B§r]: L1Z3's mob count is empty. No mobs will generate in this zone."}] -execute store result score $dungeon do2.utility.mobNamesCount run data get storage do2:mobs level1_zone3 -execute if score $dungeon do2.utility.mobNamesCount matches 0 as @a[scores={do2.logs.dungeon_setup=3..}] run tellraw @s ["",{"text":"[§9B§r]: L1Z3's mob names are empty. Mob's names will be empty."}] -execute if score $dungeon do2.utility.mobNamesCount matches 0 run data modify storage do2:mobs level1_zone3 set value ['{"text":""}'] - # Setup +execute store result score $dungeon do2.utility.mobNamesCount run data get storage do2:mobs level1_zone1 scoreboard players operation $dungeon do2.utility.mobGeneration = $l1z3 do2.config.mc.levelZoneMobCount data modify storage do2:mobs mobNames set from storage do2:mobs level1_zone3 -function do2:level_controller/generate_mobs/generate_a_ravager +# - Check for issues - +# Check for mob AMOUNT count +execute if score $l1z3 do2.config.mc.levelZoneMobCount matches ..0 as @a[scores={do2.logs.dungeon_setup=3..}] run tellraw @s ["",{"text":"[§9B§r]: L1Z3's mob count is empty. No mobs will generate in this zone."}] +execute if score $l1z3 do2.config.mc.levelZoneMobCount matches ..0 run scoreboard players set $l1z3 do2.config.mc.levelZoneMobCount 0 +# Check for sufficient mob NAMES +execute if score $dungeon do2.utility.mobNamesCount < $l1z3 do2.config.mc.levelZoneMobCount as @a[scores={do2.logs.dungeon_setup=3..}] run tellraw @s ["",{"text":"[§9B§r]: Not enough L1Z3's mob names for L1Z3's mob count. Adding random names to fix."}] +execute if score $dungeon do2.utility.mobNamesCount < $l1z3 do2.config.mc.levelZoneMobCount run function do2:level_controller/add_mob_names/ravager_names + +# Generate enough ravagers. +function do2:level_controller/generate_mobs/generate_enough_ravagers # Finish -execute as @e[tag=newly_generated_mob] run tp @s @e[type=marker,tag=L1Z3,limit=1,sort=random] -execute as @e[tag=newly_generated_mob] run tag @s add L1Z3 +execute as @e[tag=newly_generated_mob] run tp @s @e[type=marker,tag=l1z3,limit=1,sort=random] +execute as @e[tag=newly_generated_mob] run tag @s add l1z3 execute as @e[tag=newly_generated_mob] run tag @s remove newly_generated_mob diff --git a/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/l1z4.mcfunction b/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/l1z4.mcfunction index 5709dfc8..fc3f1384 100644 --- a/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/l1z4.mcfunction +++ b/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/l1z4.mcfunction @@ -1,16 +1,20 @@ -# Check for issues -execute if score $l1z4 do2.config.mc.levelZoneMobCount matches 0 as @a[scores={do2.logs.dungeon_setup=3..}] run tellraw @s ["",{"text":"[§9B§r]: L1Z4's mob count is empty. No mobs will generate in this zone."}] -execute store result score $dungeon do2.utility.mobNamesCount run data get storage do2:mobs level1_zone4 -execute if score $dungeon do2.utility.mobNamesCount matches 0 as @a[scores={do2.logs.dungeon_setup=3..}] run tellraw @s ["",{"text":"[§9B§r]: L1Z4's mob names are empty. Mob's names will be empty."}] -execute if score $dungeon do2.utility.mobNamesCount matches 0 run data modify storage do2:mobs level1_zone4 set value ['{"text":""}'] - # Setup +execute store result score $dungeon do2.utility.mobNamesCount run data get storage do2:mobs level1_zone1 scoreboard players operation $dungeon do2.utility.mobGeneration = $l1z4 do2.config.mc.levelZoneMobCount data modify storage do2:mobs mobNames set from storage do2:mobs level1_zone4 -function do2:level_controller/generate_mobs/generate_a_ravager +# - Check for issues - +# Check for mob AMOUNT count +execute if score $l1z4 do2.config.mc.levelZoneMobCount matches ..0 as @a[scores={do2.logs.dungeon_setup=3..}] run tellraw @s ["",{"text":"[§9B§r]: L1Z4's mob count is empty. No mobs will generate in this zone."}] +execute if score $l1z4 do2.config.mc.levelZoneMobCount matches ..0 run scoreboard players set $l1z4 do2.config.mc.levelZoneMobCount 0 +# Check for sufficient mob NAMES +execute if score $dungeon do2.utility.mobNamesCount < $l1z4 do2.config.mc.levelZoneMobCount as @a[scores={do2.logs.dungeon_setup=3..}] run tellraw @s ["",{"text":"[§9B§r]: Not enough L1Z4's mob names for L1Z4's mob count. Adding random names to fix."}] +execute if score $dungeon do2.utility.mobNamesCount < $l1z4 do2.config.mc.levelZoneMobCount run function do2:level_controller/add_mob_names/ravager_names + +# Generate enough ravagers. +function do2:level_controller/generate_mobs/generate_enough_ravagers # Finish -execute as @e[tag=newly_generated_mob] run tp @s @e[type=marker,tag=L1Z4,limit=1,sort=random] -execute as @e[tag=newly_generated_mob] run tag @s add L1Z4 +execute as @e[tag=newly_generated_mob] run tp @s @e[type=marker,tag=l1z4,limit=1,sort=random] +execute as @e[tag=newly_generated_mob] run tag @s add l1z4 execute as @e[tag=newly_generated_mob] run tag @s remove newly_generated_mob diff --git a/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/l1z5.mcfunction b/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/l1z5.mcfunction index d3ba2455..7ed1b4d5 100644 --- a/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/l1z5.mcfunction +++ b/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/l1z5.mcfunction @@ -1,16 +1,20 @@ -# Check for issues -execute if score $l1z5 do2.config.mc.levelZoneMobCount matches 0 as @a[scores={do2.logs.dungeon_setup=3..}] run tellraw @s ["",{"text":"[§9B§r]: L1Z5's mob count is empty. No mobs will generate in this zone."}] -execute store result score $dungeon do2.utility.mobNamesCount run data get storage do2:mobs level1_zone5 -execute if score $dungeon do2.utility.mobNamesCount matches 0 as @a[scores={do2.logs.dungeon_setup=3..}] run tellraw @s ["",{"text":"[§9B§r]: L1Z5's mob names are empty. Mob's names will be empty."}] -execute if score $dungeon do2.utility.mobNamesCount matches 0 run data modify storage do2:mobs level1_zone5 set value ['{"text":""}'] - # Setup +execute store result score $dungeon do2.utility.mobNamesCount run data get storage do2:mobs level1_zone1 scoreboard players operation $dungeon do2.utility.mobGeneration = $l1z5 do2.config.mc.levelZoneMobCount data modify storage do2:mobs mobNames set from storage do2:mobs level1_zone5 -function do2:level_controller/generate_mobs/generate_a_ravager +# - Check for issues - +# Check for mob AMOUNT count +execute if score $l1z5 do2.config.mc.levelZoneMobCount matches ..0 as @a[scores={do2.logs.dungeon_setup=3..}] run tellraw @s ["",{"text":"[§9B§r]: L1Z5's mob count is empty. No mobs will generate in this zone."}] +execute if score $l1z5 do2.config.mc.levelZoneMobCount matches ..0 run scoreboard players set $l1z5 do2.config.mc.levelZoneMobCount 0 +# Check for sufficient mob NAMES +execute if score $dungeon do2.utility.mobNamesCount < $l1z5 do2.config.mc.levelZoneMobCount as @a[scores={do2.logs.dungeon_setup=3..}] run tellraw @s ["",{"text":"[§9B§r]: Not enough L1Z5's mob names for L1Z5's mob count. Adding random names to fix."}] +execute if score $dungeon do2.utility.mobNamesCount < $l1z5 do2.config.mc.levelZoneMobCount run function do2:level_controller/add_mob_names/ravager_names + +# Generate enough ravagers. +function do2:level_controller/generate_mobs/generate_enough_ravagers # Finish -execute as @e[tag=newly_generated_mob] run tp @s @e[type=marker,tag=L1Z5,limit=1,sort=random] -execute as @e[tag=newly_generated_mob] run tag @s add L1Z5 +execute as @e[tag=newly_generated_mob] run tp @s @e[type=marker,tag=l1z5,limit=1,sort=random] +execute as @e[tag=newly_generated_mob] run tag @s add l1z5 execute as @e[tag=newly_generated_mob] run tag @s remove newly_generated_mob diff --git a/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/l2z1.mcfunction b/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/l2z1.mcfunction index 86b01ab5..993a1ffc 100644 --- a/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/l2z1.mcfunction +++ b/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/l2z1.mcfunction @@ -1,16 +1,20 @@ -# Check for issues -execute if score $l2z1 do2.config.mc.levelZoneMobCount matches 0 as @a[scores={do2.logs.dungeon_setup=3..}] run tellraw @s ["",{"text":"[§9B§r]: L2Z5's mob count is empty. No mobs will generate in this zone."}] -execute store result score $dungeon do2.utility.mobNamesCount run data get storage do2:mobs level2_zone1 -execute if score $dungeon do2.utility.mobNamesCount matches 0 as @a[scores={do2.logs.dungeon_setup=3..}] run tellraw @s ["",{"text":"[§9B§r]: L2Z5's mob names are empty. Mob's names will be empty."}] -execute if score $dungeon do2.utility.mobNamesCount matches 0 run data modify storage do2:mobs level2_zone1 set value ['{"text":""}'] - # Setup +execute store result score $dungeon do2.utility.mobNamesCount run data get storage do2:mobs level1_zone1 scoreboard players operation $dungeon do2.utility.mobGeneration = $l2z1 do2.config.mc.levelZoneMobCount data modify storage do2:mobs mobNames set from storage do2:mobs level2_zone1 -function do2:level_controller/generate_mobs/generate_a_ravager +# - Check for issues - +# Check for mob AMOUNT count +execute if score $l2z1 do2.config.mc.levelZoneMobCount matches ..0 as @a[scores={do2.logs.dungeon_setup=3..}] run tellraw @s ["",{"text":"[§9B§r]: L2Z1's mob count is empty. No mobs will generate in this zone."}] +execute if score $l2z1 do2.config.mc.levelZoneMobCount matches ..0 run scoreboard players set $l2z1 do2.config.mc.levelZoneMobCount 0 +# Check for sufficient mob NAMES +execute if score $dungeon do2.utility.mobNamesCount < $l2z1 do2.config.mc.levelZoneMobCount as @a[scores={do2.logs.dungeon_setup=3..}] run tellraw @s ["",{"text":"[§9B§r]: Not enough L2Z1's mob names for L2Z1's mob count. Adding random names to fix."}] +execute if score $dungeon do2.utility.mobNamesCount < $l2z1 do2.config.mc.levelZoneMobCount run function do2:level_controller/add_mob_names/ravager_names + +# Generate enough ravagers. +function do2:level_controller/generate_mobs/generate_enough_ravagers # Finish -execute as @e[tag=newly_generated_mob] run tp @s @e[type=marker,tag=L2Z1,limit=1,sort=random] -execute as @e[tag=newly_generated_mob] run tag @s add L2Z1 +execute as @e[tag=newly_generated_mob] run tp @s @e[type=marker,tag=l2z1,limit=1,sort=random] +execute as @e[tag=newly_generated_mob] run tag @s add l2z1 execute as @e[tag=newly_generated_mob] run tag @s remove newly_generated_mob diff --git a/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/l2z2.mcfunction b/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/l2z2.mcfunction index 206c4c25..1383d5c0 100644 --- a/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/l2z2.mcfunction +++ b/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/l2z2.mcfunction @@ -1,16 +1,21 @@ -# Check for issues -execute if score $l2z2 do2.config.mc.levelZoneMobCount matches 0 as @a[scores={do2.logs.dungeon_setup=3..}] run tellraw @s ["",{"text":"[§9B§r]: L2Z2's mob count is empty. No mobs will generate in this zone."}] -execute store result score $dungeon do2.utility.mobNamesCount run data get storage do2:mobs level2_zone2 -execute if score $dungeon do2.utility.mobNamesCount matches 0 as @a[scores={do2.logs.dungeon_setup=3..}] run tellraw @s ["",{"text":"[§9B§r]: L2Z2's mob names are empty. Mob's names will be empty."}] -execute if score $dungeon do2.utility.mobNamesCount matches 0 run data modify storage do2:mobs level2_zone2 set value ['{"text":""}'] - # Setup +execute store result score $dungeon do2.utility.mobNamesCount run data get storage do2:mobs level1_zone1 scoreboard players operation $dungeon do2.utility.mobGeneration = $l2z2 do2.config.mc.levelZoneMobCount data modify storage do2:mobs mobNames set from storage do2:mobs level2_zone2 -function do2:level_controller/generate_mobs/generate_a_ravager +# - Check for issues - +# Check for mob AMOUNT count +execute if score $l2z2 do2.config.mc.levelZoneMobCount matches ..0 as @a[scores={do2.logs.dungeon_setup=3..}] run tellraw @s ["",{"text":"[§9B§r]: L2Z2's mob count is empty. No mobs will generate in this zone."}] +execute if score $l2z2 do2.config.mc.levelZoneMobCount matches ..0 run scoreboard players set $l2z2 do2.config.mc.levelZoneMobCount 0 +# Check for sufficient mob NAMES +execute if score $dungeon do2.utility.mobNamesCount < $l2z2 do2.config.mc.levelZoneMobCount as @a[scores={do2.logs.dungeon_setup=3..}] run tellraw @s ["",{"text":"[§9B§r]: Not enough L2Z2's mob names for L2Z2's mob count. Adding random names to fix."}] +execute if score $dungeon do2.utility.mobNamesCount < $l2z2 do2.config.mc.levelZoneMobCount run function do2:level_controller/add_mob_names/ravager_names + + +# Generate enough ravagers. +function do2:level_controller/generate_mobs/generate_enough_ravagers # Finish -execute as @e[tag=newly_generated_mob] run tp @s @e[type=marker,tag=L2Z2,limit=1,sort=random] -execute as @e[tag=newly_generated_mob] run tag @s add L2Z2 +execute as @e[tag=newly_generated_mob] run tp @s @e[type=marker,tag=l2z2,limit=1,sort=random] +execute as @e[tag=newly_generated_mob] run tag @s add l2z2 execute as @e[tag=newly_generated_mob] run tag @s remove newly_generated_mob diff --git a/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/l2z3.mcfunction b/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/l2z3.mcfunction index 3a65e329..3711034e 100644 --- a/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/l2z3.mcfunction +++ b/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/l2z3.mcfunction @@ -1,16 +1,21 @@ -# Check for issues -execute if score $l2z3 do2.config.mc.levelZoneMobCount matches 0 as @a[scores={do2.logs.dungeon_setup=3..}] run tellraw @s ["",{"text":"[§9B§r]: L2Z3's mob count is empty. No mobs will generate in this zone."}] -execute store result score $dungeon do2.utility.mobNamesCount run data get storage do2:mobs level2_zone3 -execute if score $dungeon do2.utility.mobNamesCount matches 0 as @a[scores={do2.logs.dungeon_setup=3..}] run tellraw @s ["",{"text":"[§9B§r]: L2Z3's mob names are empty. Mob's names will be empty."}] -execute if score $dungeon do2.utility.mobNamesCount matches 0 run data modify storage do2:mobs level2_zone3 set value ['{"text":""}'] - # Setup +execute store result score $dungeon do2.utility.mobNamesCount run data get storage do2:mobs level1_zone1 scoreboard players operation $dungeon do2.utility.mobGeneration = $l2z3 do2.config.mc.levelZoneMobCount data modify storage do2:mobs mobNames set from storage do2:mobs level2_zone3 -function do2:level_controller/generate_mobs/generate_a_ravager +# - Check for issues - +# Check for mob AMOUNT count +execute if score $l2z3 do2.config.mc.levelZoneMobCount matches ..0 as @a[scores={do2.logs.dungeon_setup=3..}] run tellraw @s ["",{"text":"[§9B§r]: L2Z3's mob count is empty. No mobs will generate in this zone."}] +execute if score $l2z3 do2.config.mc.levelZoneMobCount matches ..0 run scoreboard players set $l2z3 do2.config.mc.levelZoneMobCount 0 +# Check for sufficient mob NAMES +execute if score $dungeon do2.utility.mobNamesCount < $l2z3 do2.config.mc.levelZoneMobCount as @a[scores={do2.logs.dungeon_setup=3..}] run tellraw @s ["",{"text":"[§9B§r]: Not enough L2Z3's mob names for L2Z3's mob count. Adding random names to fix."}] +execute if score $dungeon do2.utility.mobNamesCount < $l2z3 do2.config.mc.levelZoneMobCount run function do2:level_controller/add_mob_names/ravager_names + + +# Generate enough ravagers. +function do2:level_controller/generate_mobs/generate_enough_ravagers # Finish -execute as @e[tag=newly_generated_mob] run tp @s @e[type=marker,tag=L2Z3,limit=1,sort=random] -execute as @e[tag=newly_generated_mob] run tag @s add L2Z3 +execute as @e[tag=newly_generated_mob] run tp @s @e[type=marker,tag=l2z3,limit=1,sort=random] +execute as @e[tag=newly_generated_mob] run tag @s add l2z3 execute as @e[tag=newly_generated_mob] run tag @s remove newly_generated_mob diff --git a/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/l2z4.mcfunction b/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/l2z4.mcfunction index 1c408461..96e224ca 100644 --- a/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/l2z4.mcfunction +++ b/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/l2z4.mcfunction @@ -1,16 +1,21 @@ -# Check for issues -execute if score $l2z4 do2.config.mc.levelZoneMobCount matches 0 as @a[scores={do2.logs.dungeon_setup=3..}] run tellraw @s ["",{"text":"[§9B§r]: L2Z4's mob count is empty. No mobs will generate in this zone."}] -execute store result score $dungeon do2.utility.mobNamesCount run data get storage do2:mobs level2_zone4 -execute if score $dungeon do2.utility.mobNamesCount matches 0 as @a[scores={do2.logs.dungeon_setup=3..}] run tellraw @s ["",{"text":"[§9B§r]: L2Z4's mob names are empty. Mob's names will be empty."}] -execute if score $dungeon do2.utility.mobNamesCount matches 0 run data modify storage do2:mobs level2_zone4 set value ['{"text":""}'] - # Setup +execute store result score $dungeon do2.utility.mobNamesCount run data get storage do2:mobs level1_zone1 scoreboard players operation $dungeon do2.utility.mobGeneration = $l2z4 do2.config.mc.levelZoneMobCount data modify storage do2:mobs mobNames set from storage do2:mobs level2_zone4 -function do2:level_controller/generate_mobs/generate_a_ravager +# - Check for issues - +# Check for mob AMOUNT count +execute if score $l2z4 do2.config.mc.levelZoneMobCount matches ..0 as @a[scores={do2.logs.dungeon_setup=3..}] run tellraw @s ["",{"text":"[§9B§r]: L2Z4's mob count is empty. No mobs will generate in this zone."}] +execute if score $l2z4 do2.config.mc.levelZoneMobCount matches ..0 run scoreboard players set $l2z4 do2.config.mc.levelZoneMobCount 0 +# Check for sufficient mob NAMES +execute if score $dungeon do2.utility.mobNamesCount < $l2z4 do2.config.mc.levelZoneMobCount as @a[scores={do2.logs.dungeon_setup=3..}] run tellraw @s ["",{"text":"[§9B§r]: Not enough L2Z4's mob names for L2Z4's mob count. Adding random names to fix."}] +execute if score $dungeon do2.utility.mobNamesCount < $l2z4 do2.config.mc.levelZoneMobCount run function do2:level_controller/add_mob_names/ravager_names + + +# Generate enough ravagers. +function do2:level_controller/generate_mobs/generate_enough_ravagers # Finish -execute as @e[tag=newly_generated_mob] run tp @s @e[type=marker,tag=L2Z4,limit=1,sort=random] -execute as @e[tag=newly_generated_mob] run tag @s add L2Z4 +execute as @e[tag=newly_generated_mob] run tp @s @e[type=marker,tag=l2z4,limit=1,sort=random] +execute as @e[tag=newly_generated_mob] run tag @s add l2z4 execute as @e[tag=newly_generated_mob] run tag @s remove newly_generated_mob diff --git a/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/l2z5.mcfunction b/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/l2z5.mcfunction index 7220f7c6..e9f895b2 100644 --- a/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/l2z5.mcfunction +++ b/Brilliance Datapack/data/do2/functions/level_controller/generate_mobs/l2z5.mcfunction @@ -1,16 +1,21 @@ -# Check for issues -execute if score $l2z5 do2.config.mc.levelZoneMobCount matches 0 as @a[scores={do2.logs.dungeon_setup=3..}] run tellraw @s ["",{"text":"[§9B§r]: L2Z5's mob count is empty. No mobs will generate in this zone."}] -execute store result score $dungeon do2.utility.mobNamesCount run data get storage do2:mobs level2_zone5 -execute if score $dungeon do2.utility.mobNamesCount matches 0 as @a[scores={do2.logs.dungeon_setup=3..}] run tellraw @s ["",{"text":"[§9B§r]: L2Z5's mob names are empty. Mob's names will be empty."}] -execute if score $dungeon do2.utility.mobNamesCount matches 0 run data modify storage do2:mobs level2_zone5 set value ['{"text":""}'] - # Setup +execute store result score $dungeon do2.utility.mobNamesCount run data get storage do2:mobs level1_zone1 scoreboard players operation $dungeon do2.utility.mobGeneration = $l2z5 do2.config.mc.levelZoneMobCount data modify storage do2:mobs mobNames set from storage do2:mobs level2_zone5 -function do2:level_controller/generate_mobs/generate_a_ravager +# - Check for issues - +# Check for mob AMOUNT count +execute if score $l2z5 do2.config.mc.levelZoneMobCount matches ..0 as @a[scores={do2.logs.dungeon_setup=3..}] run tellraw @s ["",{"text":"[§9B§r]: L2Z5's mob count is empty. No mobs will generate in this zone."}] +execute if score $l2z5 do2.config.mc.levelZoneMobCount matches ..0 run scoreboard players set $l2z5 do2.config.mc.levelZoneMobCount 0 +# Check for sufficient mob NAMES +execute if score $dungeon do2.utility.mobNamesCount < $l2z5 do2.config.mc.levelZoneMobCount as @a[scores={do2.logs.dungeon_setup=3..}] run tellraw @s ["",{"text":"[§9B§r]: Not enough L2Z5's mob names for L2Z5's mob count. Adding random names to fix."}] +execute if score $dungeon do2.utility.mobNamesCount < $l2z5 do2.config.mc.levelZoneMobCount run function do2:level_controller/add_mob_names/ravager_names + + +# Generate enough ravagers. +function do2:level_controller/generate_mobs/generate_enough_ravagers # Finish -execute as @e[tag=newly_generated_mob] run tp @s @e[type=marker,tag=L2Z5,limit=1,sort=random] -execute as @e[tag=newly_generated_mob] run tag @s add L2Z5 +execute as @e[tag=newly_generated_mob] run tp @s @e[type=marker,tag=l2z5,limit=1,sort=random] +execute as @e[tag=newly_generated_mob] run tag @s add l2z5 execute as @e[tag=newly_generated_mob] run tag @s remove newly_generated_mob diff --git a/Brilliance Datapack/data/do2/functions/mob_spawning/killers/individual_tests/l1z1.mcfunction b/Brilliance Datapack/data/do2/functions/mob_spawning/killers/individual_tests/l1z1.mcfunction new file mode 100644 index 00000000..32aff2c8 --- /dev/null +++ b/Brilliance Datapack/data/do2/functions/mob_spawning/killers/individual_tests/l1z1.mcfunction @@ -0,0 +1,8 @@ +scoreboard players set $testing_number do2.config.mc.levelZoneMobCount 0 +execute as @e[type=ravager,tag=L1Z1] run scoreboard players add $testing_number do2.config.mc.levelZoneMobCount 1 +execute if score $l1z1 do2.config.mc.levelZoneMobCount = $testing_number do2.config.mc.levelZoneMobCount run return 0 +# Any code after this is ran when ravager count ISN'T matching + +tag @e[type=ravager,tag=L1Z1] add mob_editing + +execute if score $l1z1 do2.config.mc.levelZoneMobCount < $testing_number do2.config.mc.levelZoneMobCount run diff --git a/Brilliance Datapack/data/do2/functions/mob_spawning/killers/individual_tests/reduce_mobs.mcfunction b/Brilliance Datapack/data/do2/functions/mob_spawning/killers/individual_tests/reduce_mobs.mcfunction new file mode 100644 index 00000000..e69de29b diff --git a/Brilliance Datapack/data/do2/functions/mob_spawning/killers/individual_tests/test_for_zone_ravagers.mcfunction b/Brilliance Datapack/data/do2/functions/mob_spawning/killers/individual_tests/test_for_zone_ravagers.mcfunction new file mode 100644 index 00000000..b8841372 --- /dev/null +++ b/Brilliance Datapack/data/do2/functions/mob_spawning/killers/individual_tests/test_for_zone_ravagers.mcfunction @@ -0,0 +1 @@ +# There needs to be EXACTLY $testing_number do2.config.mc.levelZoneMobCount ravagers diff --git a/Brilliance Datapack/data/do2/functions/mob_spawning/killers/test_for_ravagers.mcfunction b/Brilliance Datapack/data/do2/functions/mob_spawning/killers/test_for_ravagers.mcfunction new file mode 100644 index 00000000..3dd75b1a --- /dev/null +++ b/Brilliance Datapack/data/do2/functions/mob_spawning/killers/test_for_ravagers.mcfunction @@ -0,0 +1,3 @@ +# Every 5s check ravagers + +function do2:mob_spawning/killers/individual_tests/l1z1 diff --git a/Brilliance Datapack/data/do2/functions/version.mcfunction b/Brilliance Datapack/data/do2/functions/version.mcfunction index c1b8268a..d4791321 100644 --- a/Brilliance Datapack/data/do2/functions/version.mcfunction +++ b/Brilliance Datapack/data/do2/functions/version.mcfunction @@ -1,4 +1,3 @@ +# DATAPACK VERSION NUMBER: 0.12.29 -# DATAPACK VERSION NUMBER: 0.12.28 - -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":"."}] +tellraw @s ["",{"text":"The §o§n§aBrilliance Datapack§r's version is: [§b0.12.29§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":"."}] diff --git a/JSON/mob_names.json b/JSON/mob_names.json new file mode 100644 index 00000000..9de60523 --- /dev/null +++ b/JSON/mob_names.json @@ -0,0 +1,56 @@ +{ + "ravagers": [ + "Lasagna", + "Laser Beams!", + "Meatball", + "Snausages", + "Greed", + "MrsTango", + "Beast #002", + "Skill Issue", + "Nugget", + "Taco", + "Hugs and Kisses", + "Bad Luck. No really...it was bad luck", + "Beast #007", + "Pumpkin", + "Poor Life Choices", + "Jellie", + "Hot Breath", + "Tango's Cough", + "Beast #003", + "Unknown Ravager", + "Stumbles", + "Shracker", + "Beast #004", + "Froomkins", + "big butts and I cannot lie", + "Commander Drool", + "Jimmy Jingles", + "Deadly Blueberries", + "Tinkers", + "Flubsy Skadeedles", + "Waffles", + "Ladders", + "Doughnuts", + "Wubsy", + "Munchies", + "Miss Management", + "Beast #025", + "Sir Fluffykins of the Dungeon", + "Skadoodles", + "Beast #029", + "Dunga Dunga Dunga", + "Captain Snoodle Pants", + "Mr. Poopy Head", + "Trolly McTrollface" + ], + "wardens": [ + "Panic", + "Pancakes", + "Pain", + "Pinky", + "Blinky", + "Inky" + ] +}