Skip to content

Commit

Permalink
Added new decorative features to The Wicked Night
Browse files Browse the repository at this point in the history
  • Loading branch information
Zungrysoft committed Jun 20, 2021
1 parent 89390e8 commit 2527089
Show file tree
Hide file tree
Showing 13 changed files with 124 additions and 1 deletion.
9 changes: 8 additions & 1 deletion data/tid/advancements/intro/find_loot.json
Expand Up @@ -17,11 +17,18 @@
"conditions": {
"loot_table": "tid:chests/intro"
}
},
"loot_2": {
"trigger": "minecraft:player_generates_container_loot",
"conditions": {
"loot_table": "tid:chests/intro_spine"
}
}
},
"requirements": [
[
"loot_1"
"loot_1",
"loot_2"
]
]
}
Expand Up @@ -20,6 +20,7 @@ scoreboard players set intro_rooms value 50
scoreboard players set intro_large_rooms value 2
scoreboard players set intro_horde_spawned value 0
scoreboard players set intro_horde_monsters value 0
scoreboard players set intro_spine_chests value 0
scoreboard players reset @a mine_diorite

#Summon starting room
Expand Down
3 changes: 3 additions & 0 deletions data/tid/functions/dungeon/intro/terrain/pillar.mcfunction
@@ -1,3 +1,6 @@
#Spine
execute if predicate tid:random_002 positioned ~ ~7 ~ run function tid:misc/intro_spine

#Coarse Dirt
execute if predicate tid:random_50 run fill ~ ~ ~ ~ ~0 ~ coarse_dirt replace water
execute if predicate tid:random_30 if score xcount value matches 1..99 if score zcount value matches 1..99 run fill ~ ~ ~ ~ ~1 ~ coarse_dirt replace water
Expand Down
15 changes: 15 additions & 0 deletions data/tid/functions/misc/intro_spine.mcfunction
@@ -0,0 +1,15 @@
#Success value for if the spine was actually built
scoreboard players set success value 0

#Decide the height
scoreboard players set spine_height value 48
execute if predicate tid:random_50 run scoreboard players set spine_height value 58
execute if predicate tid:random_33 run scoreboard players set spine_height value 68
execute if predicate tid:random_25 run scoreboard players set spine_height value 78
execute if predicate tid:random_10 run scoreboard players set spine_height value 88

#Attempt to build the spine
function tid:misc/intro_spine_trace

#If the spine built successfully, build the last little bit under the pillar
execute if score success value matches 1 run fill ~ ~-1 ~ ~1 ~-8 ~1 stone_bricks
19 changes: 19 additions & 0 deletions data/tid/functions/misc/intro_spine_build.mcfunction
@@ -0,0 +1,19 @@
#Build the spine shaft
fill ~ ~ ~ ~1 ~ ~1 stone_bricks
execute positioned ~0 ~ ~0 run function tid:dungeon/intro/rng/stone_bricks
execute positioned ~1 ~ ~0 run function tid:dungeon/intro/rng/stone_bricks
execute positioned ~0 ~ ~1 run function tid:dungeon/intro/rng/stone_bricks
execute positioned ~1 ~ ~1 run function tid:dungeon/intro/rng/stone_bricks

#Maybe place some thorns
execute positioned ~0 ~ ~0 if predicate tid:random_04 if block ~ ~-3 ~ air run function tid:misc/intro_spine_thorn_north
execute positioned ~0 ~ ~0 if predicate tid:random_04 if block ~ ~-3 ~ air run function tid:misc/intro_spine_thorn_west

execute positioned ~1 ~ ~0 if predicate tid:random_04 if block ~ ~-3 ~ air run function tid:misc/intro_spine_thorn_north
execute positioned ~1 ~ ~0 if predicate tid:random_04 if block ~ ~-3 ~ air run function tid:misc/intro_spine_thorn_east

execute positioned ~0 ~ ~1 if predicate tid:random_04 if block ~ ~-3 ~ air run function tid:misc/intro_spine_thorn_south
execute positioned ~0 ~ ~1 if predicate tid:random_04 if block ~ ~-3 ~ air run function tid:misc/intro_spine_thorn_west

execute positioned ~1 ~ ~1 if predicate tid:random_04 if block ~ ~-3 ~ air run function tid:misc/intro_spine_thorn_east
execute positioned ~1 ~ ~1 if predicate tid:random_04 if block ~ ~-3 ~ air run function tid:misc/intro_spine_thorn_south
16 changes: 16 additions & 0 deletions data/tid/functions/misc/intro_spine_build_top.mcfunction
@@ -0,0 +1,16 @@
#Place the top block
scoreboard players set temp19 value 0
execute if predicate tid:random_50 run scoreboard players set temp19 value 1
execute if predicate tid:random_50 run scoreboard players set temp19 value 2
execute if predicate tid:random_50 run scoreboard players set temp19 value 3

execute if score temp19 value matches 0 positioned ~0 ~ ~0 run function tid:misc/intro_spine_build_top_block
execute if score temp19 value matches 1 positioned ~1 ~ ~0 run function tid:misc/intro_spine_build_top_block
execute if score temp19 value matches 2 positioned ~0 ~ ~1 run function tid:misc/intro_spine_build_top_block
execute if score temp19 value matches 3 positioned ~1 ~ ~1 run function tid:misc/intro_spine_build_top_block

#Count score
scoreboard players remove spine_height value 1

#Set success
scoreboard players set success value 1
@@ -0,0 +1,7 @@
#Place the top block
setblock ~ ~ ~ stone_bricks
function tid:dungeon/intro/rng/stone_bricks

#If no spine chests have been built yet build it
execute unless score intro_spine_chests value matches 1.. run setblock ~ ~1 ~ chest{LootTable: "tid:chests/intro_spine"}
scoreboard players set intro_spine_chests value 1
4 changes: 4 additions & 0 deletions data/tid/functions/misc/intro_spine_thorn_east.mcfunction
@@ -0,0 +1,4 @@
fill ~ ~ ~ ~1 ~ ~ bone_block[axis=x]
execute if predicate tid:random_80 run fill ~ ~ ~ ~2 ~ ~ bone_block[axis=x] replace air
execute if predicate tid:random_40 run fill ~ ~ ~ ~3 ~ ~ bone_block[axis=x] replace air
execute if predicate tid:random_20 run fill ~ ~ ~ ~4 ~ ~ bone_block[axis=x] replace air
4 changes: 4 additions & 0 deletions data/tid/functions/misc/intro_spine_thorn_north.mcfunction
@@ -0,0 +1,4 @@
fill ~ ~ ~ ~ ~ ~-1 bone_block[axis=z]
execute if predicate tid:random_80 run fill ~ ~ ~ ~ ~ ~-2 bone_block[axis=z] replace air
execute if predicate tid:random_40 run fill ~ ~ ~ ~ ~ ~-3 bone_block[axis=z] replace air
execute if predicate tid:random_20 run fill ~ ~ ~ ~ ~ ~-4 bone_block[axis=z] replace air
4 changes: 4 additions & 0 deletions data/tid/functions/misc/intro_spine_thorn_south.mcfunction
@@ -0,0 +1,4 @@
fill ~ ~ ~ ~ ~ ~1 bone_block[axis=z]
execute if predicate tid:random_80 run fill ~ ~ ~ ~ ~ ~2 bone_block[axis=z] replace air
execute if predicate tid:random_40 run fill ~ ~ ~ ~ ~ ~3 bone_block[axis=z] replace air
execute if predicate tid:random_20 run fill ~ ~ ~ ~ ~ ~4 bone_block[axis=z] replace air
4 changes: 4 additions & 0 deletions data/tid/functions/misc/intro_spine_thorn_west.mcfunction
@@ -0,0 +1,4 @@
fill ~ ~ ~ ~-1 ~ ~ bone_block[axis=x]
execute if predicate tid:random_80 run fill ~ ~ ~ ~-2 ~ ~ bone_block[axis=x] replace air
execute if predicate tid:random_40 run fill ~ ~ ~ ~-3 ~ ~ bone_block[axis=x] replace air
execute if predicate tid:random_20 run fill ~ ~ ~ ~-4 ~ ~ bone_block[axis=x] replace air
15 changes: 15 additions & 0 deletions data/tid/functions/misc/intro_spine_trace.mcfunction
@@ -0,0 +1,15 @@
#Add to spine height
scoreboard players remove spine_height value 1

#Make sure we're not running into a building
scoreboard players set temp18 value 0
execute if block ~0 ~ ~0 #tid:air_or_liquid if block ~5 ~ ~0 #tid:air_or_liquid if block ~-4 ~ ~0 #tid:air_or_liquid if block ~0 ~ ~5 #tid:air_or_liquid if block ~0 ~ ~-4 #tid:air_or_liquid run scoreboard players set temp18 value 1

#Recurse
execute if score temp18 value matches 1 if score spine_height value matches 1.. positioned ~ ~1 ~ run function tid:misc/intro_spine_trace

#Build the top
execute if score spine_height value matches 0 if score success value matches 0 positioned ~ ~1 ~ run function tid:misc/intro_spine_build_top

#Tail-End: If we succeeded, build the pillar!
execute if score success value matches 1 run function tid:misc/intro_spine_build
24 changes: 24 additions & 0 deletions data/tid/loot_tables/chests/intro_spine.json
@@ -0,0 +1,24 @@
{
"pools": [
{
"rolls": 8,
"entries": [
{
"type": "item",
"weight": 10,
"name": "minecraft:gold_nugget"
}
]
},
{
"rolls": 1,
"entries": [
{
"type": "item",
"weight": 10,
"name": "minecraft:golden_apple"
}
]
}
]
}

0 comments on commit 2527089

Please sign in to comment.