From 3c40083955754cc4b08fd47b6673ef30fe420b5f Mon Sep 17 00:00:00 2001 From: Izzy Date: Sun, 18 Aug 2019 21:44:01 -0600 Subject: [PATCH] geode divining, fixed geode drops --- enchanting.lua | 75 +++++++++++++++++++++++++++++++++++++++++++++++--- geodes.lua | 31 +++++++++++++++------ init.lua | 2 +- 3 files changed, 94 insertions(+), 14 deletions(-) diff --git a/enchanting.lua b/enchanting.lua index bfaf0ef..0629b66 100644 --- a/enchanting.lua +++ b/enchanting.lua @@ -164,7 +164,8 @@ minetest.register_craftitem("potions:arcane_book", { minetest.register_node("potions:treasure_seed", { description = "Treasure Seed", - tiles = {"default_mese.png"}, +-- tiles = {"default_mese.png"}, + drawtype = "airlike", groups = {crumbly = 3}, drop = "default:sand", sounds = default.node_sound_dirt_defaults(), @@ -226,16 +227,16 @@ minetest.register_lbm({ action = spawn_treasure, }) ---[[ + minetest.register_abm({ label = "spawn treasure", name = "potions:treasure_1", nodenames = {"potions:treasure_seed"}, chance = 1, - interval = 2, + interval = 10, action = spawn_treasure, }) -]] + minetest.register_decoration({ @@ -372,6 +373,63 @@ minetest.register_node("potions:divining_block", { +minetest.register_node("potions:geode_divining_block", { + description = "Divining Block", + tiles = {"default_sandstone_brick.png"}, + groups = {crumbly = 3}, + sounds = default.node_sound_dirt_defaults(), + + on_punch = function(pos, node, player) + + if potions.get_manna(player) > 90 then + + local p = minetest.find_node_near(pos, 60, {"group:geode_wall"}) + +-- print(dump(p)) + + if p then + local dx = p.x - pos.x + local dz = p.z - pos.z + local l = math.sqrt(dx*dx + dz*dz) + + dx = dx / l + dz = dz / l + + local vel = 4 + + minetest.add_particlespawner({ + amount = 140, + time = 15, + minpos = pos, + maxpos = pos, + minvel = {x=dx*vel, y=5.5, z=dz*vel}, + maxvel = {x=dx*vel, y=5.5, z=dz*vel}, + minacc = {x=-0.1, y=-02.1, z=-0.1}, + maxacc = {x=0.1, y=-02.1, z=0.1}, + minexptime = 1.5, + maxexptime = 5.5, + -- collisiondetection = true, + -- collision_removal = true, + minsize = 0.5, + maxsize = 2.5, + texture = "potions_particle.png^[colorize:yellow:60", + -- animation = tileanimation + glow = 1 + }) + + end + + potions.add_manna(player, -90) + end + + + end + + +}) + + + minetest.register_craft({ output = 'potions:divining_block', recipe = { @@ -381,6 +439,15 @@ minetest.register_craft({ } }) +minetest.register_craft({ + output = 'potions:geode_divining_block', + recipe = { + {'','',''}, + {'','group:gem',''}, + {'default:silver_sandstone_block', 'default:silver_sandstone_block', 'default:silver_sandstone_block'}, + } +}) + minetest.register_craft({ diff --git a/geodes.lua b/geodes.lua index db91102..e5e0312 100644 --- a/geodes.lua +++ b/geodes.lua @@ -155,7 +155,7 @@ function potions.register_geode(name, opts) paramtype2 = "facedir", drawtype = "nodebox", tiles = tiles, - drops = drops, + drop = drops, node_box = { type = "fixed", fixed = { @@ -174,7 +174,7 @@ function potions.register_geode(name, opts) paramtype2 = "facedir", drawtype = "nodebox", tiles = tiles, - drops = drops .. " 2", + drop = drops .. " 2", node_box = { type = "fixed", fixed = { @@ -192,7 +192,7 @@ function potions.register_geode(name, opts) paramtype2 = "facedir", drawtype = "nodebox", tiles = tiles, - drops = drops .. " 2", + drop = drops .. " 2", node_box = { type = "fixed", fixed = { @@ -210,7 +210,7 @@ function potions.register_geode(name, opts) paramtype2 = "facedir", drawtype = "nodebox", tiles = tiles, - drops = drops .. " 3", + drop = drops .. " 3", node_box = { type = "fixed", fixed = { @@ -229,7 +229,7 @@ function potions.register_geode(name, opts) paramtype2 = "facedir", drawtype = "nodebox", tiles = tiles, - drops = drops .. " 3", + drop = drops .. " 3", node_box = { type = "fixed", fixed = { @@ -248,7 +248,7 @@ function potions.register_geode(name, opts) paramtype2 = "facedir", drawtype = "nodebox", tiles = tiles, - drops = drops .. " 4", + drop = drops .. " 4", node_box = { type = "fixed", fixed = { @@ -268,7 +268,7 @@ function potions.register_geode(name, opts) paramtype2 = "facedir", drawtype = "nodebox", tiles = tiles, - drops = drops .. " 4", + drop = drops .. " 4", node_box = { type = "fixed", fixed = { @@ -288,7 +288,7 @@ function potions.register_geode(name, opts) paramtype2 = "facedir", drawtype = "nodebox", tiles = tiles, - drops = drops .. " 5", + drop = drops .. " 5", node_box = { type = "fixed", fixed = { @@ -309,7 +309,7 @@ function potions.register_geode(name, opts) paramtype2 = "facedir", drawtype = "nodebox", tiles = tiles, - drops = drops .. " 6", + drop = drops .. " 6", node_box = { type = "fixed", fixed = { @@ -469,6 +469,7 @@ minetest.register_abm({ minetest.register_craftitem("potions:quartz_crystal", { description = "Quartz Crystal", inventory_image = "potions_quartz_crystal.png", + groups = {gem = 1}, -- y_min, y_max, biome, wherein, rarity }) potions.register_geode("quartz", { @@ -482,6 +483,7 @@ potions.register_geode("quartz", { minetest.register_craftitem("potions:smoky_quartz_crystal", { description = "Smoky Quartz Crystal", inventory_image = "potions_smoky_quartz_crystal.png", + groups = {gem = 1}, }) potions.register_geode("smoky_quartz", { description = "Smoky Quartz", @@ -493,6 +495,7 @@ potions.register_geode("smoky_quartz", { minetest.register_craftitem("potions:amethyst_crystal", { description = "Amethyst Crystal", inventory_image = "potions_amethyst_crystal.png", + groups = {gem = 1}, }) potions.register_geode("amethyst", { description = "Amethyst", @@ -515,10 +518,12 @@ potions.register_geode("epidote", { minetest.register_craftitem("potions:emerald_gem", { description = "Emerald Gem", inventory_image = "potions_emerald_gem.png", + groups = {gem = 1}, }) minetest.register_craftitem("potions:emerald_crystal", { description = "Emerald Crystal", inventory_image = "potions_emerald_crystal.png", + groups = {gem = 1}, }) potions.register_geode("emerald", { description = "Emerald", @@ -531,10 +536,12 @@ potions.register_geode("emerald", { minetest.register_craftitem("potions:ruby_gem", { description = "Ruby Gem", inventory_image = "potions_ruby_gem.png", + groups = {gem = 1}, }) minetest.register_craftitem("potions:ruby_crystal", { description = "Ruby Crystal", inventory_image = "potions_ruby_crystal.png", + groups = {gem = 1}, }) potions.register_geode("ruby", { description = "Ruby", @@ -546,10 +553,12 @@ potions.register_geode("ruby", { minetest.register_craftitem("potions:sapphire_gem", { description = "Sapphire Gem", inventory_image = "potions_sapphire_gem.png", + groups = {gem = 1}, }) minetest.register_craftitem("potions:sapphire_crystal", { description = "Sapphire Crystal", inventory_image = "potions_sapphire_crystal.png", + groups = {gem = 1}, }) potions.register_geode("sapphire", { description = "Sapphire", @@ -562,10 +571,12 @@ potions.register_geode("sapphire", { minetest.register_craftitem("potions:garnet_gem", { description = "Garnet Gem", inventory_image = "potions_garnet_gem.png", + groups = {gem = 1}, }) minetest.register_craftitem("potions:garnet_crystal", { description = "Garnet Crystal", inventory_image = "potions_garnet_crystal.png", + groups = {gem = 1}, }) potions.register_geode("garnet", { description = "Garnet", @@ -578,10 +589,12 @@ potions.register_geode("garnet", { minetest.register_craftitem("potions:zircon_gem", { description = "Zircon Gem", inventory_image = "potions_zircon_gem.png", + groups = {gem = 1}, }) minetest.register_craftitem("potions:zircon_crystal", { description = "Zircon Crystal", inventory_image = "potions_zircon_crystal.png", + groups = {gem = 1}, }) potions.register_geode("zircon", { description = "Zircon", diff --git a/init.lua b/init.lua index 135a4e0..99f2d38 100644 --- a/init.lua +++ b/init.lua @@ -59,7 +59,7 @@ potions/magic scry for nearby things; particles lead the way summon a storm blight an area - accerate (certain) plant/fungus growth in an area + accelerate (certain) plant/fungus growth in an area conjure a volcano spawn magma node forge-style movement