Skip to content

Commit

Permalink
Using a preset name now shares and consume names from a single preset…
Browse files Browse the repository at this point in the history
… list.
  • Loading branch information
Frustrated-Programmer committed Dec 13, 2024
1 parent 979fa00 commit 33caefe
Show file tree
Hide file tree
Showing 15 changed files with 21 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# 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:mob_controller/add_mob_names/add_numbered_ravager_name
execute unless data storage do2:mobs preset_names[0] run function do2:mob_controller/add_mob_names/ravager_add_numbered_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
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.mc.mobNamesCount < $l1z1 do2.config.mc.levelZoneMobCount run function do2:mob_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:mob_controller/add_mob_names/ravager_add_name_to_list
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# 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
scoreboard players set $dungeon do2.tests.amountOfRavagers 0

# Count number of ravagers.
execute as @e[type=ravager] run scoreboard players add $dungeon do2.tests.amountOfRavagers 1
# Subtract 2 from that number. To no longer count backroom ravager & deathroom ravager.
scoreboard players remove $dungeon do2.tests.amountOfRavagers 2

# Humans count from 1, computers count from 0. Add a fix.
scoreboard players add $dungeon do2.tests.amountOfRavagers 1
Expand All @@ -17,4 +21,4 @@ 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.mc.mobNamesCount < $l1z1 do2.config.mc.levelZoneMobCount run function do2:mob_controller/add_mob_names/add_numbered_ravager_name
execute if score $dungeon do2.utility.mc.mobNamesCount < $l1z1 do2.config.mc.levelZoneMobCount run function do2:mob_controller/add_mob_names/ravager_add_numbered_name
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
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:mob_controller/add_mob_names/add_ravager_name_to_list
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
function do2:mob_controller/save_storages
function do2:mob_controller/get_mob_count/count_mobs
function do2:mob_controller/get_mob_names/get_mob_names
function do2:mob_controller/add_mob_names/ravager_default_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 []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ execute if score $l0z1 do2.config.mc.levelZoneMobCount matches ..0 run scoreboar
# Check for sufficient mob NAMES
execute if score $dungeon do2.utility.mc.mobNamesCount < $l0z1 do2.config.mc.levelZoneMobCount if score $dungeon do2.utility.mc.collectingLogs matches 1 run data modify storage do2:mobs mobNameCountErrors append value 'L0Z1'
execute if score $dungeon do2.utility.mc.mobNamesCount < $l0z1 do2.config.mc.levelZoneMobCount if score $dungeon do2.utility.mc.collectingLogs matches 0 as @a[scores={do2.logs.dungeon_setup=3..}] run tellraw @s ["",{"text":"[§9B§r]: Not enough L0Z1's mob names for L0Z1's mob count. Adding random names to fix."}]
execute if score $dungeon do2.utility.mc.mobNamesCount < $l0z1 do2.config.mc.levelZoneMobCount run function do2:mob_controller/add_mob_names/ravager_names
execute if score $dungeon do2.utility.mc.mobNamesCount < $l0z1 do2.config.mc.levelZoneMobCount run function do2:mob_controller/add_mob_names/ravager_add_name_to_list

# Generate enough mobs.
scoreboard players set $dungeon do2.utility.mc.mobGenerationType 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ execute if score $l1z1 do2.config.mc.levelZoneMobCount matches ..0 run scoreboar
# Check for sufficient mob NAMES
execute if score $dungeon do2.utility.mc.mobNamesCount < $l1z1 do2.config.mc.levelZoneMobCount if score $dungeon do2.utility.mc.collectingLogs matches 1 run data modify storage do2:mobs mobNameCountErrors append value 'L1Z1'
execute if score $dungeon do2.utility.mc.mobNamesCount < $l1z1 do2.config.mc.levelZoneMobCount if score $dungeon do2.utility.mc.collectingLogs matches 0 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.mc.mobNamesCount < $l1z1 do2.config.mc.levelZoneMobCount run function do2:mob_controller/add_mob_names/ravager_names
execute if score $dungeon do2.utility.mc.mobNamesCount < $l1z1 do2.config.mc.levelZoneMobCount run function do2:mob_controller/add_mob_names/ravager_add_name_to_list

# Generate enough mobs.
scoreboard players set $dungeon do2.utility.mc.mobGenerationType 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ execute if score $l1z2 do2.config.mc.levelZoneMobCount matches ..0 run scoreboar
# Check for sufficient mob NAMES
execute if score $dungeon do2.utility.mc.mobNamesCount < $l1z2 do2.config.mc.levelZoneMobCount if score $dungeon do2.utility.mc.collectingLogs matches 1 run data modify storage do2:mobs mobNameCountErrors append value 'L1Z2'
execute if score $dungeon do2.utility.mc.mobNamesCount < $l1z2 do2.config.mc.levelZoneMobCount if score $dungeon do2.utility.mc.collectingLogs matches 0 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.mc.mobNamesCount < $l1z2 do2.config.mc.levelZoneMobCount run function do2:mob_controller/add_mob_names/ravager_names
execute if score $dungeon do2.utility.mc.mobNamesCount < $l1z2 do2.config.mc.levelZoneMobCount run function do2:mob_controller/add_mob_names/ravager_add_name_to_list

# Generate enough mobs.
scoreboard players set $dungeon do2.utility.mc.mobGenerationType 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ execute if score $l1z3 do2.config.mc.levelZoneMobCount matches ..0 run scoreboar
# Check for sufficient mob NAMES
execute if score $dungeon do2.utility.mc.mobNamesCount < $l1z3 do2.config.mc.levelZoneMobCount if score $dungeon do2.utility.mc.collectingLogs matches 1 run data modify storage do2:mobs mobNameCountErrors append value 'L1Z3'
execute if score $dungeon do2.utility.mc.mobNamesCount < $l1z3 do2.config.mc.levelZoneMobCount if score $dungeon do2.utility.mc.collectingLogs matches 0 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.mc.mobNamesCount < $l1z3 do2.config.mc.levelZoneMobCount run function do2:mob_controller/add_mob_names/ravager_names
execute if score $dungeon do2.utility.mc.mobNamesCount < $l1z3 do2.config.mc.levelZoneMobCount run function do2:mob_controller/add_mob_names/ravager_add_name_to_list

# Generate enough mobs.
scoreboard players set $dungeon do2.utility.mc.mobGenerationType 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ execute if score $l1z4 do2.config.mc.levelZoneMobCount matches ..0 run scoreboar
# Check for sufficient mob NAMES
execute if score $dungeon do2.utility.mc.mobNamesCount < $l1z4 do2.config.mc.levelZoneMobCount if score $dungeon do2.utility.mc.collectingLogs matches 1 run data modify storage do2:mobs mobNameCountErrors append value 'L1Z4'
execute if score $dungeon do2.utility.mc.mobNamesCount < $l1z4 do2.config.mc.levelZoneMobCount if score $dungeon do2.utility.mc.collectingLogs matches 0 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.mc.mobNamesCount < $l1z4 do2.config.mc.levelZoneMobCount run function do2:mob_controller/add_mob_names/ravager_names
execute if score $dungeon do2.utility.mc.mobNamesCount < $l1z4 do2.config.mc.levelZoneMobCount run function do2:mob_controller/add_mob_names/ravager_add_name_to_list

# Generate enough mobs.
scoreboard players set $dungeon do2.utility.mc.mobGenerationType 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ execute if score $l1z5 do2.config.mc.levelZoneMobCount matches ..0 run scoreboar
# Check for sufficient mob NAMES
execute if score $dungeon do2.utility.mc.mobNamesCount < $l1z5 do2.config.mc.levelZoneMobCount if score $dungeon do2.utility.mc.collectingLogs matches 1 run data modify storage do2:mobs mobNameCountErrors append value 'L1Z5'
execute if score $dungeon do2.utility.mc.mobNamesCount < $l1z5 do2.config.mc.levelZoneMobCount if score $dungeon do2.utility.mc.collectingLogs matches 0 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.mc.mobNamesCount < $l1z5 do2.config.mc.levelZoneMobCount run function do2:mob_controller/add_mob_names/ravager_names
execute if score $dungeon do2.utility.mc.mobNamesCount < $l1z5 do2.config.mc.levelZoneMobCount run function do2:mob_controller/add_mob_names/ravager_add_name_to_list

# Generate enough mobs.
scoreboard players set $dungeon do2.utility.mc.mobGenerationType 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ execute if score $l2z1 do2.config.mc.levelZoneMobCount matches ..0 run scoreboar
# Check for sufficient mob NAMES
execute if score $dungeon do2.utility.mc.mobNamesCount < $l2z1 do2.config.mc.levelZoneMobCount if score $dungeon do2.utility.mc.collectingLogs matches 1 run data modify storage do2:mobs mobNameCountErrors append value 'L2Z1'
execute if score $dungeon do2.utility.mc.mobNamesCount < $l2z1 do2.config.mc.levelZoneMobCount if score $dungeon do2.utility.mc.collectingLogs matches 0 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.mc.mobNamesCount < $l2z1 do2.config.mc.levelZoneMobCount run function do2:mob_controller/add_mob_names/ravager_names
execute if score $dungeon do2.utility.mc.mobNamesCount < $l2z1 do2.config.mc.levelZoneMobCount run function do2:mob_controller/add_mob_names/ravager_add_name_to_list

