diff --git a/.gitignore b/.gitignore index e87390c..2cd4f4c 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,8 @@ _*.json /.vscode /Install-Packs.ps1 +Deploy.ps1 +*.zip # Work in Progress /Decked Out 2 Catacombs diff --git a/Decked Out 2 Audio Resource Pack/Copy-Sounds.py b/Decked Out 2 Audio Resource Pack/Copy-Sounds.py index 96c1ca5..819fe9d 100644 --- a/Decked Out 2 Audio Resource Pack/Copy-Sounds.py +++ b/Decked Out 2 Audio Resource Pack/Copy-Sounds.py @@ -156,13 +156,13 @@ "events.recycle.6": "1473a3ea-45ec-47ca-b8c4-f93254467be4", # DO_Card_Recycle_6 BY Del Chupenebray/Joel Bickford "events.recycle.7": "40356557-dcc1-4ef5-a830-089493d7fbab", # DO_Card_Recycle_7 BY Del Chupenebray/Joel Bickford "events.recycle.8": "773c56cd-e551-4a11-a050-f17310678f86", # DO_Card_Recycle_8 BY Del Chupenebray/Joel Bickford - "holloween.enterance.1": "cda7ec93-5454-4f64-a6c6-5b431a29b63f", # DO_Holloween_EntranceTune_1 BY Del Chupenebray/Joel Bickford - "holloween.enterance.2": "602f6a24-2e3b-4e13-a211-c814f452c390", # DO_Holloween_EntranceTune_2 BY Del Chupenebray/Joel Bickford - "holloween.enterance.3": "5bf4c518-2e69-47d4-9559-5756cc5e2343", # DO_Holloween_EntranceTune_3 BY Del Chupenebray/Joel Bickford - "holloween.failure.1": "32e5657f-9d7b-494e-b38d-aaca1f522d2a", # DO_Holloween_Failure_1 BY Del Chupenebray/Joel Bickford - "holloween.failure.2": "edd55cdd-45a7-41ce-bbfd-ec3f9c59c02a", # DO_Holloween_Failure_2 BY Del Chupenebray/Joel Bickford - "holloween.failure.3": "f204d832-bdd9-489e-a6aa-b8c11128949b", # DO_Holloween_Failure_3 BY Del Chupenebray/Joel Bickford - "holloween.success": "3477400c-a6c4-4be1-9248-8c54533f2a42", # DO_Holloween_Success_1 BY Del Chupenebray/Joel Bickford + "halloween.enterance.1": "cda7ec93-5454-4f64-a6c6-5b431a29b63f", # DO_Holloween_EntranceTune_1 BY Del Chupenebray/Joel Bickford + "halloween.enterance.2": "602f6a24-2e3b-4e13-a211-c814f452c390", # DO_Holloween_EntranceTune_2 BY Del Chupenebray/Joel Bickford + "halloween.enterance.3": "5bf4c518-2e69-47d4-9559-5756cc5e2343", # DO_Holloween_EntranceTune_3 BY Del Chupenebray/Joel Bickford + "halloween.failure.1": "32e5657f-9d7b-494e-b38d-aaca1f522d2a", # DO_Holloween_Failure_1 BY Del Chupenebray/Joel Bickford + "halloween.failure.2": "edd55cdd-45a7-41ce-bbfd-ec3f9c59c02a", # DO_Holloween_Failure_2 BY Del Chupenebray/Joel Bickford + "halloween.failure.3": "f204d832-bdd9-489e-a6aa-b8c11128949b", # DO_Holloween_Failure_3 BY Del Chupenebray/Joel Bickford + "halloween.success": "3477400c-a6c4-4be1-9248-8c54533f2a42", # DO_Holloween_Success_1 BY Del Chupenebray/Joel Bickford "interactions.crown_conversion.1": "002ca7c8-4c26-47f2-9323-a50889979936", # DO_Currency_CrownConversion_Se BY Del Chupenebray/Joel Bickford "interactions.crown_conversion.2": "093c7b0e-f806-4ce9-9760-d1e9f4e700c0", # DO_Currency_CrownConversion_Se BY Del Chupenebray/Joel Bickford "interactions.crown_conversion.3": "0f4d4df2-9e0f-446e-940b-cc3c1b712255", # DO_Currency_CrownConversion_Se BY Del Chupenebray/Joel Bickford @@ -341,10 +341,10 @@ "events.hazard_blocked": ..., "events.hazard": ..., "events.recycle": ..., - "holloween.enterance": ..., - "holloween.failure": ..., + "halloween.enterance": ..., + "halloween.failure": ..., "interactions.crown_conversion": ..., - "interactions.frost_purchase": ..., + "interactions.purchase": ..., "ambient.warden_roar_with_cleo": ["ambient.warden_roar"]* 7 + ["ambient.hi_cleo"] } diff --git a/Decked Out 2 Core Datapack/Python/do2/functions/carpet_map_player.py b/Decked Out 2 Core Datapack/Python/do2/functions/carpet_map_player.py new file mode 100644 index 0000000..b8fd98a --- /dev/null +++ b/Decked Out 2 Core Datapack/Python/do2/functions/carpet_map_player.py @@ -0,0 +1,25 @@ +from mcfunction import mcfunction + + +@mcfunction(tags=["minecraft:load"]) +def check_status(): + yield f""" + execute unless entity @e[name=TangoCam] + if entity @p[name=!TangoCam] + run function {summon_tangocam} + """ + + yield """ + execute if entity @e[name=TangoCam] + unless entity @a[name=!TangoCam] + run kill TangoCam + """ + + yield f"schedule function {check_status} 30s replace" + + +@mcfunction +def summon_tangocam(): + yield "player TangoCam spawn at -484.52 59.00 1738.19 facing 0 0" + yield "execute as @p[name=TangoCam] run gamemode spectator" + diff --git a/Decked Out 2 Core Datapack/Python/do2/functions/fix_card_counter.py b/Decked Out 2 Core Datapack/Python/do2/functions/fix_card_counter.py new file mode 100644 index 0000000..8f5aa7e --- /dev/null +++ b/Decked Out 2 Core Datapack/Python/do2/functions/fix_card_counter.py @@ -0,0 +1,60 @@ +from mcfunction import mcfunction + +COUNT_IN_ROW = 20 + +BLOCK_X = -517 +BLOCK_X_STEP = 3 +BLOCK_Y = 61 +BLOCK_Z = [1845, 1850] + +X_OFFSET = [0, 1] +ROW_Y = [55, 57] +Z_OFFSET = [0, 2] + + +SPECIAL_Z_OFFSET = { + (1, 0): 2, + (1, 1): 1, +} + +REDSTONE = 'minecraft:redstone_wire' +RAIL = 'minecraft:powered_rail[shape=north_south]' + +ITEM = { + (1, 9): REDSTONE, + (1, 10): REDSTONE, + (1, 11): REDSTONE, +} + + +@mcfunction(tags=["do2:fix_dungeon"]) +def _(): + for row in range(2): + for column in range(COUNT_IN_ROW): + x1 = BLOCK_X + column * BLOCK_X_STEP + y1 = BLOCK_Y + z1 = BLOCK_Z[row] + + x2 = x1 + X_OFFSET[row] + y2 = ROW_Y[row] + z2 = z1 + Z_OFFSET[row] + SPECIAL_Z_OFFSET.get((row, column), 0) + + x3 = x1 + 1 + y3 = y1 - 1 + z3 = z1 - 2 + + item = ITEM.get((row, column), RAIL) + + display_block = { + False: "minecraft:mushroom_stem", + # False: "minecraft:light_gray_wool", + True: "minecraft:white_wool", + }[column % 10 < 5] + + yield f"fill {x1} {y1} {z1} {x3} {y3} {z3} {display_block} replace #minecraft:wool" + yield f"fill {x1} {y1} {z1} {x3} {y3} {z3} {display_block} replace minecraft:mushroom_stem" + + # prefix = f"execute run" + prefix = f"execute unless block {x1} {y1} {z1} minecraft:water run" + yield f"{prefix} setblock {x2} {y2} {z2} minecraft:air" + yield f"{prefix} setblock {x2} {y2} {z2} {item}" diff --git a/Decked Out 2 Core Datapack/Python/do2/functions/fix_cove_dripstone.py b/Decked Out 2 Core Datapack/Python/do2/functions/fix_cove_dripstone.py new file mode 100644 index 0000000..e754f71 --- /dev/null +++ b/Decked Out 2 Core Datapack/Python/do2/functions/fix_cove_dripstone.py @@ -0,0 +1,78 @@ +from mcfunction import mcfunction + + +DRIPSTONE = [ + (-554, 1961, (14, 15), (16, 17)), + (-554, 1963, ..., (16, 17)), + (-553, 1960, (14, 16), (17, 20)), + (-553, 1962, ..., (17, 18)), + (-552, 1959, (14, 15), ...), + (-552, 1959, ..., (16, 17)), + (-552, 1961, (14, 20), (21, 22)), + (-552, 1962, ..., (16, 18)), + (-552, 1963, (14, 16), (17, 18)), + (-552, 1964, (14, 15), (16, 17)), + (-549, 1961, (15, 17), (18, 21)), +] + + +def _fill(x, z, ys, direction, merge): + if ys is Ellipsis: + return + + y1, y2, dy = { + "down": (min(ys), max(ys), 1), + "up": (max(ys), min(ys), -1), + }[direction] + + size = abs(y1 - y2) + 1 + tip = "tip_merge" if merge else "tip" + + def dripstone(thickness): + return f"""minecraft:pointed_dripstone[vertical_direction={direction},thickness={thickness}]""" + + if size >= 3: + yield f"""setblock {x} {y2} {z} {dripstone("base")}""" + + if size > 4: + yield f"""fill {x} {y1+2*dy} {z} {x} {y2-dy} {z} {dripstone("middle")}""" + + if size == 4: + yield f"""setblock {x} {y1+2*dy} {z} {dripstone("middle")}""" + + if size >= 2: + yield f"""setblock {x} {y1+dy} {z} {dripstone("frustum")}""" + + if size >= 1: + yield f"""setblock {x} {y1} {z} {dripstone(tip)}""" + + + +@mcfunction(tags=["do2:fix_dungeon"]) +def _(): + ifs = [] + + for x, z, up, down in DRIPSTONE: + if up is not Ellipsis: + ifs.append(f"if block {x} {up[1]} {z} minecraft:pointed_dripstone") + + if down is not Ellipsis: + ifs.append(f"if block {x} {down[0]} {z} minecraft:pointed_dripstone") + + ifs = " ".join(ifs) + + yield "# If tips are not broken, all other blocks must be there." + + yield f"execute {ifs} run return 0" + + yield "# Don't fix while player is close by. It looks weird, and can be really unfun to get blocked by it." + + yield """ + execute positioned -552 15 1961 + if entity @p[distance=..16] + run return 0 + """ + + for x, z, up, down in DRIPSTONE: + yield from _fill(x, z, up, 'up', down is not None) + yield from _fill(x, z, down, 'down', up is not None) \ No newline at end of file diff --git a/Decked Out 2 Core Datapack/Python/do2/functions/fix_main_door_armor_stands.py b/Decked Out 2 Core Datapack/Python/do2/functions/fix_main_door_armor_stands.py new file mode 100644 index 0000000..74285e4 --- /dev/null +++ b/Decked Out 2 Core Datapack/Python/do2/functions/fix_main_door_armor_stands.py @@ -0,0 +1,36 @@ +from mcfunction import mcfunction + + +@mcfunction(tags=["do2:fix_dungeon"]) +def _(): + yield "setblock -544 112 1981 minecraft:gray_shulker_box[facing=down]" + + yield """data merge entity 071af318-9860-4d54-b61a-1f1851265429 { + Invulnerable: false, + NoGravity: true, + Invisible: true, + DisabledSlots: 4194303, + Rotation: [-90.0f, 0.0f], + HandItems: [{}, {}], + Pos: [-544.5d, 113.0d, 1980.5d], + ArmorItems: [{}, {}, {}, { + id: "minecraft:carved_pumpkin", + Count: 1b, + tag: {CustomModelData: 87, CustomRoleplayData: 1b} + }], + }""" + + yield """data merge entity e989ba0e-56e3-46b0-92e3-65302adf4226 { + Invulnerable: false, + NoGravity: true, + Invisible: true, + DisabledSlots: 4194303, + Rotation: [-90.0f, 0.0f], + HandItems: [{}, {}], + Pos: [-543.5d, 113.0d, 1980.5d], + ArmorItems: [{}, {}, {}, { + id: "minecraft:carved_pumpkin", + Count: 1b, + tag: {CustomModelData: 88, CustomRoleplayData: 1b} + }], + }""" \ No newline at end of file diff --git a/Decked Out 2 Core Datapack/Python/do2/functions/fix_redstone.py b/Decked Out 2 Core Datapack/Python/do2/functions/fix_redstone.py new file mode 100644 index 0000000..f99c6ba --- /dev/null +++ b/Decked Out 2 Core Datapack/Python/do2/functions/fix_redstone.py @@ -0,0 +1,34 @@ +from mcfunction import mcfunction + + +@mcfunction(tags=["do2:fix_dungeon"]) +def fix_artifact_10(): + """Fix artifact #10 not connected to clank.""" + yield "fill -546 35 1995 -546 35 1993 minecraft:cyan_wool" + yield "fill -546 35 1993 -550 35 1993 minecraft:cyan_wool" + yield "fill -550 35 1993 -550 35 1985 minecraft:cyan_wool" + + yield "fill -546 36 1995 -546 36 1993 minecraft:redstone_wire" + yield "fill -546 36 1993 -550 36 1993 minecraft:redstone_wire" + yield "fill -550 36 1993 -550 36 1985 minecraft:redstone_wire" + + yield "setblock -546 36 1994 minecraft:repeater[facing=south]" + + +@mcfunction(tags=["do2:fix_dungeon"]) +def fix_toots(): + # https://www.reddit.com/r/HermitCraft/comments/18t3bz8 + yield """ + execute if block -558 63 1960 minecraft:clay + run setblock -558 63 1960 minecraft:stone + """ + + + + +@mcfunction(tags=["do2:fix_dungeon"]) +def fix_crown_converter_delay(): + yield """ + execute if block -644 -15 1984 minecraft:repeater[facing=south,delay=1] + run setblock -644 -15 1984 minecraft:repeater[facing=south,delay=3] + """ \ No newline at end of file diff --git a/Decked Out 2 Core Datapack/Python/do2/functions/limit_level04_tnt.py b/Decked Out 2 Core Datapack/Python/do2/functions/limit_level04_tnt.py new file mode 100644 index 0000000..e088129 --- /dev/null +++ b/Decked Out 2 Core Datapack/Python/do2/functions/limit_level04_tnt.py @@ -0,0 +1,9 @@ +from mcfunction import mcfunction + + +@mcfunction(tags=["do2:fix_dungeon"]) +def _(): + yield """ + data modify block -640 17 1904 Items + set value [{Slot: 4b, id: "minecraft:tnt", Count: 1b}] + """ diff --git a/Decked Out 2 Core Datapack/Python/do2/functions/modify_item_models.py b/Decked Out 2 Core Datapack/Python/do2/functions/modify_item_models.py new file mode 100644 index 0000000..23fd177 --- /dev/null +++ b/Decked Out 2 Core Datapack/Python/do2/functions/modify_item_models.py @@ -0,0 +1,25 @@ +from mcfunction import mcfunction + + +def _modify_compass(dropper_idx, model, slots=["{}"]): + for slot in slots: + yield f"""data modify block -549 106 {1979-dropper_idx} Items[{slot}].tag.CustomModelData set value {model}""" + + +@mcfunction(tags=["do2:fix_dungeon"]) +def _(): + # Modify Compasses + yield from _modify_compass(0, 1) + yield from _modify_compass(1, 1) + yield from _modify_compass(2, 1) + yield from _modify_compass(3, 2) + yield from _modify_compass(4, 2) + yield from _modify_compass(5, 2) + yield from _modify_compass(5, 3, [6, 7]) + yield from _modify_compass(6, 3) + yield from _modify_compass(7, 3) + yield from _modify_compass(7, 4, [6, 7]) + yield from _modify_compass(8, 4) + yield from _modify_compass(9, 4) + + # yield "data modify block -625 59 1945 Items[{}].tag.CustomModelData set value 201" diff --git a/Decked Out 2 Core Datapack/Python/do2/functions/play_sound.py b/Decked Out 2 Core Datapack/Python/do2/functions/play_sound.py new file mode 100644 index 0000000..a35fcc9 --- /dev/null +++ b/Decked Out 2 Core Datapack/Python/do2/functions/play_sound.py @@ -0,0 +1,35 @@ +from mcfunction import mcfunction +import data + + +def _create(desc): + function_name = f"""do2:play_sound/{desc["id"]}""" + name = desc["sound"] + condition = "" + at = desc["at"] + distance = desc.get("range", 16) + + @mcfunction(function_name=function_name) + def _(): + command = [ + "execute", + condition, + f"positioned {at}", + f"as @a[tag=do2.cmd_sound,distance=..{distance}]", + "at @s", + f"run playsound do2:{name} master @s", + # at, + ] + + if at is not None: + command.append(at) + + command = " ".join(part for part in command if part) + yield command + + +systems = data.SOUNDS + +for desc in systems: + if "delay" in desc: + _create(desc) \ No newline at end of file diff --git a/Decked Out 2 Core Datapack/Python/do2/functions/regrow_berry_bushes.py b/Decked Out 2 Core Datapack/Python/do2/functions/regrow_berry_bushes.py new file mode 100644 index 0000000..8c08ace --- /dev/null +++ b/Decked Out 2 Core Datapack/Python/do2/functions/regrow_berry_bushes.py @@ -0,0 +1,19 @@ +from mcfunction import mcfunction + + +BUSH = "minecraft:sweet_berry_bush" +AIR = "minecraft:air" +GROWN = "age=3" + + +@mcfunction(tags=["do2:fix_dungeon"]) +def _(): + import data + for item in data.SWEET_BERRY_BUSHES: + x, y, z = item["pos"] + pos = f"{x} {y} {z}" + + yield f"# {item['description']}" + yield f"fill {pos} {pos} {BUSH}[{GROWN}] replace {AIR}" + yield f"fill {pos} {pos} {BUSH}[{GROWN}] replace {BUSH}" + yield "" diff --git a/Decked Out 2 Core Datapack/Python/do2/functions/replace_audio_systems.py b/Decked Out 2 Core Datapack/Python/do2/functions/replace_audio_systems.py index fdf130c..e5623e8 100644 --- a/Decked Out 2 Core Datapack/Python/do2/functions/replace_audio_systems.py +++ b/Decked Out 2 Core Datapack/Python/do2/functions/replace_audio_systems.py @@ -1,10 +1,22 @@ from mcfunction import mcfunction +import data AIR = "minecraft:air" FILLER = "minecraft:diamond_block" -REMOVE_OLD_SYSTEM = True +REMOVE_OLD_SYSTEM = False + + +def delay_sound(function_name, delay, *, facing="south"): + command_block = f"minecraft:command_block[facing={facing},conditional=false]" + + if delay > 0: + command = f"schedule function {function_name} {delay}t append" + else: + command = f"function {function_name}" + + return f"""{command_block}{{Command: "{command}"}}""" def sound(name, distance, *, facing="south", condition="", at=None): @@ -12,7 +24,7 @@ def sound(name, distance, *, facing="south", condition="", at=None): command = [ "execute", condition, - f"as @a[distance=..{distance}]", + f"as @a[tag=do2.cmd_sound,distance=..{distance}]", "at @s", f"run playsound {name} master @s", ] @@ -87,6 +99,7 @@ def replace_card_reveal_left(): yield f"fill {x} {y+1} {z+1} {x-2} {y+2} {z+2} {AIR}" yield f"setblock {x} {y+2} {z} {AIR}" + @mcfunction(tags=["do2:replace_audio_systems"]) def replace_card_reveal_right(): x, y, z = -648, -24, 2002 @@ -111,6 +124,17 @@ def replace_cave_gust(): yield f"setblock {x} {y+1} {z} {AIR}" +@mcfunction(tags=["do2:replace_audio_systems"]) +def replace_crown_shop_purchase(): + x, y, z = -502, 105, 1978 + block = sound(f"do2:interactions.purchase", 50) + + yield f"setblock {x} {y} {z} {block}" + + if REMOVE_OLD_SYSTEM: + yield f"fill {x-2} {y-1} {z+1} {x} {y+1} {z+3} {AIR}" + + @mcfunction(tags=["do2:replace_audio_systems"]) def replace_difficulty(): x0, y, z = -557, 117, 1986 @@ -155,17 +179,16 @@ def replace_drone_deepfrost(): yield f"fill {x+2} {y} {z} {x+4} {y} {z+2} {AIR}" -@mcfunction(tags=["do2:replace_audio_systems"]) -def replace_dungeon_door_open(): - x, y, z = -621, 44, 1953 - block = sound(f"do2:interactions.dungeon_door_open", 20) - - yield f"fill {x} {y} {z+1} {x} {y} {z+3} minecraft:repeater[delay=4,facing=north]" - yield f"setblock {x} {y} {z+4} {block}" +# @mcfunction(tags=["do2:replace_audio_systems"]) +# def replace_dungeon_door_open(): +# x, y, z = -621, 44, 1953 +# block = sound(f"do2:interactions.dungeon_door_open", 20) - if REMOVE_OLD_SYSTEM: - yield f"fill {x-2} {y} {z} {x-2} {y-1} {z-2} {AIR}" +# yield f"fill {x} {y} {z+1} {x} {y} {z+3} minecraft:repeater[delay=4,facing=north]" +# yield f"setblock {x} {y} {z+4} {block}" +# if REMOVE_OLD_SYSTEM: +# yield f"fill {x-2} {y} {z} {x-2} {y-1} {z-2} {AIR}" @mcfunction(tags=["do2:replace_audio_systems"]) @@ -178,6 +201,7 @@ def replace_dungeon_is_ready(): if REMOVE_OLD_SYSTEM: yield f"fill {x+1} {y} {z-1} {x+5} {y+3} {z-1} {AIR}" + @mcfunction(tags=["do2:replace_audio_systems"]) def replace_dungeon_taunt(): x, y, z = -644, -19, 1988 @@ -199,6 +223,7 @@ def replace_ember_shop_open(): if REMOVE_OLD_SYSTEM: yield f"fill {x+1} {y-1} {z-2} {x+1} {y+1} {z} {AIR}" + @mcfunction(tags=["do2:replace_audio_systems"]) def replace_ember_shop_opening(): x, y, z = -643, -22, 1981 @@ -210,6 +235,17 @@ def replace_ember_shop_opening(): yield f"setblock -644 -21 1980 minecraft:barrel" +@mcfunction(tags=["do2:replace_audio_systems"]) +def replace_ember_shop_purchase(): + x, y, z = -637, -22, 2001 + block = sound(f"do2:interactions.purchase", 50) + + yield f"setblock {x} {y} {z} {block}" + + if REMOVE_OLD_SYSTEM: + yield f"fill {x+1} {y} {z+1} {x+1} {y+2} {z+3} {AIR}" + yield f"setblock {x+1} {y+1} {z-1} {AIR}" + @mcfunction(tags=["do2:replace_audio_systems"]) def replace_event_sounds(): @@ -242,32 +278,21 @@ def replace_install_deck(): x, y, z = -569, 114, 1979 block = sound(f"do2:interactions.install_deck", 20) - yield f"setblock {x} {y} {z} {block}" + yield f"setblock {x} {y-1} {z-1} {block}" if REMOVE_OLD_SYSTEM: yield f"fill {x-1} {y-1} {z+1} {x} {y+1} {z+4} {AIR}" -@mcfunction(tags=["do2:replace_audio_systems"]) -def replace_open_level04(): - x, y, z = -637, -20, 1894 - block = sound(f"do2:events.deepfrost_tnt", 64) - - yield f"setblock {x} {y} {z} {block}" - - if REMOVE_OLD_SYSTEM: - yield f"fill {x+1} {y-1} {z} {x+3} {y+1} {z} {AIR}" - - -@mcfunction(tags=["do2:replace_audio_systems"]) -def replace_open_main_door(): - x, y, z = -539, 109, 1977 - block = sound(f"do2:interactions.open_main_door", 32, at="-543 114 1980") +# @mcfunction(tags=["do2:replace_audio_systems"]) +# def replace_open_level04(): +# x, y, z = -637, -20, 1894 +# block = sound(f"do2:events.deepfrost_tnt", 64) - yield f"setblock {x} {y} {z} {block}" +# yield f"setblock {x} {y} {z} {block}" - if REMOVE_OLD_SYSTEM: - yield f"fill {x} {y} {z+1} {x} {y+1} {z+2} {AIR}" +# if REMOVE_OLD_SYSTEM: +# yield f"fill {x+1} {y-1} {z} {x+3} {y+1} {z} {AIR}" @mcfunction(tags=["do2:replace_audio_systems"]) @@ -311,6 +336,7 @@ def replace_warden_emerge(): yield f"fill {x-4} {y} {z} {x-2} {y+2} {z} {AIR}" yield f"setblock {x-2} {y} {z} {FILLER}" + @mcfunction(tags=["do2:replace_audio_systems"]) def replace_warden_emerge(): x, y, z = -612, 45, 1945 @@ -322,3 +348,26 @@ def replace_warden_emerge(): if REMOVE_OLD_SYSTEM: yield f"fill {x+2} {y} {z-3} {x+2} {y+2} {z-1} {AIR}" + +@mcfunction(tags=["do2:replace_audio_systems"]) +def replace_simple_systems(): + systems = data.SOUNDS + + for desc in systems: + if "delay" in desc: + block = delay_sound(f"""do2:play_sound/{desc["id"]}""", desc["delay"]) + else: + kwargs = {} + if "at" in desc: + kwargs["at"] = desc["at"] + + block = sound(f"""do2:{desc["sound"]}""", desc["range"]) + + if REMOVE_OLD_SYSTEM: + if "air" in desc: + yield f"""fill {desc["air"]} {AIR}""" + + yield from desc.get("remove", []) + + yield f"""setblock {desc["command_block"]} {AIR}""" + yield f"""setblock {desc["command_block"]} {block}""" diff --git a/Decked Out 2 Core Datapack/Python/do2/functions/teleport_mobs.py b/Decked Out 2 Core Datapack/Python/do2/functions/teleport_mobs.py new file mode 100644 index 0000000..dbbe3e8 --- /dev/null +++ b/Decked Out 2 Core Datapack/Python/do2/functions/teleport_mobs.py @@ -0,0 +1,43 @@ +from collections import defaultdict + +from mcfunction import mcfunction + + +TAG = "do2.tags.teleport_mobs_marker" +KILL_MARKERS = f"kill @e[type=minecraft:marker,tag={TAG}]" + + +@mcfunction(tags=["do2:fix_dungeon"]) +def _(): + import data + + yield KILL_MARKERS + yield "data modify storage do2:debug MobPositions set value {}" + + MOBS_IN_ZONES = defaultdict(list) + + for mobs in [data.ENTITIES.RAVAGERS, data.ENTITIES.WARDENS]: + for mob in mobs: + MOBS_IN_ZONES[mob["zone"]].append(mob) + + for zone_name, zone in data.ZONES.items(): + if zone_name.startswith("_"): + continue + + for x, y, z in zone["markers"]: + yield f"""summon minecraft:marker {x} {y} {z} {{ + Tags: ["{TAG}"] + }}""" + + for mob in MOBS_IN_ZONES[zone_name]: + yield f""" + execute as {mob["id"]} + run tp @s @e[type=minecraft:marker,tag={TAG},sort=random,limit=1] + """ + + yield f""" + data modify storage do2:debug MobPositions."{mob["name"]}" + set from entity {mob["id"]} Pos + """ + + yield KILL_MARKERS diff --git a/Decked Out 2 Core Datapack/Python/main.py b/Decked Out 2 Core Datapack/Python/main.py index 29d64d7..3ff9d44 100644 --- a/Decked Out 2 Core Datapack/Python/main.py +++ b/Decked Out 2 Core Datapack/Python/main.py @@ -1,5 +1,14 @@ -# import do2.functions.deck_shuffler +import do2.functions.carpet_map_player +import do2.functions.fix_card_counter +import do2.functions.fix_cove_dripstone +import do2.functions.fix_main_door_armor_stands +import do2.functions.fix_redstone +import do2.functions.limit_level04_tnt +import do2.functions.modify_item_models +import do2.functions.play_sound +import do2.functions.regrow_berry_bushes import do2.functions.replace_audio_systems +import do2.functions.teleport_mobs import mcfunction diff --git a/Decked Out 2 Core Datapack/Python/mcfunction.py b/Decked Out 2 Core Datapack/Python/mcfunction.py index e20e3a8..6a5bfe1 100644 --- a/Decked Out 2 Core Datapack/Python/mcfunction.py +++ b/Decked Out 2 Core Datapack/Python/mcfunction.py @@ -28,11 +28,12 @@ def _get_tags_path(function_name): return _ROOT / (function_name.replace(":", "/tags/functions/") + ".json") -def mcfunction(call=None, *, tags=None): +def mcfunction(call=None, *, tags=None, function_name=None): if call is None: - return _functools.partial(mcfunction, tags=tags) + return _functools.partial(mcfunction, tags=tags, function_name=function_name) - function_name = _get_function_name(call) + if function_name is None: + function_name = _get_function_name(call) _FUNCTIONS[function_name] = call diff --git a/Decked Out 2 Database/sounds.json b/Decked Out 2 Database/sounds.json new file mode 100644 index 0000000..611958e --- /dev/null +++ b/Decked Out 2 Database/sounds.json @@ -0,0 +1,61 @@ +[ + { + "-comment": "Card Recycle Sound", + "sound": "events.recycle", + "range": 180, + "command_block": "-619 31 1920", + "air": "-618 31 1918 -618 33 1920" + }, + { + "-comment": "Halloween - Success", + "sound": "halloween.success", + "range": 30, + "command_block": "-526 8 2047", + "air": "-524 8 2044 -522 10 2046" + }, + { + "-comment": "Halloween - Fail", + "sound": "halloween.failure", + "range": 30, + "command_block": "-530 9 2048", + "air": "-532 10 2046 -530 10 2047" + }, + { + "-comment": "Halloween - Enterance", + "sound": "halloween.enterance", + "range": 30, + "command_block": "-520 10 2044", + "remove": [ + "fill -521 10 2045 -521 12 2047 minecraft:air", + "fill -521 11 2045 -521 12 2045 minecraft:glass" + ] + }, + { + "id": "open_main_door", + "sound": "interactions.open_main_door", + "at": "-543 114 1980", + "range": 32, + "command_block": "-539 109 1977", + "delay": 14, + "air": "-539 109 1978 -539 110 1979" + }, + { + "id": "level01_door_open", + "sound": "interactions.dungeon_door_open", + "at": "-622 49 1956", + "range": 32, + "command_block": "-621 45 1951", + "delay": 16, + "air": "-623 43 1951 -623 44 1953" + }, + { + "id": "level04_door_open", + "sound": "events.deepfrost_tnt", + "at": "-641 -8 1904", + "range": 64, + "command_block": "-637 -20 1894", + "delay": 16, + "air": "-636 -21 1894 -634 -19 1894" + } +] +