Skip to content

Commit

Permalink
Finished the level controller.
Browse files Browse the repository at this point in the history
  • Loading branch information
Frustrated-Programmer committed Dec 9, 2024
1 parent def7dc4 commit 781ed8b
Show file tree
Hide file tree
Showing 63 changed files with 693 additions and 339 deletions.
3 changes: 3 additions & 0 deletions Brilliance Datapack/TODO.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Other TODO:
- Egg Hunt advancements can trigger by spectators.
- Check for TOO MANY mobs to correct them.
- Rusty Repaired advancement
- 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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
kill @e[type=marker,tag=L0Z1]
kill @e[type=marker,tag=L0Z2]

#TODO: populate with more markers.
# - Zone 1 - (1 spots)
summon minecraft:marker -483 132 2006 {Duration: 2147483647, Tags: ["no-zones", "zone_marker", "L0Z1"]}
# - Zone 2 - (1 spots)
summon minecraft:marker -516 132 2028 {Duration: 2147483647, Tags: ["no-zones", "zone_marker", "L0Z2"]}

Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@ execute if score $dungeon do2.config.mc.level4Zones matches 0 run function do2:d
function do2:dungeon_setup/summon/no_zones/summon_level_3_markers
function do2:dungeon_setup/summon/no_zones/summon_willy_markers

# Training Room Markers
function do2:dungeon_setup/summon/no_zones/summon_training

