-
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make Magicol moon phase and seed dependent
- Loading branch information
Showing
16 changed files
with
111 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 0 additions & 9 deletions
9
...auldrons/data/gm4_zauber_cauldrons/functions/cauldron/extra_items/crack_bottle.mcfunction
This file was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
.../gm4_zauber_cauldrons/functions/cauldron/extra_items/process_bottled_vex_items.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# @s = none | ||
# at world spawn | ||
# scheduled every 48t | ||
|
||
# get current moon phase | ||
execute store result score $current gm4_zc_moon_phase run time query day | ||
scoreboard players operation $current gm4_zc_moon_phase %= #8 gm4_zc_moon_phase | ||
|
||
# release vexes from bottled vexes | ||
execute as @e[type=item,nbt={Item:{tag:{gm4_zauber_cauldrons:{item:"bottled_vex"}}}}] at @s run function gm4_zauber_cauldrons:cauldron/extra_items/release_from_bottle/crack_bottle | ||
|
||
# reschedule | ||
schedule function gm4_zauber_cauldrons:cauldron/extra_items/process_bottled_vex_items 48t |
13 changes: 0 additions & 13 deletions
13
...s/data/gm4_zauber_cauldrons/functions/cauldron/extra_items/release_from_bottle.mcfunction
This file was deleted.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
...uber_cauldrons/functions/cauldron/extra_items/release_from_bottle/crack_bottle.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# @s = bottled vex item | ||
# run from cauldron/extra_items/process_bottled_vex_items | ||
# at @s | ||
|
||
# initialize newly thrown bottles | ||
execute unless score @s gm4_zc_bottled_vex_escape_timer matches 0.. run scoreboard players set @s gm4_zc_bottled_vex_escape_timer 3 | ||
|
||
# decrease timer | ||
execute if score @s gm4_zc_bottled_vex_escape_timer matches 0.. run scoreboard players remove @s gm4_zc_bottled_vex_escape_timer 1 | ||
execute if score @s gm4_zc_bottled_vex_escape_timer matches 0.. run particle minecraft:block glass ~ ~ ~ 0.1 0.1 0.1 0 1 | ||
|
||
# play sound | ||
execute if score @s gm4_zc_bottled_vex_escape_timer matches 0.. run playsound minecraft:block.glass.break block @a[distance=..8] ~ ~ ~ 0.1 1.9 | ||
|
||
# break free | ||
execute if score @s gm4_zc_bottled_vex_escape_timer matches 1 run function gm4_zauber_cauldrons:cauldron/extra_items/release_from_bottle/prepare_release | ||
execute if score @s gm4_zc_bottled_vex_escape_timer matches ..0 run function gm4_zauber_cauldrons:cauldron/extra_items/release_from_bottle/release |
11 changes: 11 additions & 0 deletions
11
...r_cauldrons/functions/cauldron/extra_items/release_from_bottle/prepare_release.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# @s = bottled vex item | ||
# run from cauldron/extra_items/release_from_bottle/crack_bottle | ||
# at @s | ||
|
||
# load data from item | ||
data modify storage gm4_zauber_cauldrons:temp/cauldron/extra_items bottled_vex set from entity @s Item.tag.gm4_zauber_cauldrons | ||
execute store result score @s gm4_zc_moon_phase run data get storage gm4_zauber_cauldrons:temp/cauldron/extra_items bottled_vex.preferred_moon_phase | ||
execute store result score @s gm4_zc_fullness run data get storage gm4_zauber_cauldrons:temp/cauldron/extra_items bottled_vex.vex_count | ||
|
||
# unless it is the vex's preferred moon phase, start release one tick early | ||
execute unless score @s gm4_zc_moon_phase = $current gm4_zc_moon_phase run function gm4_zauber_cauldrons:cauldron/extra_items/release_from_bottle/release |
9 changes: 9 additions & 0 deletions
9
...m4_zauber_cauldrons/functions/cauldron/extra_items/release_from_bottle/release.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# @s = bottled vex item | ||
# run from cauldron/extra_items/release_from_bottle/prepare_release | ||
# at @s | ||
|
||
# release vex and kill bottled vex item | ||
function gm4_zauber_cauldrons:cauldron/extra_items/create_possessed_items | ||
playsound minecraft:block.glass.break block @a[distance=..8] ~ ~ ~ 1 1.3 | ||
particle minecraft:block glass ~ ~ ~ 0.12 0.12 0.12 0 16 | ||
kill @s |
7 changes: 7 additions & 0 deletions
7
...ns/data/gm4_zauber_cauldrons/functions/cauldron/liquid/magicol/check_liquid_id.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# confirms the liquid id to be 'magicol' before displaying particles | ||
# @s = zauber cauldron with valid structure | ||
# at @s align xyz | ||
# run via function tag #gm4_zauber_cauldrons:cauldron/liquid/cauldron_particles from cauldron/structure/valid | ||
|
||
# check liquid id unless another expansion already displayed a particle | ||
execute unless score $displayed_liquid_particle gm4_zc_data matches 1.. if data storage gm4_zauber_cauldrons:temp/cauldron/ingredients liquid{id:"magicol"} run function gm4_zauber_cauldrons:cauldron/liquid/magicol/particles |
15 changes: 11 additions & 4 deletions
15
...auldrons/data/gm4_zauber_cauldrons/functions/cauldron/liquid/magicol/particles.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,20 @@ | ||
# particles displayed over a cauldron when it is filled with magicol | ||
# @s = zauber cauldron with valid structure | ||
# at @s align xyz | ||
# run via function tag #gm4_zauber_cauldrons:cauldron/liquid/cauldron_particles from cauldron/structure/valid | ||
# run from gm4_zauber_cauldrons:cauldron/liquid/magicol/check_liquid_id | ||
|
||
# if liquid id is magicol, display particles | ||
# display enchant particles for players with full zauber armor during the correct moon phase | ||
execute store result score $preferred gm4_zc_moon_phase run data get storage gm4_zauber_cauldrons:temp/cauldron/ingredients liquid.magicol.moon_phase | ||
execute if score $preferred gm4_zc_moon_phase = $current gm4_zc_moon_phase run particle enchant ~.5 ~.75 ~.5 0.1 0.1 0.1 0.4 6 normal @a[distance=..8,advancements={gm4_zauber_cauldrons:equipment/has_full_armor=true}] | ||
scoreboard players reset $preferred gm4_zc_moon_phase | ||
|
||
# if liquid id is magicol, display particles | ||
# generated with the help of bolt | ||
for color_data in ctx.meta['magicol_colors']: | ||
execute unless score $displayed_particle gm4_zc_data matches 1.. store success score $displayed_particle gm4_zc_data if data storage gm4_zauber_cauldrons:temp/cauldron/ingredients liquid{id:"magicol",magicol:{color:color_data['color']}} run summon area_effect_cloud ~.5 ~.75 ~.5 {Particle:"entity_effect",Radius:0.1f,Duration:10,Color:int(color_data['particle_color'])} | ||
execute unless score $displayed_magicol_particle gm4_zc_data matches 1.. store success score $displayed_magicol_particle gm4_zc_data if data storage gm4_zauber_cauldrons:temp/cauldron/ingredients liquid{id:"magicol",magicol:{color:color_data['color']}} run summon area_effect_cloud ~.5 ~.75 ~.5 {Particle:"entity_effect",Radius:0.1f,Duration:10,Color:int(color_data['particle_color'])} | ||
|
||
# set flag | ||
scoreboard players set $displayed_liquid_particle gm4_zc_data 1 | ||
|
||
# reset fake player | ||
scoreboard players reset $displayed_particle gm4_zc_data | ||
scoreboard players reset $displayed_magicol_particle gm4_zc_data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
...data/gm4_zauber_cauldrons/functions/recipes/magicol/initiate_moon_phase_offset.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# no @s. | ||
# at world spawn | ||
# called by init | ||
|
||
# generates a random moon_phase_offset based on the world seed on module installation | ||
random reset gm4_zauber_cauldrons:bottled_vex/moon_phase_offset 0 true true | ||
execute store result score $magicol_offset gm4_zc_data run random value 0..7 gm4_zauber_cauldrons:bottled_vex/moon_phase_offset |
2 changes: 1 addition & 1 deletion
2
...auldrons/data/gm4_zauber_cauldrons/tags/functions/cauldron/liquid/cauldron_particles.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"values": [ | ||
"gm4_zauber_cauldrons:cauldron/liquid/magicol/particles" | ||
"gm4_zauber_cauldrons:cauldron/liquid/magicol/check_liquid_id" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters