SussyCraft/mods/amogus_blocks/init.lua

533 lines
13 KiB
Lua
Raw Normal View History

2023-01-07 21:26:14 +01:00
minetest.register_node("amogus_blocks:ladder_steel", {
description = "Ladder",
drawtype = "signlike",
tiles = {"ladder.png"},
paramtype = "light",
paramtype2 = "wallmounted",
sunlight_propagates = true,
walkable = false,
climbable = true,
is_ground_content = false,
selection_box = {
type = "wallmounted",
},
groups = {cracky = 2},
})
minetest.register_node("amogus_blocks:tv", {
description = "CRT TV",
tiles = {
2023-01-08 15:29:39 +01:00
"crt2.png",
"crt2.png",
"crt2.png",
"crt2.png",
"crt2.png",
"crt.png"
2023-01-07 21:26:14 +01:00
},
paramtype2 = "facedir",
2023-02-04 16:17:05 +01:00
drop = { -- amogus_items:capacitor amogus_items:pcb
-- drop two items
2023-02-04 16:17:05 +01:00
max_items = 2,
items = {
{items = {'amogus_items:capacitor'}, rarity = 1},
{items = {'amogus_items:pcb'}, rarity = 1},
},
}, groups = {stone=3},
2023-01-07 21:26:14 +01:00
})
minetest.register_node("amogus_blocks:bricks", {
2023-01-29 08:25:10 +01:00
description = "Red Bricks",
2023-01-07 21:26:14 +01:00
tiles = {"Bricks.png"},
2023-01-29 08:25:10 +01:00
drop = 'amogus_blocks:bricks', groups = {stone=3},
2023-01-07 21:26:14 +01:00
})
minetest.register_node("amogus_blocks:grey_bricks", {
2023-01-29 08:25:10 +01:00
description = "Bricks",
2023-01-28 19:12:16 +01:00
tiles = {"Bricks2.png"}, groups = {stone=3},
2023-01-07 21:26:14 +01:00
2023-01-28 19:12:16 +01:00
drop = 'amogus_blocks:grey_bricks',
2023-01-07 21:26:14 +01:00
})
2023-01-29 08:25:10 +01:00
minetest.register_node("amogus_blocks:blue_bricks", {
2023-01-29 09:27:09 +01:00
description = "blue Bricks",
2023-01-29 08:25:10 +01:00
tiles = {"Bricks_blue.png"}, groups = {stone=3},
drop = 'amogus_blocks:blue_bricks',
})
minetest.register_node("amogus_blocks:yellow_bricks", {
2023-01-29 09:27:09 +01:00
description = "yellow Bricks",
2023-01-29 08:25:10 +01:00
tiles = {"Bricks_yellow.png"}, groups = {stone=3},
drop = 'amogus_blocks:yellow_bricks',
})
minetest.register_node("amogus_blocks:green_bricks", {
2023-01-29 09:27:09 +01:00
description = "green Bricks",
2023-01-29 08:25:10 +01:00
tiles = {"Bricks_green.png"}, groups = {stone=3},
drop = 'amogus_blocks:green_bricks',
})
2023-01-29 09:27:09 +01:00
minetest.register_node("amogus_blocks:black_bricks", {
description = "black Bricks",
tiles = {"Bricks_black.png"}, groups = {stone=3},
2023-01-29 08:25:10 +01:00
2023-01-29 09:27:09 +01:00
drop = 'amogus_blocks:black_bricks',
2023-01-29 08:25:10 +01:00
})
2023-01-07 21:26:14 +01:00
minetest.register_node("amogus_blocks:planks", {
description = "Planks",
tiles = {"Planks.png"},
drop = 'amogus_blocks:planks', groups = {choppy = 3},
2023-01-07 21:26:14 +01:00
})
minetest.register_node("amogus_blocks:purpleblock", {
description = "Purple Block",
tiles = {"purpleblock.png"},
drop = 'amogus_blocks:purpleblock', groups = {crumbly = 3},
2023-01-07 21:26:14 +01:00
})
2023-01-24 22:22:14 +01:00
minetest.register_node("amogus_blocks:blueblock", {
description = "Blue Block",
tiles = {"blue.png"},
drop = 'amogus_blocks:blueblock', groups = {crumbly = 3},
})
minetest.register_node("amogus_blocks:yellowblock", {
description = "Yellow Block",
tiles = {"yellow.png"},
drop = 'amogus_blocks:yellowblock', groups = {crumbly = 3},
})
minetest.register_node("amogus_blocks:greenblock", {
description = "Green Block",
tiles = {"greenblock.png"},
drop = 'amogus_blocks:greenblock', groups = {crumbly = 3},
})
minetest.register_node("amogus_blocks:blackblock", {
description = "Black Block",
tiles = {"blackblock.png"},
drop = 'amogus_blocks:blackblock', groups = {crumbly = 3},
})minetest.register_node("amogus_blocks:whiteblock", {
description = "White Block",
tiles = {"whiteblock.png"},
drop = 'amogus_blocks:whiteblock', groups = {crumbly = 3},
})
2023-01-07 21:26:14 +01:00
minetest.register_node("amogus_blocks:redblock", {
description = "Red Block",
tiles = {"redblock.png"},
drop = 'amogus_blocks:redblock', groups = {crumbly = 3},
2023-01-07 21:26:14 +01:00
})
minetest.register_node("amogus_blocks:glowing_block", {
description = "Glowing Block",
tiles = {"glowing_block.png"},
drop = 'amogus_blocks:glowing_block', groups = {cracky=3, stone=1},
light_source = 14
})
minetest.register_node("amogus_blocks:transparent", {
2023-01-26 13:42:13 +01:00
description = "Glass",
2023-01-07 21:26:14 +01:00
drawtype = "glasslike",
tiles = {"glass.png"},
paramtype = "light",
is_ground_content = false,
sunlight_propagates = true,
groups = {cracky=3,oddly_breakable_by_hand=3},
})
minetest.register_node("amogus_blocks:grass", {
description = "Grass",
tiles = {
"g2.png",
"d.png",
"g.png",
"g.png",
"g.png",
"g.png"
},
drop = {
max_items = 2,
items = {
{
2023-01-30 07:24:03 +01:00
items = {'amogus_blocks:dirt 5'},
rarity = 3,
},
{
items = {'amogus_items:rock'},
rarity = 2,
},
},
}, groups = {crumbly=3},
2023-01-07 21:26:14 +01:00
})
2023-01-24 22:22:14 +01:00
minetest.register_node("amogus_blocks:grass_green", {
description = "Grass",
tiles = {
"grass_greentop.png",
"d.png",
"grass_greenside.png",
"grass_greenside.png",
"grass_greenside.png",
"grass_greenside.png"
},
drop = {
max_items = 2,
items = {
{
items = {'amogus_blocks:dirt'},
rarity = 3,
},
{
items = {'amogus_items:rock'},
rarity = 2,
},
},
}, groups = {crumbly=3},
})
2023-01-07 21:26:14 +01:00
minetest.register_node("amogus_blocks:wood", {
description = "Wood",
tiles = {"wood.png"},
2023-02-05 21:35:34 +01:00
drop = 'amogus_blocks:wood',
groups = {choppy = 3, flammable = 3, wood = 1},
2023-01-07 21:26:14 +01:00
})
minetest.register_node("amogus_blocks:water_source", {
description = "Water Source",
2023-01-09 02:35:45 +01:00
drawtype = "liquid",
waving = 3,
2023-01-09 02:35:45 +01:00
tiles = {
{
2023-02-03 08:04:38 +01:00
name = "water.png^[opacity:127]",
backface_culling = false,
},
{
2023-02-03 08:04:38 +01:00
name = "water.png^[opacity:127]",
backface_culling = true,
2023-01-09 02:35:45 +01:00
},
},
use_texture_alpha = "blend",
2023-01-09 02:35:45 +01:00
paramtype = "light",
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
is_ground_content = false,
drop = "",
2023-01-09 02:35:45 +01:00
drowning = 1,
liquidtype = "source",
liquid_alternative_flowing = "amogus_blocks:water_flowing",
liquid_alternative_source = "amogus_blocks:water_source",
2023-01-09 02:35:45 +01:00
liquid_viscosity = 1,
post_effect_color = {a = 103, r = 30, g = 60, b = 90},
groups = {water = 3, liquid = 3, cools_lava = 1, not_in_creative_inventory = 1},
})
minetest.register_node("amogus_blocks:water_flowing", {
description = "Flowing Water",
drawtype = "flowingliquid",
waving = 3,
2023-02-03 08:04:38 +01:00
tiles = {"water.png^[opacity:127]"},
special_tiles = {
{
2023-02-03 08:04:38 +01:00
name = "water.png^[opacity:127]",
backface_culling = false,
},
{
2023-02-03 08:04:38 +01:00
name = "water.png^[opacity:127]",
backface_culling = true,
},
},
use_texture_alpha = "blend",
paramtype = "light",
paramtype2 = "flowingliquid",
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
is_ground_content = false,
drop = "",
drowning = 1,
liquidtype = "flowing",
liquid_alternative_flowing = "amogus_blocks:water_flowing",
liquid_alternative_source = "amogus_blocks:water_source",
liquid_viscosity = 1,
post_effect_color = {a = 103, r = 30, g = 60, b = 90},
groups = {water = 3, liquid = 3, not_in_creative_inventory = 1, cools_lava = 1}
2023-01-09 02:35:45 +01:00
})
minetest.register_node("amogus_blocks:dirt", {
description = "Dirt",
tiles = {"d.png"},
groups = {crumbly = 3},
drop = {
max_items = 2,
items = {
{
items = {'amogus_blocks:dirt'},
rarity = 3,
},
{
items = {'amogus_items:rock'},
rarity = 2,
},
},
},
2023-01-22 18:26:41 +01:00
2023-01-26 13:52:37 +01:00
})minetest.register_node("amogus_blocks:sand", {
description = "Sand",
tiles = {"sand.png"},
groups = {crumbly = 3},
2023-01-09 02:35:45 +01:00
})
2023-01-12 19:03:24 +01:00
minetest.register_node("amogus_blocks:stone", {
description = "Stone",
2023-01-12 19:15:55 +01:00
tiles = {"stone.png"},
2023-01-30 07:24:03 +01:00
drop = 'amogus_items:rock 9',
2023-01-29 08:25:10 +01:00
2023-01-26 13:42:13 +01:00
groups = {stone = 3},
2023-01-12 19:03:24 +01:00
})
2023-01-12 19:15:55 +01:00
--add gold ore and sussium ore
minetest.register_node("amogus_blocks:gold_ore", {
description = "Gold Ore",
tiles = {"gold.png"},
2023-01-26 13:42:13 +01:00
groups = {stone = 2},
2023-01-12 19:15:55 +01:00
drop = 'amogus_items:gold_ingot',
--sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("amogus_blocks:sussium_ore", {
description = "Sussium Ore",
tiles = {"sussium.png"},
2023-01-26 13:42:13 +01:00
groups = {stone = 1},
drop = 'amogus_items:sussium_ingot',
2023-01-12 19:15:55 +01:00
--sounds = default.node_sound_stone_defaults(),
})
2023-01-12 19:03:24 +01:00
2023-02-04 16:17:05 +01:00
minetest.register_node("amogus_blocks:iron_ore", {
description = "Iron Ore",
tiles = {"iron_ore.png"},
groups = {stone = 3},
drop = 'amogus_items:iron_ingot',
--sounds = default.node_sound_stone_defaults(),
})
2023-01-12 18:13:21 +01:00
local loot = {
"amogus_items:amogus",
"amogus_items:sprite",
"amogus_items:coke",
"amogus_items:fanta",
"amogus_items:tomato",
"amogus_items:lightsaber_blue",
"amogus_items:lightsaber_red",
"amogus_items:lightsaber_green",
}
minetest.register_node("amogus_blocks:lucky_block", {
description = "Lucky Block",
tiles = {"luckyblock.png"},
2023-01-29 09:27:09 +01:00
2023-01-12 18:13:21 +01:00
groups = {cracky = 3},
on_punch = function(pos, node, puncher, pointed_thing)
local item = loot[math.random(#loot)]
minetest.add_item(pos, item)
2023-01-24 22:22:14 +01:00
minetest.add_particlespawner({
amount = 100,
time = 0.1,
minpos = pos,
maxpos = pos,
minvel = {x = -1, y = 5, z = -1},
maxvel = {x = 1, y = 5, z = 1},
minacc = {x = 0, y = -10, z = 0},
maxacc = {x = 0, y = -10, z = 0},
minexptime = 0.1,
maxexptime = 0.5,
minsize = 1,
maxsize = 2,
collisiondetection = true,
vertical = false,
texture = "luckyblock.png",
})
2023-01-12 18:13:21 +01:00
minetest.remove_node(pos)
end
})
minetest.register_node("amogus_blocks:amogus_spawner", {
description = "Amogus Spawner",
2023-01-29 09:27:09 +01:00
tiles = {"spawner.png"},
drawtype = "glasslike",
paramtype = "light",
is_ground_content = false,
sunlight_propagates = true,
2023-01-24 22:22:14 +01:00
-- after place event
--on_ = function(pos)
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_int("spawned", 0)
meta:set_int("interval", math.random(1,4))
minetest.get_node_timer(pos):start(meta:get_int("interval"))
end,
on_timer = function(pos)
local meta = minetest.get_meta(pos)
local spawned = meta:get_int("spawned")
if spawned < 30 then
minetest.add_entity({x = pos.x, y = pos.y + 1, z = pos.z}, "amogus_entities:amogus")
2023-01-29 09:27:09 +01:00
minetest.add_particlespawner({
amount = 1000,
time = 0.3,
minpos = pos,
maxpos = pos,
minvel = {x = -1, y = 5, z = -1},
maxvel = {x = 1, y = 5, z = 1},
minacc = {x = 0, y = -10, z = 0},
maxacc = {x = 0, y = -10, z = 0},
minexptime = 0.1,
maxexptime = 0.5,
minsize = 1,
maxsize = 2,
collisiondetection = true,
vertical = false,
texture = "amog_flower.png",
})
spawned = spawned + 1
meta:set_int("spawned", spawned)
minetest.get_node_timer(pos):start(meta:get_int("interval"))
else
minetest.remove_node(pos)
end
end
2023-01-26 13:42:13 +01:00
})
minetest.register_node("amogus_blocks:green_leaves", {
description = "Green Leaves",
drawtype = "glasslike",
tiles = {"leaves.png"},
paramtype = "light",
is_ground_content = false,
sunlight_propagates = true,
groups = {cracky=3,oddly_breakable_by_hand=3},
2023-01-28 11:04:13 +01:00
})
minetest.register_node("amogus_blocks:grass_tall", {
description = "Grass plant",
drawtype = "plantlike",
tiles = {"grass_tall.png"},
inventory_image = "grass_tall.png",
wield_image = "grass_tall.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
groups = {snappy=3,flammable=2,flower=1},
--sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
2023-01-28 11:04:13 +01:00
},
})
minetest.register_node("amogus_blocks:purple_grass_tall", {
2023-01-28 11:04:13 +01:00
description = "Grass plant",
drawtype = "plantlike",
tiles = {"purple_grass_tall.png"},
inventory_image = "purple_grass_tall.png",
wield_image = "purple_grass_tall.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
groups = {snappy=3,flammable=2,flower=1},
--sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
2023-01-28 11:04:13 +01:00
},
})
minetest.register_node("amogus_blocks:amogflower", {
2023-01-28 11:04:13 +01:00
description = "amogus flower",
drawtype = "plantlike",
tiles = {"amog_flower.png"},
inventory_image = "amog_flower.png",
wield_image = "amog_flower.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
light_source = 14,
groups = {snappy=3,flammable=2,flower=1},
--sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
2023-01-28 11:04:13 +01:00
},
})
minetest.register_node("amogus_blocks:redflower", {
2023-01-28 11:04:13 +01:00
description = "red flower",
drawtype = "plantlike",
tiles = {"flower.png"},
inventory_image = "flower.png",
wield_image = "flower.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
groups = {snappy=3,flammable=2,flower=1},
--sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
2023-01-28 11:04:13 +01:00
},
})
minetest.register_node("amogus_blocks:yellowflower", {
2023-01-28 11:04:13 +01:00
description = "yellow flower",
drawtype = "plantlike",
tiles = {"flower_2.png"},
inventory_image = "flower_2.png",
wield_image = "flower_2.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
groups = {snappy=3,flammable=2,flower=1},
--sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
2023-01-28 11:04:13 +01:00
},
})
2023-01-28 19:12:16 +01:00
minetest.register_node("amogus_blocks:obsusian", {
description = "obSUSian",
tiles = {"obsusian.png"},
groups = {stone=0.5},
2023-01-30 07:24:03 +01:00
})
-- create golden, sussium block
minetest.register_node("amogus_blocks:sussium_block", {
description = "SUSsium block",
tiles = {"sussium_block.png"},
groups = {stone=1},
})
minetest.register_node("amogus_blocks:golden_block", {
description = "golden block",
tiles = {"golden_block.png"},
groups = {stone=2},
})