# Turn invisible *all* markers.
function do2:dev/markers/turn_invisible/all
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ execute as @a[scores={do2.logs.dungeon_setup=3..}] run tellraw @s ["",{"text":"
# One Eyed Willy
execute at @e[type=marker,tag=L2WILLY,limit=1,sort=random] run summon minecraft:drowned ~ ~ ~ {PersistenceRequired:1b, Invulnerable: 1b, Tags: ["L2WILLY"], HandDropChances: [0.0f, 0.0f], Health: 20.0f, HandItems: [{id: "minecraft:trident", Count: 1b}, {}], CustomName: '{"text":"One Eyed Willie"}'}
# Training Room Drowned
summon minecraft:drowned -516 132 2028 {PersistenceRequired:1b, Invulnerable: 1b, Tags: ["L0TRAIN"], HandDropChances: [0.0f, 0.0f], Health: 20.0f, HandItems: [{id: "minecraft:trident", Count: 1b}, {}], CustomName: '{"text":"The Worst!!!"}'}
summon minecraft:drowned -516 132 2028 {PersistenceRequired:1b, Invulnerable: 1b, Tags: ["L0Z2"], HandDropChances: [0.0f, 0.0f], Health: 20.0f, HandItems: [{id: "minecraft:trident", Count: 1b}, {}], CustomName: '{"text":"The Worst!!!"}'}

# Davy Bones
summon minecraft:minecart -576 13 1984 {PersistenceRequired:1b, Invulnerable:1b, Passengers:[{Invulnerable:1b, Tags: ["L2DAVY"], id: "minecraft:stray", Health: 20.0f, Silent: 1b, CustomName: '{"text":"Davey Bones"}',HandItems:[{id: "minecraft:bow", Count: 1b, tag:{Damage: 0, Enchantments:[{lvl: 1s, id: "minecraft:unbreaking"},{lvl: 1s, id: "minecraft:power"}]}}]}]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ execute if score $dungeon do2.config.mc.controlSummons matches 0 if score $dunge
# Death Gauntlet Ravager
summon minecraft:ravager -632 -48 1990 {PersistenceRequired:1b, Tags: ["L0DEATHROOM"], Invulnerable: 1b, Health: 100f, CustomName: '{"text":"nothing, they survived Decked Out"}', Fire: -1s}
# Training Room Ravager
summon minecraft:ravager -483 132 2006 {PersistenceRequired:1b, Tags: ["L0TRAIN"], Invulnerable: 1b, Health: 100f, CustomName: '{"text":"Jellie"}', Fire: -1s}
summon minecraft:ravager -483 132 2006 {PersistenceRequired:1b, Tags: ["L0Z1"], Invulnerable: 1b, Health: 100f, CustomName: '{"text":"Jellie"}', Fire: -1s}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ scoreboard players set $dungeon do2.tests.all_killers_alive 0
# Check for One Eyed Willy
execute unless entity @e[type=minecraft:drowned,tag=L2WILLY] run scoreboard players set $dungeon do2.tests.all_killers_alive 1
# Check for Training Room Drowned
execute unless entity @e[type=minecraft:drowned,tag=L0TRAIN] run scoreboard players set $dungeon do2.tests.all_killers_alive 2
execute unless entity @e[type=minecraft:drowned,tag=L0Z2] run scoreboard players set $dungeon do2.tests.all_killers_alive 2
# Check for Davy Bones
execute unless entity @e[type=minecraft:stray,tag=L2DAVY] run scoreboard players set $dungeon do2.tests.all_killers_alive 3
# Check for Evokers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ execute unless entity @e[type=minecraft:ravager,tag=L2Z5] run scoreboard players
# Death Room Ravager
execute unless entity @e[type=minecraft:ravager,tag=L0DEATHROOM] run scoreboard players set $dungeon do2.tests.all_ravagers_alive 11
# Training Room Ravager
execute unless entity @e[type=minecraft:ravager,tag=L0TRAIN] run scoreboard players set $dungeon do2.tests.all_ravagers_alive 12
execute unless entity @e[type=minecraft:ravager,tag=L0Z1] run scoreboard players set $dungeon do2.tests.all_ravagers_alive 12

execute unless score $dungeon do2.tests.all_ravagers_alive matches 0 as @a[scores={do2.logs.dungeon_setup=3..}] run tellraw @s ["",{"text":"[§9B§r]: Missing Ravager §b#"},{"color":"aqua","score":{"name":"$dungeon","objective":"do2.tests.all_ravagers_alive"}}]
execute unless score $dungeon do2.tests.all_ravagers_alive matches 0 run function do2:dungeon_setup/summon/ravagers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ 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
scoreboard players add $dungeon do2.utility.mc.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
execute if score $dungeon do2.utility.mc.mobNamesCount < $l1z1 do2.config.mc.levelZoneMobCount run function do2:level_controller/add_mob_names/add_numbered_ravager_name
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ 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
scoreboard players add $dungeon do2.utility.mc.mobNamesCount 1


# Remove the name as a valid name for future generation this time.
Expand All @@ -25,4 +25,4 @@ 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
execute if score $dungeon do2.utility.mc.mobNamesCount < $l1z1 do2.config.mc.levelZoneMobCount run function do2:level_controller/add_mob_names/add_ravager_name_to_list
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,21 @@
function do2:level_controller/save_storages
function do2:level_controller/get_mob_count/count_mobs
function do2:level_controller/get_mob_names/get_mob_names
scoreboard players set $dungeon do2.utility.mc.collectingLogs 1
data modify storage do2:mobs mobCountErrors set value []
data modify storage do2:mobs mobNameCountErrors set value []

# For backwards compatibility
kill @e[tag=L0TRAIN]

# L0
kill @e[type=drowned,tag=L2WILLY]
kill @e[type=ravager,tag=L0Z1]
kill @e[type=drowned,tag=L0Z2]

function do2:level_controller/generate_mobs/zones/l2willy
function do2:level_controller/generate_mobs/zones/l0z1
function do2:level_controller/generate_mobs/zones/l0z2


# L1
Expand All @@ -12,11 +26,11 @@ 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
function do2:level_controller/generate_mobs/zones/l1z1
function do2:level_controller/generate_mobs/zones/l1z2
function do2:level_controller/generate_mobs/zones/l1z3
execute if score $dungeon do2.config.mc.level1Zones matches 0 run function do2:level_controller/generate_mobs/zones/l1z4
execute if score $dungeon do2.config.mc.level1Zones matches 0 run function do2:level_controller/generate_mobs/zones/l1z5


# L2
Expand All @@ -26,9 +40,35 @@ 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
function do2:level_controller/generate_mobs/zones/l2z1
function do2:level_controller/generate_mobs/zones/l2z2
function do2:level_controller/generate_mobs/zones/l2z3
execute if score $dungeon do2.config.mc.level2Zones matches 0 run function do2:level_controller/generate_mobs/zones/l2z4
execute if score $dungeon do2.config.mc.level2Zones matches 0 run function do2:level_controller/generate_mobs/zones/l2z5


# L3
kill @e[type=warden,tag=L3Z1]
kill @e[type=warden,tag=L3Z2]
kill @e[type=warden,tag=L3Z3]

function do2:level_controller/generate_mobs/zones/l3z1
function do2:level_controller/generate_mobs/zones/l3z2
function do2:level_controller/generate_mobs/zones/l3z3

# L4
kill @e[type=warden,tag=L4Z1]
kill @e[type=warden,tag=L4Z2]
kill @e[type=warden,tag=L4Z3]

function do2:level_controller/generate_mobs/zones/l4z1
function do2:level_controller/generate_mobs/zones/l4z2
function do2:level_controller/generate_mobs/zones/l4z3


# Display any errors
execute store result score $dungeon do2.utility.mc.collectingLogs run data get storage do2:mobs mobCountErrors
execute if score $dungeon do2.utility.mc.collectingLogs matches 1.. run function do2:level_controller/generate_mobs/log_mob_count_errors
execute store result score $dungeon do2.utility.mc.collectingLogs run data get storage do2:mobs mobNameCountErrors
execute if score $dungeon do2.utility.mc.collectingLogs matches 1.. run function do2:level_controller/generate_mobs/log_mob_name_count_errors
scoreboard players set $dungeon do2.utility.mc.collectingLogs 0
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@

# If no more mobs need to be made, return
execute if score $dungeon do2.utility.mobGeneration matches ..0 run return 0
execute if score $dungeon do2.utility.mc.mobGenerationCount 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}
# Summon mob
function do2:level_controller/generate_mobs/summon_correct_mob

# Count how many names are in the list.
execute store result score $dungeon do2.utility.mobNamesCount run data get storage do2:mobs mobNames
execute store result score $dungeon do2.utility.mc.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
scoreboard players operation $dungeon do2.utility.randomNumberRange = $dungeon do2.utility.mc.mobNamesCount
function do2:random_gen/generate_random_number

# Remove names until do2:tests array[0] becomes the randomly chosen name.
Expand All @@ -28,12 +28,13 @@ 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
scoreboard players remove $dungeon do2.utility.mc.mobGenerationCount 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
execute if score $dungeon do2.utility.mc.mobGenerationCount matches 1.. run function do2:level_controller/generate_mobs/generate_enough_mobs
execute if score $dungeon do2.utility.mc.mobGenerationCount matches ..0 run scoreboard players set $dungeon do2.utility.mc.mobGenerationType 0

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 781ed8b

Please sign in to comment.