# Generate enough mobs.
scoreboard players set $dungeon do2.utility.mc.mobGenerationType 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ execute if score $l2z2 do2.config.mc.levelZoneMobCount matches ..0 run scoreboar
# Check for sufficient mob NAMES
execute if score $dungeon do2.utility.mc.mobNamesCount < $l2z2 do2.config.mc.levelZoneMobCount if score $dungeon do2.utility.mc.collectingLogs matches 1 run data modify storage do2:mobs mobNameCountErrors append value 'L2Z2'
execute if score $dungeon do2.utility.mc.mobNamesCount < $l2z2 do2.config.mc.levelZoneMobCount if score $dungeon do2.utility.mc.collectingLogs matches 0 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.mc.mobNamesCount < $l2z2 do2.config.mc.levelZoneMobCount run function do2:mob_controller/add_mob_names/ravager_names
execute if score $dungeon do2.utility.mc.mobNamesCount < $l2z2 do2.config.mc.levelZoneMobCount run function do2:mob_controller/add_mob_names/ravager_add_name_to_list

# Generate enough mobs.
scoreboard players set $dungeon do2.utility.mc.mobGenerationType 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ execute if score $l2z3 do2.config.mc.levelZoneMobCount matches ..0 run scoreboar
# Check for sufficient mob NAMES
execute if score $dungeon do2.utility.mc.mobNamesCount < $l2z3 do2.config.mc.levelZoneMobCount if score $dungeon do2.utility.mc.collectingLogs matches 1 run data modify storage do2:mobs mobNameCountErrors append value 'L2Z3'
execute if score $dungeon do2.utility.mc.mobNamesCount < $l2z3 do2.config.mc.levelZoneMobCount if score $dungeon do2.utility.mc.collectingLogs matches 0 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.mc.mobNamesCount < $l2z3 do2.config.mc.levelZoneMobCount run function do2:mob_controller/add_mob_names/ravager_names
execute if score $dungeon do2.utility.mc.mobNamesCount < $l2z3 do2.config.mc.levelZoneMobCount run function do2:mob_controller/add_mob_names/ravager_add_name_to_list

# Generate enough mobs.
scoreboard players set $dungeon do2.utility.mc.mobGenerationType 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ execute if score $l2z4 do2.config.mc.levelZoneMobCount matches ..0 run scoreboar
# Check for sufficient mob NAMES
execute if score $dungeon do2.utility.mc.mobNamesCount < $l2z4 do2.config.mc.levelZoneMobCount if score $dungeon do2.utility.mc.collectingLogs matches 1 run data modify storage do2:mobs mobNameCountErrors append value 'L2Z4'
execute if score $dungeon do2.utility.mc.mobNamesCount < $l2z4 do2.config.mc.levelZoneMobCount if score $dungeon do2.utility.mc.collectingLogs matches 0 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.mc.mobNamesCount < $l2z4 do2.config.mc.levelZoneMobCount run function do2:mob_controller/add_mob_names/ravager_names
execute if score $dungeon do2.utility.mc.mobNamesCount < $l2z4 do2.config.mc.levelZoneMobCount run function do2:mob_controller/add_mob_names/ravager_add_name_to_list

# Generate enough mobs.
scoreboard players set $dungeon do2.utility.mc.mobGenerationType 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ execute if score $l2z5 do2.config.mc.levelZoneMobCount matches ..0 run scoreboar
# Check for sufficient mob NAMES
execute if score $dungeon do2.utility.mc.mobNamesCount < $l2z5 do2.config.mc.levelZoneMobCount if score $dungeon do2.utility.mc.collectingLogs matches 1 run data modify storage do2:mobs mobNameCountErrors append value 'L2Z5'
execute if score $dungeon do2.utility.mc.mobNamesCount < $l2z5 do2.config.mc.levelZoneMobCount if score $dungeon do2.utility.mc.collectingLogs matches 0 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.mc.mobNamesCount < $l2z5 do2.config.mc.levelZoneMobCount run function do2:mob_controller/add_mob_names/ravager_names
execute if score $dungeon do2.utility.mc.mobNamesCount < $l2z5 do2.config.mc.levelZoneMobCount run function do2:mob_controller/add_mob_names/ravager_add_name_to_list

# Generate enough mobs.
scoreboard players set $dungeon do2.utility.mc.mobGenerationType 1
Expand Down

0 comments on commit 33caefe

Please sign in to comment.