Update 0.1

master
fishyWET 2014-05-17 18:09:14 +08:00
parent 6f75edcd4c
commit b2a1414cac
57 changed files with 81206 additions and 742 deletions

View File

@ -1,5 +0,0 @@
This Mod add a fantasy-like glowing biome to Minetest.
Created by: fishyWET
Credits:
Paramat (Generation of Trees & Stuff based on his "Perlin Jungletrees Ongen" mod)
Jeija (Features of runes based on "nyanland" mod)

8
glowtest/README.txt Normal file
View File

@ -0,0 +1,8 @@
This Mod add a fantasy-like glowing biome to Minetest.
Created by: fishyWET
Credits:
Paramat (Generation of Trees & Stuff based on his "Perlin Jungletrees Ongen" mod)
Jeija (Features of runes based on "nyanland" mod)
AspireMint (Models & texture of Mobs)
BrandonReese (Mobs based on his "reworked simple mobs" mod)
PlizAdam (Mobs based on his "simple mobs" mod)

View File

@ -1 +1,2 @@
default
fire

View File

@ -0,0 +1,35 @@
minetest.register_craft({
output = 'glowtest:rune_1',
recipe = {
{'group:crystal', 'default:stone', 'default:stone'},
{'group:crystal', 'default:mese', 'group:crystal'},
{'group:crystal', 'default:stone', 'group:crystal'},
}
})
minetest.register_craft({
output = 'glowtest:rune_2',
recipe = {
{'default:stone', 'group:crystal', 'default:stone'},
{'group:crystal', 'default:mese', 'group:crystal'},
{'default:stone', 'group:crystal', 'default:stone'},
}
})
minetest.register_craft({
output = 'glowtest:rune_1_cursed',
recipe = {
{'group:crystal_cursed', 'default:stone', 'default:stone'},
{'group:crystal_cursed', 'default:mese', 'group:crystal_cursed'},
{'group:crystal_cursed', 'default:stone', 'group:crystal_cursed'},
}
})
minetest.register_craft({
output = 'glowtest:rune_2_cursed',
recipe = {
{'default:stone', 'group:crystal_cursed', 'default:stone'},
{'group:crystal_cursed', 'default:mese', 'group:crystal_cursed'},
{'default:stone', 'group:crystal_cursed', 'default:stone'},
}
})

View File

@ -0,0 +1,751 @@
--Crystal 1
minetest.register_node("glowtest:blue_crystal_1", {
description = "Blue Crystal",
drawtype = "nodebox",
tiles = {"glowtest_blue.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,crystal=1},
sounds = default.node_sound_glass_defaults(),
node_box = {
type = "fixed",
fixed = {
{-0.1875,-0.5,-0.125,0.1875,0.3125,0.1875},
{0.0625,-0.5,-0.25,0.3125,0,0},
{0.0625,-0.5,0.1875,0.25,0.1875,0.375},
{-0.3125,-0.5,-0.3125,-0.0625,0.0625,0},
{-0.375,-0.5,0.0625,-0.125,-0.0625,0.3125},
}
},
on_place = function(itemstack, placer, pointed_thing)
local stack = ItemStack("glowtest:blue_crystal_"..math.random(1,5))
local ret = minetest.item_place(stack, placer, pointed_thing)
return ItemStack("glowtest:blue_crystal_1 "..itemstack:get_count()-(1-ret:get_count()))
end,
})
minetest.register_node("glowtest:green_crystal_1", {
description = "Green Crystal",
drawtype = "nodebox",
tiles = {"glowtest_green.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,crystal=1},
sounds = default.node_sound_glass_defaults(),
node_box = {
type = "fixed",
fixed = {
{-0.1875,-0.5,-0.125,0.1875,0.3125,0.1875},
{0.0625,-0.5,-0.25,0.3125,0,0},
{0.0625,-0.5,0.1875,0.25,0.1875,0.375},
{-0.3125,-0.5,-0.3125,-0.0625,0.0625,0},
{-0.375,-0.5,0.0625,-0.125,-0.0625,0.3125},
}
},
on_place = function(itemstack, placer, pointed_thing)
local stack = ItemStack("glowtest:green_crystal_"..math.random(1,5))
local ret = minetest.item_place(stack, placer, pointed_thing)
return ItemStack("glowtest:green_crystal_1 "..itemstack:get_count()-(1-ret:get_count()))
end,
})
minetest.register_node("glowtest:red_crystal_1", {
description = "Red Crystal",
drawtype = "nodebox",
tiles = {"glowtest_red.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,crystal_cursed=1},
sounds = default.node_sound_glass_defaults(),
node_box = {
type = "fixed",
fixed = {
{-0.1875,-0.5,-0.125,0.1875,0.3125,0.1875},
{0.0625,-0.5,-0.25,0.3125,0,0},
{0.0625,-0.5,0.1875,0.25,0.1875,0.375},
{-0.3125,-0.5,-0.3125,-0.0625,0.0625,0},
{-0.375,-0.5,0.0625,-0.125,-0.0625,0.3125},
}
},
on_place = function(itemstack, placer, pointed_thing)
local stack = ItemStack("glowtest:red_crystal_"..math.random(1,5))
local ret = minetest.item_place(stack, placer, pointed_thing)
return ItemStack("glowtest:red_crystal_1 "..itemstack:get_count()-(1-ret:get_count()))
end,
})
minetest.register_node("glowtest:pink_crystal_1", {
description = "Pink Crystal",
drawtype = "nodebox",
tiles = {"glowtest_pink.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,crystal=1},
sounds = default.node_sound_glass_defaults(),
node_box = {
type = "fixed",
fixed = {
{-0.1875,-0.5,-0.125,0.1875,0.3125,0.1875},
{0.0625,-0.5,-0.25,0.3125,0,0},
{0.0625,-0.5,0.1875,0.25,0.1875,0.375},
{-0.3125,-0.5,-0.3125,-0.0625,0.0625,0},
{-0.375,-0.5,0.0625,-0.125,-0.0625,0.3125},
}
},
on_place = function(itemstack, placer, pointed_thing)
local stack = ItemStack("glowtest:pink_crystal_"..math.random(1,5))
local ret = minetest.item_place(stack, placer, pointed_thing)
return ItemStack("glowtest:pink_crystal_1 "..itemstack:get_count()-(1-ret:get_count()))
end,
})
minetest.register_node("glowtest:yellow_crystal_1", {
description = "Yellow Crystal",
drawtype = "nodebox",
tiles = {"glowtest_yellow.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,crystal=1},
sounds = default.node_sound_glass_defaults(),
node_box = {
type = "fixed",
fixed = {
{-0.1875,-0.5,-0.125,0.1875,0.3125,0.1875},
{0.0625,-0.5,-0.25,0.3125,0,0},
{0.0625,-0.5,0.1875,0.25,0.1875,0.375},
{-0.3125,-0.5,-0.3125,-0.0625,0.0625,0},
{-0.375,-0.5,0.0625,-0.125,-0.0625,0.3125},
}
},
on_place = function(itemstack, placer, pointed_thing)
local stack = ItemStack("glowtest:yellow_crystal_"..math.random(1,5))
local ret = minetest.item_place(stack, placer, pointed_thing)
return ItemStack("glowtest:yellow_crystal_1 "..itemstack:get_count()-(1-ret:get_count()))
end,
})
--Crystal 2
minetest.register_node("glowtest:blue_crystal_2", {
drawtype = "nodebox",
tiles = {"glowtest_blue.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:blue_crystal_1",
node_box = {
type = "fixed",
fixed = {
{-0.1875,-0.5,-0.125,0.1875,0.5,0.1875},
{0.1875,-0.5,-0.25,0.5,0.1875,0},
{0.0625,-0.5,0.1875,0.375,0.375,0.375},
{-0.375,-0.5,-0.3125,-0.0625,0.25,0},
{-0.5,-0.5,-0.0625,-0.125,0,0.3125},
{0,-0.5,-0.5,0.3125,-0.0625,-0.1875},
}
}
})
minetest.register_node("glowtest:green_crystal_2", {
drawtype = "nodebox",
tiles = {"glowtest_green.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:green_crystal_1",
node_box = {
type = "fixed",
fixed = {
{-0.1875,-0.5,-0.125,0.1875,0.5,0.1875},
{0.1875,-0.5,-0.25,0.5,0.1875,0},
{0.0625,-0.5,0.1875,0.375,0.375,0.375},
{-0.375,-0.5,-0.3125,-0.0625,0.25,0},
{-0.5,-0.5,-0.0625,-0.125,0,0.3125},
{0,-0.5,-0.5,0.3125,-0.0625,-0.1875},
}
}
})
minetest.register_node("glowtest:red_crystal_2", {
drawtype = "nodebox",
tiles = {"glowtest_red.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:red_crystal_1",
node_box = {
type = "fixed",
fixed = {
{-0.1875,-0.5,-0.125,0.1875,0.5,0.1875},
{0.1875,-0.5,-0.25,0.5,0.1875,0},
{0.0625,-0.5,0.1875,0.375,0.375,0.375},
{-0.375,-0.5,-0.3125,-0.0625,0.25,0},
{-0.5,-0.5,-0.0625,-0.125,0,0.3125},
{0,-0.5,-0.5,0.3125,-0.0625,-0.1875},
}
}
})
minetest.register_node("glowtest:pink_crystal_2", {
drawtype = "nodebox",
tiles = {"glowtest_pink.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:pink_crystal_1",
node_box = {
type = "fixed",
fixed = {
{-0.1875,-0.5,-0.125,0.1875,0.5,0.1875},
{0.1875,-0.5,-0.25,0.5,0.1875,0},
{0.0625,-0.5,0.1875,0.375,0.375,0.375},
{-0.375,-0.5,-0.3125,-0.0625,0.25,0},
{-0.5,-0.5,-0.0625,-0.125,0,0.3125},
{0,-0.5,-0.5,0.3125,-0.0625,-0.1875},
}
}
})
minetest.register_node("glowtest:yellow_crystal_2", {
drawtype = "nodebox",
tiles = {"glowtest_yellow.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:yellow_crystal_1",
node_box = {
type = "fixed",
fixed = {
{-0.1875,-0.5,-0.125,0.1875,0.5,0.1875},
{0.1875,-0.5,-0.25,0.5,0.1875,0},
{0.0625,-0.5,0.1875,0.375,0.375,0.375},
{-0.375,-0.5,-0.3125,-0.0625,0.25,0},
{-0.5,-0.5,-0.0625,-0.125,0,0.3125},
{0,-0.5,-0.5,0.3125,-0.0625,-0.1875},
}
}
})
--Crystal 3
minetest.register_node("glowtest:blue_crystal_3", {
drawtype = "nodebox",
tiles = {"glowtest_blue.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:blue_crystal_1",
node_box = {
type = "fixed",
fixed = {
{-0.125,-0.5,-0.25,0.25,0.5,0.1875},
{-0.125,-0.5,-0.4375,0.125,0.25,-0.1875},
{0,-0.5,-0.125,0.461539,0,0.3125},
{-0.5,-0.5,0,-0.0625,0.25,0.413465},
{-0.375,-0.5,-0.25,-0.0625,-0.0625,0.0625},
{0.1875,-0.5,-0.5,0.5,-0.25,-0.1875},
{-0.4375,-0.5,-0.5,-0.0625,-0.25,-0.125},
}
}
})
minetest.register_node("glowtest:green_crystal_3", {
drawtype = "nodebox",
tiles = {"glowtest_green.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:green_crystal_1",
node_box = {
type = "fixed",
fixed = {
{-0.125,-0.5,-0.25,0.25,0.5,0.1875},
{-0.125,-0.5,-0.4375,0.125,0.25,-0.1875},
{0,-0.5,-0.125,0.461539,0,0.3125},
{-0.5,-0.5,0,-0.0625,0.25,0.413465},
{-0.375,-0.5,-0.25,-0.0625,-0.0625,0.0625},
{0.1875,-0.5,-0.5,0.5,-0.25,-0.1875},
{-0.4375,-0.5,-0.5,-0.0625,-0.25,-0.125},
}
}
})
minetest.register_node("glowtest:red_crystal_3", {
drawtype = "nodebox",
tiles = {"glowtest_red.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:red_crystal_1",
node_box = {
type = "fixed",
fixed = {
{-0.125,-0.5,-0.25,0.25,0.5,0.1875},
{-0.125,-0.5,-0.4375,0.125,0.25,-0.1875},
{0,-0.5,-0.125,0.461539,0,0.3125},
{-0.5,-0.5,0,-0.0625,0.25,0.413465},
{-0.375,-0.5,-0.25,-0.0625,-0.0625,0.0625},
{0.1875,-0.5,-0.5,0.5,-0.25,-0.1875},
{-0.4375,-0.5,-0.5,-0.0625,-0.25,-0.125},
}
}
})
minetest.register_node("glowtest:pink_crystal_3", {
drawtype = "nodebox",
tiles = {"glowtest_pink.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:pink_crystal_1",
node_box = {
type = "fixed",
fixed = {
{-0.125,-0.5,-0.25,0.25,0.5,0.1875},
{-0.125,-0.5,-0.4375,0.125,0.25,-0.1875},
{0,-0.5,-0.125,0.461539,0,0.3125},
{-0.5,-0.5,0,-0.0625,0.25,0.413465},
{-0.375,-0.5,-0.25,-0.0625,-0.0625,0.0625},
{0.1875,-0.5,-0.5,0.5,-0.25,-0.1875},
{-0.4375,-0.5,-0.5,-0.0625,-0.25,-0.125},
}
}
})
minetest.register_node("glowtest:yellow_crystal_3", {
drawtype = "nodebox",
tiles = {"glowtest_yellow.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:yellow_crystal_1",
node_box = {
type = "fixed",
fixed = {
{-0.125,-0.5,-0.25,0.25,0.5,0.1875},
{-0.125,-0.5,-0.4375,0.125,0.25,-0.1875},
{0,-0.5,-0.125,0.461539,0,0.3125},
{-0.5,-0.5,0,-0.0625,0.25,0.413465},
{-0.375,-0.5,-0.25,-0.0625,-0.0625,0.0625},
{0.1875,-0.5,-0.5,0.5,-0.25,-0.1875},
{-0.4375,-0.5,-0.5,-0.0625,-0.25,-0.125},
}
}
})
--Crystal 4
minetest.register_node("glowtest:blue_crystal_4", {
drawtype = "nodebox",
tiles = {"glowtest_blue.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:blue_crystal_1",
node_box = {
type = "fixed",
fixed = {
{0.125,-0.5,-0.25,0.5,-0.125,0.125},
{-0.125,-0.5,-0.0625,0.1875,0.375,0.3125},
{0.0625,-0.5,-0.5,0.375,-0.0625,-0.125},
{-0.3125,-0.5,-0.3125,0,-0.1875,0.0625},
{-0.0625,-0.5,-0.1875,0.375,0.25,0.125},
{-0.375,-0.5,0.125,0,0.25,0.5},
}
}
})
minetest.register_node("glowtest:green_crystal_4", {
drawtype = "nodebox",
tiles = {"glowtest_green.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:green_crystal_1",
node_box = {
type = "fixed",
fixed = {
{0.125,-0.5,-0.25,0.5,-0.125,0.125},
{-0.125,-0.5,-0.0625,0.1875,0.375,0.3125},
{0.0625,-0.5,-0.5,0.375,-0.0625,-0.125},
{-0.3125,-0.5,-0.3125,0,-0.1875,0.0625},
{-0.0625,-0.5,-0.1875,0.375,0.25,0.125},
{-0.375,-0.5,0.125,0,0.25,0.5},
}
}
})
minetest.register_node("glowtest:red_crystal_4", {
drawtype = "nodebox",
tiles = {"glowtest_red.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:red_crystal_1",
node_box = {
type = "fixed",
fixed = {
{0.125,-0.5,-0.25,0.5,-0.125,0.125},
{-0.125,-0.5,-0.0625,0.1875,0.375,0.3125},
{0.0625,-0.5,-0.5,0.375,-0.0625,-0.125},
{-0.3125,-0.5,-0.3125,0,-0.1875,0.0625},
{-0.0625,-0.5,-0.1875,0.375,0.25,0.125},
{-0.375,-0.5,0.125,0,0.25,0.5},
}
}
})
minetest.register_node("glowtest:pink_crystal_4", {
drawtype = "nodebox",
tiles = {"glowtest_pink.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:pink_crystal_1",
node_box = {
type = "fixed",
fixed = {
{0.125,-0.5,-0.25,0.5,-0.125,0.125},
{-0.125,-0.5,-0.0625,0.1875,0.375,0.3125},
{0.0625,-0.5,-0.5,0.375,-0.0625,-0.125},
{-0.3125,-0.5,-0.3125,0,-0.1875,0.0625},
{-0.0625,-0.5,-0.1875,0.375,0.25,0.125},
{-0.375,-0.5,0.125,0,0.25,0.5},
}
}
})
minetest.register_node("glowtest:yellow_crystal_4", {
drawtype = "nodebox",
tiles = {"glowtest_yellow.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:yellow_crystal_1",
node_box = {
type = "fixed",
fixed = {
{0.125,-0.5,-0.25,0.5,-0.125,0.125},
{-0.125,-0.5,-0.0625,0.1875,0.375,0.3125},
{0.0625,-0.5,-0.5,0.375,-0.0625,-0.125},
{-0.3125,-0.5,-0.3125,0,-0.1875,0.0625},
{-0.0625,-0.5,-0.1875,0.375,0.25,0.125},
{-0.375,-0.5,0.125,0,0.25,0.5},
}
}
})
--Crystal 5
minetest.register_node("glowtest:blue_crystal_5", {
drawtype = "nodebox",
tiles = {"glowtest_blue.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:blue_crystal_1",
node_box = {
type = "fixed",
fixed = {
{-0.3125,-0.5,-0.1875,0,0.5,0.125},
{-0.1875,-0.5,-0.3125,0.1875,0.125,0},
{-0.25,-0.5,-0.5,0.0625,0.3125,-0.1875},
{0.0625,-0.5,-0.125,0.375,-0.125,0.1875},
{0.0625,-0.5,-0.375,0.3125,-0.25,-0.1875},
{-0.1875,-0.5,0,0.125,0.0625,0.5},
}
}
})
minetest.register_node("glowtest:green_crystal_5", {
drawtype = "nodebox",
tiles = {"glowtest_green.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:green_crystal_1",
node_box = {
type = "fixed",
fixed = {
{-0.3125,-0.5,-0.1875,0,0.5,0.125},
{-0.1875,-0.5,-0.3125,0.1875,0.125,0},
{-0.25,-0.5,-0.5,0.0625,0.3125,-0.1875},
{0.0625,-0.5,-0.125,0.375,-0.125,0.1875},
{0.0625,-0.5,-0.375,0.3125,-0.25,-0.1875},
{-0.1875,-0.5,0,0.125,0.0625,0.5},
}
}
})
minetest.register_node("glowtest:red_crystal_5", {
drawtype = "nodebox",
tiles = {"glowtest_red.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:red_crystal_1",
node_box = {
type = "fixed",
fixed = {
{-0.3125,-0.5,-0.1875,0,0.5,0.125},
{-0.1875,-0.5,-0.3125,0.1875,0.125,0},
{-0.25,-0.5,-0.5,0.0625,0.3125,-0.1875},
{0.0625,-0.5,-0.125,0.375,-0.125,0.1875},
{0.0625,-0.5,-0.375,0.3125,-0.25,-0.1875},
{-0.1875,-0.5,0,0.125,0.0625,0.5},
}
}
})
minetest.register_node("glowtest:pink_crystal_5", {
drawtype = "nodebox",
tiles = {"glowtest_pink.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:pink_crystal_1",
node_box = {
type = "fixed",
fixed = {
{-0.3125,-0.5,-0.1875,0,0.5,0.125},
{-0.1875,-0.5,-0.3125,0.1875,0.125,0},
{-0.25,-0.5,-0.5,0.0625,0.3125,-0.1875},
{0.0625,-0.5,-0.125,0.375,-0.125,0.1875},
{0.0625,-0.5,-0.375,0.3125,-0.25,-0.1875},
{-0.1875,-0.5,0,0.125,0.0625,0.5},
}
}
})
minetest.register_node("glowtest:yellow_crystal_5", {
drawtype = "nodebox",
tiles = {"glowtest_yellow.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:yellow_crystal_1",
node_box = {
type = "fixed",
fixed = {
{-0.3125,-0.5,-0.1875,0,0.5,0.125},
{-0.1875,-0.5,-0.3125,0.1875,0.125,0},
{-0.25,-0.5,-0.5,0.0625,0.3125,-0.1875},
{0.0625,-0.5,-0.125,0.375,-0.125,0.1875},
{0.0625,-0.5,-0.375,0.3125,-0.25,-0.1875},
{-0.1875,-0.5,0,0.125,0.0625,0.5},
}
}
})
--Crystal 6
minetest.register_node("glowtest:blue_crystal_6", {
drawtype = "nodebox",
tiles = {"glowtest_blue.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:blue_crystal_1",
node_box = {
type = "fixed",
fixed = {
{-0.125,-0.5,-0.1875,0.1875,0.1875,0.125},
{0,-0.5,-0.375,0.3125,-0.0625,-0.0625},
{-0.25,-0.5,-0.0625,0.0625,0,0.25},
{0.0625,-0.5,0,0.461539,-0.25,0.375},
{-0.3125,-0.5,-0.4375,0.0625,-0.1875,-0.0625},
}
}
})
minetest.register_node("glowtest:green_crystal_6", {
drawtype = "nodebox",
tiles = {"glowtest_green.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:green_crystal_1",
node_box = {
type = "fixed",
fixed = {
{-0.125,-0.5,-0.1875,0.1875,0.1875,0.125},
{0,-0.5,-0.375,0.3125,-0.0625,-0.0625},
{-0.25,-0.5,-0.0625,0.0625,0,0.25},
{0.0625,-0.5,0,0.461539,-0.25,0.375},
{-0.3125,-0.5,-0.4375,0.0625,-0.1875,-0.0625},
}
}
})
minetest.register_node("glowtest:red_crystal_6", {
drawtype = "nodebox",
tiles = {"glowtest_red.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:red_crystal_1",
node_box = {
type = "fixed",
fixed = {
{-0.125,-0.5,-0.1875,0.1875,0.1875,0.125},
{0,-0.5,-0.375,0.3125,-0.0625,-0.0625},
{-0.25,-0.5,-0.0625,0.0625,0,0.25},
{0.0625,-0.5,0,0.461539,-0.25,0.375},
{-0.3125,-0.5,-0.4375,0.0625,-0.1875,-0.0625},
}
}
})
minetest.register_node("glowtest:pink_crystal_6", {
drawtype = "nodebox",
tiles = {"glowtest_pink.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:pink_crystal_1",
node_box = {
type = "fixed",
fixed = {
{-0.125,-0.5,-0.1875,0.1875,0.1875,0.125},
{0,-0.5,-0.375,0.3125,-0.0625,-0.0625},
{-0.25,-0.5,-0.0625,0.0625,0,0.25},
{0.0625,-0.5,0,0.461539,-0.25,0.375},
{-0.3125,-0.5,-0.4375,0.0625,-0.1875,-0.0625},
}
}
})
minetest.register_node("glowtest:yellow_crystal_6", {
drawtype = "nodebox",
tiles = {"glowtest_yellow.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:yellow_crystal_1",
node_box = {
type = "fixed",
fixed = {
{-0.125,-0.5,-0.1875,0.1875,0.1875,0.125},
{0,-0.5,-0.375,0.3125,-0.0625,-0.0625},
{-0.25,-0.5,-0.0625,0.0625,0,0.25},
{0.0625,-0.5,0,0.461539,-0.25,0.375},
{-0.3125,-0.5,-0.4375,0.0625,-0.1875,-0.0625},
}
}
})

View File

@ -0,0 +1,140 @@
local MAXALT = 23
local MINSPA = 2
local MAXSPA = 11
local NORMPLANT = 16
local RAREPLANT = 25
local LOWALT = -10
local SEEDDIFF = 104
local OCTAVES = 3
local PERSISTENCE = 0.5
local SCALE = 200
local NOISEH = -0.6
local NOISEL = -1.2
local GREINT = 23
local GRECHA = 13
local ONGEN = true
local REMOVE_TREES = true
local DEBUG = true
local colchamin = MINSPA ^ 2
local factor = (MAXSPA ^ 2 - colchamin) * 4
local nav = (NOISEH + NOISEL) / 2
local nra = NOISEH - NOISEL
if ONGEN then
minetest.register_on_generated(function(minp, maxp, seed)
if minp.y == -32 then
local perlin = minetest.env:get_perlin(SEEDDIFF, OCTAVES, PERSISTENCE, SCALE)
local x0 = minp.x
local z0 = minp.z
local x1 = maxp.x
local z1 = maxp.z
local xl = x1 - x0
local zl = z1 - z0
if not (perlin:get2d({x=x0, y=z0}) > NOISEL and perlin:get2d({x=x0, y=z0}) < NOISEH)
and not (perlin:get2d({x=x0, y=z1}) > NOISEL and perlin:get2d({x=x0, y=z1}) < NOISEH)
and not (perlin:get2d({x=x1, y=z0}) > NOISEL and perlin:get2d({x=x1, y=z0}) < NOISEH)
and not (perlin:get2d({x=x1, y=z1}) > NOISEL and perlin:get2d({x=x1, y=z1}) < NOISEH)
and not (perlin:get2d({x=x0, y=z0+(zl/2)}) > NOISEL and perlin:get2d({x=x0, y=z0+(zl/2)}) < NOISEH)
and not (perlin:get2d({x=x1, y=z0+(zl/2)}) > NOISEL and perlin:get2d({x=x1, y=z0+(zl/2)}) < NOISEH)
and not (perlin:get2d({x=x0+(xl/2), y=z0}) > NOISEL and perlin:get2d({x=x0+(xl/2), y=z0}) < NOISEH)
and not (perlin:get2d({x=x0+(xl/2), y=z1}) > NOISEL and perlin:get2d({x=x0+(xl/2), y=z1}) < NOISEH)
and not (perlin:get2d({x=x0+(xl/2), y=z0+(zl/2)}) > NOISEL and perlin:get2d({x=x0+(xl/2), y=z0+(zl/2)}) < NOISEH) then
return
end
if REMOVE_TREES == true then
local trees = minetest.env:find_nodes_in_area(minp, maxp, {"default:leaves","default:tree","default:apple"})
for i,v in pairs(trees) do
minetest.env:remove_node(v)
end
--if DEBUG then
-- print ("[glowtest] Trees Removed ("..minp.x.." "..minp.y.." "..minp.z..")")
--end
end
for i = 0, xl do
for j = 0, zl do
local x = x0 + i
local z = z0 + j
local noise = perlin:get2d({x = x, y = z})
if noise > NOISEL and noise < NOISEH then
local colcha = colchamin + math.floor(factor * (math.abs(noise - nav) / nra) ^ 2)
if math.random(1,colcha) == 1 then
local ground_y = nil
for y=maxp.y,minp.y,-1 do
local nodename = minetest.env:get_node({x=x,y=y,z=z}).name
if nodename ~= "air" and nodename ~= "default:water_source" then
ground_y = y
break
end
end
if ground_y and ground_y <= MAXALT then
local nodename = minetest.env:get_node({x=x,y=ground_y,z=z}).name
local junnear = minetest.env:find_node_near({x=x,y=ground_y,z=z}, MINSPA, "default:jungletree")
local defnear = minetest.env:find_node_near({x=x,y=ground_y,z=z}, MINSPA, "default:tree")
if nodename == "default:dirt_with_grass" and junnear == nil and defnear == nil and math.random(NORMPLANT) == 16 then
glowtest_sgreentree({x=x,y=ground_y+1,z=z})
elseif nodename == "default:dirt_with_grass" and junnear == nil and defnear == nil and math.random(NORMPLANT) == 2 then
glowtest_mgreentree({x=x,y=ground_y+1,z=z})
elseif nodename == "default:dirt_with_grass" and junnear == nil and defnear == nil and math.random(NORMPLANT) == 3 then
glowtest_lgreentree({x=x,y=ground_y+1,z=z})
elseif nodename == "default:dirt_with_grass" and junnear == nil and defnear == nil and math.random(NORMPLANT) == 4 then
glowtest_sbluetree({x=x,y=ground_y+1,z=z})
elseif nodename == "default:dirt_with_grass" and junnear == nil and defnear == nil and math.random(NORMPLANT) == 5 then
glowtest_mbluetree({x=x,y=ground_y+1,z=z})
elseif nodename == "default:dirt_with_grass" and junnear == nil and defnear == nil and math.random(NORMPLANT) == 6 then
glowtest_lbluetree({x=x,y=ground_y+1,z=z})
elseif nodename == "default:dirt_with_grass" and junnear == nil and defnear == nil and math.random(NORMPLANT) == 7 then
glowtest_spinktree({x=x,y=ground_y+1,z=z})
elseif nodename == "default:dirt_with_grass" and junnear == nil and defnear == nil and math.random(NORMPLANT) == 8 then
glowtest_mpinktree({x=x,y=ground_y+1,z=z})
elseif nodename == "default:dirt_with_grass" and junnear == nil and defnear == nil and math.random(NORMPLANT) == 9 then
glowtest_lpinktree({x=x,y=ground_y+1,z=z})
elseif nodename == "default:dirt_with_grass" and junnear == nil and defnear == nil and math.random(NORMPLANT) == 10 then
glowtest_syellowtree({x=x,y=ground_y+1,z=z})
elseif nodename == "default:dirt_with_grass" and junnear == nil and defnear == nil and math.random(NORMPLANT) == 11 then
glowtest_myellowtree({x=x,y=ground_y+1,z=z})
elseif nodename == "default:dirt_with_grass" and junnear == nil and defnear == nil and math.random(NORMPLANT) == 12 then
glowtest_lyellowtree({x=x,y=ground_y+1,z=z})
elseif nodename == "default:dirt_with_grass" and junnear == nil and defnear == nil and math.random(NORMPLANT) == 13 then
glowtest_swhitetree({x=x,y=ground_y+1,z=z})
elseif nodename == "default:dirt_with_grass" and junnear == nil and defnear == nil and math.random(NORMPLANT) == 14 then
glowtest_mwhitetree({x=x,y=ground_y+1,z=z})
elseif nodename == "default:dirt_with_grass" and junnear == nil and defnear == nil and math.random(NORMPLANT) == 15 then
glowtest_lwhitetree({x=x,y=ground_y+1,z=z})
elseif nodename == "default:desert_sand" and math.random(NORMPLANT) == 16 then
glowtest_sredtree({x=x,y=ground_y+1,z=z})
elseif nodename == "default:desert_sand" and math.random(NORMPLANT) == 2 then
glowtest_mredtree({x=x,y=ground_y+1,z=z})
elseif nodename == "default:desert_sand" and math.random(NORMPLANT) == 3 then
glowtest_lredtree({x=x,y=ground_y+1,z=z})
elseif nodename == "default:desert_sand" and math.random(NORMPLANT) == 4 then
glowtest_sblacktree({x=x,y=ground_y+1,z=z})
elseif nodename == "default:desert_sand" and math.random(NORMPLANT) == 5 then
glowtest_mblacktree({x=x,y=ground_y+1,z=z})
elseif nodename == "default:desert_sand" and math.random(NORMPLANT) == 6 then
glowtest_lblacktree({x=x,y=ground_y+1,z=z})
elseif nodename == "default:dirt_with_grass" and junnear == nil and defnear == nil and math.random(RAREPLANT) == 1 then
minetest.add_node({x=x,y=ground_y+1,z=z},{name="glowtest:blue_crystal_1"})
elseif nodename == "default:dirt_with_grass" and junnear == nil and defnear == nil and math.random(RAREPLANT) == 2 then
minetest.add_node({x=x,y=ground_y+1,z=z},{name="glowtest:green_crystal_1"})
elseif nodename == "default:desert_sand" and math.random(RAREPLANT) == 3 then
minetest.add_node({x=x,y=ground_y+1,z=z},{name="glowtest:red_crystal_1"})
elseif nodename == "default:dirt_with_grass" and junnear == nil and defnear == nil and math.random(RAREPLANT) == 4 then
minetest.add_node({x=x,y=ground_y+1,z=z},{name="glowtest:yellow_crystal_1"})
elseif nodename == "default:dirt_with_grass" and junnear == nil and defnear == nil and math.random(RAREPLANT) == 5 then
minetest.add_node({x=x,y=ground_y+1,z=z},{name="glowtest:pink_crystal_1"})
end
end
end
end
end
end
end
end)
end

View File

@ -0,0 +1,94 @@
glowtest:register_mob("glowtest:spider", {
type = "monster",
hp_min = 20,
hp_max = 40,
collisionbox = {-0.9, -0.01, -0.7, 0.7, 0.6, 0.7},
textures = {"glowtest_spider.png"},
visual_size = {x=7,y=7},
visual = "mesh",
mesh = "spider_model.x",
makes_footstep_sound = true,
view_range = 15,
walk_velocity = 1,
run_velocity = 3,
armor = 200,
damage = 3,
drops = {
{name = "farming:string",
chance = 100,
min = 3,
max = 6,},
},
light_resistant = false,
drawtype = "front",
water_damage = 5,
lava_damage = 5,
light_damage = 0,
on_rightclick = nil,
attack_type = "dogfight",
animation = {
speed_normal = 15,
speed_run = 15,
stand_start = 1,
stand_end = 1,
walk_start = 20,
walk_end = 40,
run_start = 20,
run_end = 40,
punch_start = 50,
punch_end = 90,
},
jump = true,
sounds = {},
step = 1,
})
glowtest:register_spawn("glowtest:spider", {"glowtest:stonetree"}, 20, -10, 100, 3, 31000)
glowtest:register_mob("glowtest:ent", {
type = "npc",
hp_min = 50,
hp_max = 70,
collisionbox = {-1.8, -0.02, -1.4, 1.4, 5.2, 1.4},
textures = {"glowtest_ent.png"},
visual_size = {x=3.5,y=3.5},
visual = "mesh",
mesh = "ent_model.x",
view_range = 20,
makes_footstep_sound = true,
walk_velocity = 1,
run_velocity = 1,
armor = 100,
damage = 5,
drops = {
{name = "default:tree",
chance = 10,
min = 5,
max = 10,},
},
light_resistant = true,
drawtype = "front",
water_damage = 0,
lava_damage = 60,
light_damage = 0,
attack_type = "dogfight",
animation = {
speed_normal = 15,
speed_run = 15,
stand_start = 17,
stand_end = 17,
walk_start = 10,
walk_end = 80,
run_start = 10,
run_end = 80,
punch_start = 10,
punch_end = 80,
},
jump = true,
sounds = {},
attacks_monsters = true,
peaceful = true,
group_attack = true,
step = 1,
})
glowtest:register_spawn("glowtest:ent", {"glowtest:tree"}, 20, -1, 200, 3, 31000)

View File

@ -0,0 +1,780 @@
glowtest = {}
function glowtest:register_mob(name, def)
minetest.register_entity(name, {
name = name,
hp_min = def.hp_min,
hp_max = def.hp_max,
physical = true,
collisionbox = def.collisionbox,
visual = def.visual,
visual_size = def.visual_size,
mesh = def.mesh,
textures = def.textures,
makes_footstep_sound = def.makes_footstep_sound,
view_range = def.view_range,
walk_velocity = def.walk_velocity,
run_velocity = def.run_velocity,
damage = def.damage,
light_damage = def.light_damage,
water_damage = def.water_damage,
lava_damage = def.lava_damage,
disable_fall_damage = def.disable_fall_damage,
drops = def.drops,
armor = def.armor,
drawtype = def.drawtype,
on_rightclick = def.on_rightclick,
type = def.type,
attack_type = def.attack_type,
arrow = def.arrow,
shoot_interval = def.shoot_interval,
sounds = def.sounds,
animation = def.animation,
follow = def.follow,
jump = def.jump or true,
exp_min = def.exp_min or 0,
exp_max = def.exp_max or 0,
walk_chance = def.walk_chance or 50,
attacks_monsters = def.attacks_monsters or false,
group_attack = def.group_attack or false,
step = def.step or 0,
fov = def.fov or 120,
passive = def.passive or false,
stimer = 0,
timer = 0,
env_damage_timer = 0, -- only if state = "attack"
attack = {player=nil, dist=nil},
state = "stand",
v_start = false,
old_y = nil,
lifetimer = 600,
tamed = false,
do_attack = function(self, player, dist)
if self.state ~= "attack" then
if self.sounds.war_cry then
if math.random(0,100) < 90 then
minetest.sound_play(self.sounds.war_cry,{ object = self.object })
end
end
self.state = "attack"
self.attack.player = player
self.attack.dist = dist
end
end,
set_velocity = function(self, v)
local yaw = self.object:getyaw()
if self.drawtype == "side" then
yaw = yaw+(math.pi/2)
end
local x = math.sin(yaw) * -v
local z = math.cos(yaw) * v
self.object:setvelocity({x=x, y=self.object:getvelocity().y, z=z})
end,
get_velocity = function(self)
local v = self.object:getvelocity()
return (v.x^2 + v.z^2)^(0.5)
end,
in_fov = function(self,pos)
-- checks if POS is in self's FOV
local yaw = self.object:getyaw()
if self.drawtype == "side" then
yaw = yaw+(math.pi/2)
end
local vx = math.sin(yaw)
local vz = math.cos(yaw)
local ds = math.sqrt(vx^2 + vz^2)
local ps = math.sqrt(pos.x^2 + pos.z^2)
local d = { x = vx / ds, z = vz / ds }
local p = { x = pos.x / ps, z = pos.z / ps }
local an = ( d.x * p.x ) + ( d.z * p.z )
a = math.deg( math.acos( an ) )
if a > ( self.fov / 2 ) then
return false
else
return true
end
end,
set_animation = function(self, type)
if not self.animation then
return
end
if not self.animation.current then
self.animation.current = ""
end
if type == "stand" and self.animation.current ~= "stand" then
if
self.animation.stand_start
and self.animation.stand_end
and self.animation.speed_normal
then
self.object:set_animation(
{x=self.animation.stand_start,y=self.animation.stand_end},
self.animation.speed_normal, 0
)
self.animation.current = "stand"
end
elseif type == "walk" and self.animation.current ~= "walk" then
if
self.animation.walk_start
and self.animation.walk_end
and self.animation.speed_normal
then
self.object:set_animation(
{x=self.animation.walk_start,y=self.animation.walk_end},
self.animation.speed_normal, 0
)
self.animation.current = "walk"
end
elseif type == "run" and self.animation.current ~= "run" then
if
self.animation.run_start
and self.animation.run_end
and self.animation.speed_run
then
self.object:set_animation(
{x=self.animation.run_start,y=self.animation.run_end},
self.animation.speed_run, 0
)
self.animation.current = "run"
end
elseif type == "punch" and self.animation.current ~= "punch" then
if
self.animation.punch_start
and self.animation.punch_end
and self.animation.speed_normal
then
self.object:set_animation(
{x=self.animation.punch_start,y=self.animation.punch_end},
self.animation.speed_normal, 0
)
self.animation.current = "punch"
end
end
end,
on_step = function(self, dtime)
if self.type == "monster" and minetest.setting_getbool("only_peaceful_lottmobs") then
self.object:remove()
end
self.lifetimer = self.lifetimer - dtime
if self.lifetimer <= 0 and not self.tamed and self.type ~= "npc" then
local player_count = 0
for _,obj in ipairs(minetest.get_objects_inside_radius(self.object:getpos(), 10)) do
if obj:is_player() then
player_count = player_count+1
end
end
if player_count == 0 and self.state ~= "attack" then
minetest.log("action","lifetimer expired, removed mob "..self.name)
self.object:remove()
return
end
end
if self.object:getvelocity().y > 0.1 then
local yaw = self.object:getyaw()
if self.drawtype == "side" then
yaw = yaw+(math.pi/2)
end
local x = math.sin(yaw) * -2
local z = math.cos(yaw) * 2
self.object:setacceleration({x=x, y=-10, z=z})
else
self.object:setacceleration({x=0, y=-10, z=0})
end
if self.disable_fall_damage and self.object:getvelocity().y == 0 then
if not self.old_y then
self.old_y = self.object:getpos().y
else
local d = self.old_y - self.object:getpos().y
if d > 5 then
local damage = d-5
self.object:set_hp(self.object:get_hp()-damage)
if self.object:get_hp() == 0 then
self.object:remove()
end
end
self.old_y = self.object:getpos().y
end
end
self.timer = self.timer+dtime
if self.state ~= "attack" then
if self.timer < 1 then
return
end
self.timer = 0
end
if self.sounds and self.sounds.random and math.random(1, 100) <= 1 then
minetest.sound_play(self.sounds.random, {object = self.object})
end
local do_env_damage = function(self)
local pos = self.object:getpos()
local n = minetest.get_node(pos)
if self.light_damage and self.light_damage ~= 0
and pos.y>0
and minetest.get_node_light(pos)
and minetest.get_node_light(pos) > 4
and minetest.get_timeofday() > 0.2
and minetest.get_timeofday() < 0.8
then
self.object:set_hp(self.object:get_hp()-self.light_damage)
if self.object:get_hp() == 0 then
self.object:remove()
end
end
if self.water_damage and self.water_damage ~= 0 and
minetest.get_item_group(n.name, "water") ~= 0
then
self.object:set_hp(self.object:get_hp()-self.water_damage)
if self.object:get_hp() == 0 then
self.object:remove()
end
end
if self.lava_damage and self.lava_damage ~= 0 and
minetest.get_item_group(n.name, "lava") ~= 0
then
self.object:set_hp(self.object:get_hp()-self.lava_damage)
if self.object:get_hp() == 0 then
self.object:remove()
end
end
end
self.env_damage_timer = self.env_damage_timer + dtime
if self.state == "attack" and self.env_damage_timer > 1 then
self.env_damage_timer = 0
do_env_damage(self)
elseif self.state ~= "attack" then
do_env_damage(self)
end
-- FIND SOMEONE TO ATTACK
if ( self.type == "monster" or self.type == "barbarian" ) and minetest.setting_getbool("enable_damage") and self.state ~= "attack" then
local s = self.object:getpos()
local inradius = minetest.get_objects_inside_radius(s,self.view_range)
local player = nil
local type = nil
for _,oir in ipairs(inradius) do
if oir:is_player() then
player = oir
type = "player"
else
local obj = oir:get_luaentity()
if obj then
player = obj.object
type = obj.type
end
end
if type == "player" or type == "npc" then
local s = self.object:getpos()
local p = player:getpos()
local sp = s
p.y = p.y + 1
sp.y = sp.y + 1 -- aim higher to make looking up hills more realistic
local dist = ((p.x-s.x)^2 + (p.y-s.y)^2 + (p.z-s.z)^2)^0.5
if dist < self.view_range and self.in_fov(self,p) then
if minetest.line_of_sight(sp,p,2) == true then
self.do_attack(self,player,dist)
break
end
end
end
end
end
-- NPC FIND A MONSTER TO ATTACK
if self.type == "npc" and self.attacks_monsters and self.state ~= "attack" then
local s = self.object:getpos()
local inradius = minetest.get_objects_inside_radius(s,self.view_range)
for _, oir in pairs(inradius) do
local obj = oir:get_luaentity()
if obj then
if obj.type == "monster" or obj.type == "barbarian" then
-- attack monster
local p = obj.object:getpos()
local dist = ((p.x-s.x)^2 + (p.y-s.y)^2 + (p.z-s.z)^2)^0.5
print("attack monster at "..minetest.pos_to_string(obj.object:getpos()))
self.do_attack(self,obj.object,dist)
break
end
end
end
end
if self.follow ~= "" and not self.following then
for _,player in pairs(minetest.get_connected_players()) do
local s = self.object:getpos()
local p = player:getpos()
local dist = ((p.x-s.x)^2 + (p.y-s.y)^2 + (p.z-s.z)^2)^0.5
if self.view_range and dist < self.view_range then
self.following = player
break
end
end
end
if self.following and self.following:is_player() then
if self.following:get_wielded_item():get_name() ~= self.follow then
self.following = nil
else
local s = self.object:getpos()
local p = self.following:getpos()
local dist = ((p.x-s.x)^2 + (p.y-s.y)^2 + (p.z-s.z)^2)^0.5
if dist > self.view_range then
self.following = nil
self.v_start = false
else
local vec = {x=p.x-s.x, y=p.y-s.y, z=p.z-s.z}
local yaw = math.atan(vec.z/vec.x)+math.pi/2
if self.drawtype == "side" then
yaw = yaw+(math.pi/2)
end
if p.x > s.x then
yaw = yaw+math.pi
end
self.object:setyaw(yaw)
if dist > 2 then
if not self.v_start then
self.v_start = true
self.set_velocity(self, self.walk_velocity)
else
if self.jump and self.get_velocity(self) <= 1.5 and self.object:getvelocity().y == 0 then
local v = self.object:getvelocity()
v.y = 6
self.object:setvelocity(v)
end
self.set_velocity(self, self.walk_velocity)
end
self:set_animation("walk")
else
self.v_start = false
self.set_velocity(self, 0)
self:set_animation("stand")
end
return
end
end
end
if self.state == "stand" then
-- randomly turn
if math.random(1, 4) == 1 then
-- if there is a player nearby look at them
local lp = nil
local s = self.object:getpos()
if self.type == "npc" then
local o = minetest.get_objects_inside_radius(self.object:getpos(), 3)
local yaw = 0
for _,o in ipairs(o) do
if o:is_player() then
lp = o:getpos()
break
end
end
end
if lp ~= nil then
local vec = {x=lp.x-s.x, y=lp.y-s.y, z=lp.z-s.z}
yaw = math.atan(vec.z/vec.x)+math.pi/2
if self.drawtype == "side" then
yaw = yaw+(math.pi/2)
end
if lp.x > s.x then
yaw = yaw+math.pi
end
else
yaw = self.object:getyaw()+((math.random(0,360)-180)/180*math.pi)
end
self.object:setyaw(yaw)
end
self.set_velocity(self, 0)
self.set_animation(self, "stand")
if math.random(1, 100) <= self.walk_chance then
self.set_velocity(self, self.walk_velocity)
self.state = "walk"
self.set_animation(self, "walk")
end
elseif self.state == "walk" then
if math.random(1, 100) <= 30 then
self.object:setyaw(self.object:getyaw()+((math.random(0,360)-180)/180*math.pi))
end
if self.jump and self.get_velocity(self) <= 0.5 and self.object:getvelocity().y == 0 then
local v = self.object:getvelocity()
v.y = 5
self.object:setvelocity(v)
end
self:set_animation("walk")
self.set_velocity(self, self.walk_velocity)
if math.random(1, 100) <= 30 then
self.set_velocity(self, 0)
self.state = "stand"
self:set_animation("stand")
end
elseif self.state == "attack" and self.attack_type == "dogfight" then
if not self.attack.player or not self.attack.player:getpos() then
print("stop attacking")
self.state = "stand"
self:set_animation("stand")
return
end
local s = self.object:getpos()
local p = self.attack.player:getpos()
local dist = ((p.x-s.x)^2 + (p.y-s.y)^2 + (p.z-s.z)^2)^0.5
if dist > self.view_range or self.attack.player:get_hp() <= 0 then
self.state = "stand"
self.v_start = false
self.set_velocity(self, 0)
self.attack = {player=nil, dist=nil}
self:set_animation("stand")
return
else
self.attack.dist = dist
end
local vec = {x=p.x-s.x, y=p.y-s.y, z=p.z-s.z}
local yaw = math.atan(vec.z/vec.x)+math.pi/2
if self.drawtype == "side" then
yaw = yaw+(math.pi/2)
end
if p.x > s.x then
yaw = yaw+math.pi
end
self.object:setyaw(yaw)
if self.attack.dist > 2 then
if not self.v_start then
self.v_start = true
self.set_velocity(self, self.run_velocity)
else
if self.jump and self.get_velocity(self) <= 0.5 and self.object:getvelocity().y == 0 then
local v = self.object:getvelocity()
v.y = 5
self.object:setvelocity(v)
end
self.set_velocity(self, self.run_velocity)
end
self:set_animation("run")
else
self.set_velocity(self, 0)
self:set_animation("punch")
self.v_start = false
if self.timer > 1 then
self.timer = 0
local p2 = p
local s2 = s
p2.y = p2.y + 1.5
s2.y = s2.y + 1.5
if minetest.line_of_sight(p2,s2) == true then
if self.sounds and self.sounds.attack then
minetest.sound_play(self.sounds.attack, {object = self.object})
end
self.attack.player:punch(self.object, 1.0, {
full_punch_interval=1.0,
damage_groups = {fleshy=self.damage}
}, vec)
if math.random(0,3) == 3 and self.attack.player:is_player() then
local snum = math.random(1,4)
minetest.sound_play("default_hurt"..tostring(snum),{
object = self.attack.player,
})
end
if self.attack.player:get_hp() <= 0 then
self.state = "stand"
self:set_animation("stand")
end
end
end
end
elseif self.state == "attack" and self.attack_type == "shoot" then
if not self.attack.player or not self.attack.player:is_player() then
self.state = "stand"
self:set_animation("stand")
return
end
local s = self.object:getpos()
local p = self.attack.player:getpos()
p.y = p.y - .5
s.y = s.y + .5
local dist = ((p.x-s.x)^2 + (p.y-s.y)^2 + (p.z-s.z)^2)^0.5
if dist > self.view_range or self.attack.player:get_hp() <= 0 then
self.state = "stand"
self.v_start = false
self.set_velocity(self, 0)
if self.type ~= "npc" then
self.attack = {player=nil, dist=nil}
end
self:set_animation("stand")
return
else
self.attack.dist = dist
end
local vec = {x=p.x-s.x, y=p.y-s.y, z=p.z-s.z}
local yaw = math.atan(vec.z/vec.x)+math.pi/2
if self.drawtype == "side" then
yaw = yaw+(math.pi/2)
end
if p.x > s.x then
yaw = yaw+math.pi
end
self.object:setyaw(yaw)
self.set_velocity(self, 0)
if self.timer > self.shoot_interval and math.random(1, 100) <= 60 then
self.timer = 0
self:set_animation("punch")
if self.sounds and self.sounds.attack then
minetest.sound_play(self.sounds.attack, {object = self.object})
end
local p = self.object:getpos()
p.y = p.y + (self.collisionbox[2]+self.collisionbox[5])/2
local obj = minetest.add_entity(p, self.arrow)
local amount = (vec.x^2+vec.y^2+vec.z^2)^0.5
local v = obj:get_luaentity().velocity
vec.y = vec.y+1
vec.x = vec.x*v/amount
vec.y = vec.y*v/amount
vec.z = vec.z*v/amount
obj:setvelocity(vec)
end
end
end,
on_activate = function(self, staticdata, dtime_s)
-- reset HP
local pos = self.object:getpos()
local distance_rating = ( ( get_distance({x=0,y=0,z=0},pos) ) / 20000 )
local newHP = self.hp_min + math.floor( self.hp_max * distance_rating )
self.object:set_hp( newHP )
self.object:set_armor_groups({fleshy=self.armor})
self.object:setacceleration({x=0, y=-10, z=0})
self.state = "stand"
self.object:setvelocity({x=0, y=self.object:getvelocity().y, z=0})
self.object:setyaw(math.random(1, 360)/180*math.pi)
if self.type == "monster" and minetest.setting_getbool("only_peaceful_lottmobs") then
self.object:remove()
end
if self.type ~= "npc" then
self.lifetimer = 600 - dtime_s
end
if staticdata then
local tmp = minetest.deserialize(staticdata)
if tmp and tmp.lifetimer then
self.lifetimer = tmp.lifetimer - dtime_s
end
if tmp and tmp.tamed then
self.tamed = tmp.tamed
end
--[[if tmp and tmp.textures then
self.object:set_properties(tmp.textures)
end]]
end
if self.lifetimer <= 0 and not self.tamed and self.type ~= "npc" then
self.object:remove()
end
end,
get_staticdata = function(self)
local tmp = {
lifetimer = self.lifetimer,
tamed = self.tamed,
textures = { textures = self.textures },
}
return minetest.serialize(tmp)
end,
on_punch = function(self, hitter)
local weapon = hitter:get_wielded_item()
if weapon:get_definition().tool_capabilities ~= nil then
local wear = ( weapon:get_definition().tool_capabilities.full_punch_interval / 75 ) * 9000
weapon:add_wear(wear)
hitter:set_wielded_item(weapon)
end
if weapon:get_definition().sounds ~= nil then
local s = math.random(0,#weapon:get_definition().sounds)
minetest.sound_play(weapon:get_definition().sounds[s], {
object=hitter,
})
else
minetest.sound_play("default_sword_wood", {
object = hitter,
})
end
if self.object:get_hp() <= 0 then
if hitter and hitter:is_player() and hitter:get_inventory() then
for _,drop in ipairs(self.drops) do
if math.random(1, drop.chance) == 1 then
hitter:get_inventory():add_item("main", ItemStack(drop.name.." "..math.random(drop.min, drop.max)))
end
end
if self.sounds.death ~= nil then
minetest.sound_play(self.sounds.death,{
object = self.object,
})
end
if minetest.get_modpath("skills") and minetest.get_modpath("experience") then
-- DROP experience
local distance_rating = ( ( get_distance({x=0,y=0,z=0},pos) ) / ( skills.get_player_level(hitter:get_player_name()).level * 1000 ) )
local emax = math.floor( self.exp_min + ( distance_rating * self.exp_max ) )
local expGained = math.random(self.exp_min, emax)
skills.add_exp(hitter:get_player_name(),expGained)
local expStack = experience.exp_to_items(expGained)
for _,stack in ipairs(expStack) do
default.drop_item(pos,stack)
end
end
end
end
if self.passive == false then
self.do_attack(self,hitter,1)
-- alert other NPCs to the attack
local inradius = minetest.get_objects_inside_radius(hitter:getpos(),5)
for _, oir in pairs(inradius) do
local obj = oir:get_luaentity()
if obj then
if obj.group_attack == true and obj.state ~= "attack" then
obj.do_attack(obj,hitter,1)
end
end
end
end
end,
})
end
glowtest.spawning_lottmobs = {}
function glowtest:register_spawn(name, nodes, max_light, min_light, chance, active_object_count, max_height, spawn_func)
glowtest.spawning_lottmobs[name] = true
minetest.register_abm({
nodenames = nodes,
--neighbors = {"air"},
interval = 30,
chance = chance,
action = function(pos, node, _, active_object_count_wider)
if active_object_count_wider > active_object_count then
return
end
if not glowtest.spawning_lottmobs[name] then
return
end
--[[ don't spawn inside of blocks
local p2 = pos
p2.y = p2.y + 1
local p3 = p2
p3.y = p3.y + 1
if minetest.registered_nodes[minetest.get_node(p2).name].walkable == false or minetest.registered_nodes[minetest.get_node(p3).name].walkable == false then
return
end]]
pos.y = pos.y+1
if not minetest.get_node_light(pos) then
return
end
if minetest.get_node_light(pos) > max_light then
return
end
if minetest.get_node_light(pos) < min_light then
return
end
if pos.y > max_height then
return
end
if minetest.registered_nodes[minetest.get_node(pos).name].walkable == true or minetest.registered_nodes[minetest.get_node(pos).name].walkable == nil then
return
end
pos.y = pos.y+1
if minetest.registered_nodes[minetest.get_node(pos).name].walkable == true or minetest.registered_nodes[minetest.get_node(pos).name].walkable == nil then
return
end
if spawn_func and not spawn_func(pos, node) then
return
end
if minetest.setting_getbool("display_mob_spawn") then
minetest.chat_send_all("[glowtest] Add "..name.." at "..minetest.pos_to_string(pos))
end
local mob = minetest.add_entity(pos, name)
-- setup the hp, armor, drops, etc... for this specific mob
local distance_rating = ( ( get_distance({x=0,y=0,z=0},pos) ) / 15000 )
if mob then
mob = mob:get_luaentity()
local newHP = mob.hp_min + math.floor( mob.hp_max * distance_rating )
mob.object:set_hp( newHP )
end
end
})
end
function glowtest:register_arrow(name, def)
minetest.register_entity(name, {
physical = false,
visual = def.visual,
visual_size = def.visual_size,
textures = def.textures,
velocity = def.velocity,
hit_player = def.hit_player,
hit_node = def.hit_node,
on_step = function(self, dtime)
local pos = self.object:getpos()
if minetest.get_node(self.object:getpos()).name ~= "air" then
self.hit_node(self, pos, node)
self.object:remove()
return
end
pos.y = pos.y-1
for _,player in pairs(minetest.get_objects_inside_radius(pos, 1)) do
if player:is_player() then
self.hit_player(self, player)
self.object:remove()
return
end
end
end
})
end
function get_distance(pos1,pos2)
if ( pos1 ~= nil and pos2 ~= nil ) then
return math.abs(math.floor(math.sqrt( (pos1.x - pos2.x)^2 + (pos1.z - pos2.z)^2 )))
else
return 0
end
end

499
glowtest/glowtest/nodes.lua Normal file
View File

@ -0,0 +1,499 @@
minetest.register_node("glowtest:tree", {
description = "Glowing Tree",
tiles = {"default_tree_top.png", "default_tree_top.png", "default_tree.png"},
paramtype2 = "facedir",
light_source = 8,
groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
sounds = default.node_sound_wood_defaults(),
drop = "default:tree",
on_place = minetest.rotate_node
})
minetest.register_node("glowtest:stonetree", {
description = "Glowing Stone Tree",
tiles = {"glowtest_cursed_tree.png", "glowtest_cursed_tree.png", "glowtest_cursed_tree_top.png"},
paramtype2 = "facedir",
light_source = 8,
groups = {tree=1,cracky=3},
sounds = default.node_sound_wood_defaults(),
drop = {
max_items = 1,
items = {
{ items = {'default:lava_source'}, rarity = 100},
{ items = {'default:tree'} }
}
},
on_place = minetest.rotate_node
})
minetest.register_node("glowtest:blueleaf", {
description = "Glowing Blue Leaf",
drawtype = "allfaces_optional",
visual_scale = 1.3,
tiles = {"glowtest_blueleaf.png"},
paramtype = "light",
light_source = 8,
groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
alpha = 200,
sunlight_propagates = true,
drop = {
max_items = 1,
items = {
{ items = {'glowtest:sbluesapling'}, rarity = 20},
{ items = {'glowtest:mbluesapling'}, rarity = 40},
{ items = {'glowtest:lbluesapling'}, rarity = 60},
{ items = {'glowtest:blueleaf'} }
}
},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("glowtest:redleaf", {
description = "Glowing Blood Leaf",
drawtype = "allfaces_optional",
visual_scale = 1.3,
tiles = {"glowtest_redleaf.png"},
paramtype = "light",
light_source = 8,
alpha = 200,
sunlight_propagates = true,
groups = {snappy=3, leafdecay=3, leaves=1},
drop = {
max_items = 1,
items = {
{ items = {'glowtest:sredsapling'}, rarity = 20},
{ items = {'glowtest:mredsapling'}, rarity = 40},
{ items = {'glowtest:lredsapling'}, rarity = 60},
{ items = {'glowtest:redleaf'} }
}
},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("glowtest:blackleaf", {
description = "Glowing Cursed Leaf",
drawtype = "allfaces_optional",
visual_scale = 1.3,
tiles = {"glowtest_blackleaf.png"},
paramtype = "light",
light_source = 8,
alpha = 200,
sunlight_propagates = true,
groups = {snappy=3, leafdecay=3, leaves=1},
drop = {
max_items = 1,
items = {
{ items = {'glowtest:sblacksapling'}, rarity = 20},
{ items = {'glowtest:mblacksapling'}, rarity = 40},
{ items = {'glowtest:lblacksapling'}, rarity = 60},
{ items = {'glowtest:blackleaf'} }
}
},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("glowtest:pinkleaf", {
description = "Glowing Pink Leaf",
drawtype = "allfaces_optional",
visual_scale = 1.3,
tiles = {"glowtest_pinkleaf.png"},
paramtype = "light",
light_source = 8,
alpha = 200,
sunlight_propagates = true,
groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
drop = {
max_items = 1,
items = {
{ items = {'glowtest:spinksapling'}, rarity = 20},
{ items = {'glowtest:mpinksapling'}, rarity = 40},
{ items = {'glowtest:lpinksapling'}, rarity = 60},
{ items = {'glowtest:pinkleaf'} }
}
},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("glowtest:yellowleaf", {
description = "Glowing Yellow Leaf",
drawtype = "allfaces_optional",
visual_scale = 1.3,
tiles = {"glowtest_yellowleaf.png"},
paramtype = "light",
light_source = 8,
alpha = 200,
sunlight_propagates = true,
groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
drop = {
max_items = 1,
items = {
{ items = {'glowtest:syellowsapling'}, rarity = 20},
{ items = {'glowtest:myellowsapling'}, rarity = 40},
{ items = {'glowtest:lyellowsapling'}, rarity = 60},
{ items = {'glowtest:yellowleaf'} }
}
},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("glowtest:greenleaf", {
description = "Glowing Green Leaf",
drawtype = "allfaces_optional",
visual_scale = 1.3,
tiles = {"glowtest_greenleaf.png"},
paramtype = "light",
light_source = 8,
alpha = 200,
sunlight_propagates = true,
groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
drop = {
max_items = 1,
items = {
{ items = {'glowtest:sgreensapling'}, rarity = 20},
{ items = {'glowtest:mgreensapling'}, rarity = 40},
{ items = {'glowtest:lgreensapling'}, rarity = 60},
{ items = {'glowtest:greenleaf'} }
}
},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("glowtest:whiteleaf", {
description = "Glowing White Leaf",
drawtype = "allfaces_optional",
visual_scale = 1.3,
tiles = {"glowtest_whiteleaf.png"},
paramtype = "light",
light_source = 8,
alpha = 200,
sunlight_propagates = true,
groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
drop = {
max_items = 1,
items = {
{ items = {'glowtest:swhitesapling'}, rarity = 20},
{ items = {'glowtest:mwhitesapling'}, rarity = 40},
{ items = {'glowtest:lwhitesapling'}, rarity = 60},
{ items = {'glowtest:whiteleaf'} }
}
},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("glowtest:sgreensapling", {
description = "Small Green Sapling",
drawtype = "plantlike",
visual_scale = 0.7,
tiles = {"glowtest_greensapling.png"},
inventory_image = "glowtest_greensapling.png",
wield_image = "glowtest_greensapling.png",
paramtype = "light",
walkable = false,
light_source = 8,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
selection_box = {
type = "fixed",
fixed = { -0.15, -0.5, -0.15, 0.15, 0.2, 0.15 },
},
})
minetest.register_node("glowtest:mgreensapling", {
description = "Medium Green Sapling",
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"glowtest_greensapling.png"},
inventory_image = "glowtest_greensapling.png",
wield_image = "glowtest_greensapling.png",
paramtype = "light",
walkable = false,
light_source = 8,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("glowtest:lgreensapling", {
description = "Large Green Sapling",
drawtype = "plantlike",
visual_scale = 2.0,
tiles = {"glowtest_greensapling.png"},
inventory_image = "glowtest_greensapling.png",
wield_image = "glowtest_greensapling.png",
paramtype = "light",
walkable = false,
light_source = 8,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("glowtest:sbluesapling", {
description = "Small Blue Sapling",
drawtype = "plantlike",
visual_scale = 0.7,
tiles = {"glowtest_bluesapling.png"},
inventory_image = "glowtest_bluesapling.png",
wield_image = "glowtest_bluesapling.png",
paramtype = "light",
walkable = false,
light_source = 8,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
selection_box = {
type = "fixed",
fixed = { -0.15, -0.5, -0.15, 0.15, 0.2, 0.15 },
},
})
minetest.register_node("glowtest:mbluesapling", {
description = "Medium Blue Sapling",
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"glowtest_bluesapling.png"},
inventory_image = "glowtest_bluesapling.png",
wield_image = "glowtest_bluesapling.png",
paramtype = "light",
walkable = false,
light_source = 8,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("glowtest:lbluesapling", {
description = "Large Blue Sapling",
drawtype = "plantlike",
visual_scale = 2.0,
tiles = {"glowtest_bluesapling.png"},
inventory_image = "glowtest_bluesapling.png",
wield_image = "glowtest_bluesapling.png",
paramtype = "light",
walkable = false,
light_source = 8,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("glowtest:spinksapling", {
description = "Small Pink Sapling",
drawtype = "plantlike",
visual_scale = 0.7,
tiles = {"glowtest_pinksapling.png"},
inventory_image = "glowtest_pinksapling.png",
wield_image = "glowtest_pinksapling.png",
paramtype = "light",
walkable = false,
light_source = 8,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
selection_box = {
type = "fixed",
fixed = { -0.15, -0.5, -0.15, 0.15, 0.2, 0.15 },
},
})
minetest.register_node("glowtest:mpinksapling", {
description = "Medium Pink Sapling",
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"glowtest_pinksapling.png"},
inventory_image = "glowtest_pinksapling.png",
wield_image = "glowtest_pinksapling.png",
paramtype = "light",
walkable = false,
light_source = 8,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("glowtest:lpinksapling", {
description = "Large Pink Sapling",
drawtype = "plantlike",
visual_scale = 2.0,
tiles = {"glowtest_pinksapling.png"},
inventory_image = "glowtest_pinksapling.png",
wield_image = "glowtest_pinksapling.png",
paramtype = "light",
walkable = false,
light_source = 8,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("glowtest:syellowsapling", {
description = "Small Yellow Sapling",
drawtype = "plantlike",
visual_scale = 0.7,
tiles = {"glowtest_yellowsapling.png"},
inventory_image = "glowtest_yellowsapling.png",
wield_image = "glowtest_yellowsapling.png",
paramtype = "light",
walkable = false,
light_source = 8,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
selection_box = {
type = "fixed",
fixed = { -0.15, -0.5, -0.15, 0.15, 0.2, 0.15 },
},
})
minetest.register_node("glowtest:myellowsapling", {
description = "Medium Yellow Sapling",
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"glowtest_yellowsapling.png"},
inventory_image = "glowtest_yellowsapling.png",
wield_image = "glowtest_yellowsapling.png",
paramtype = "light",
walkable = false,
light_source = 8,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("glowtest:lyellowsapling", {
description = "Large Yellow Sapling",
drawtype = "plantlike",
visual_scale = 2.0,
tiles = {"glowtest_yellowsapling.png"},
inventory_image = "glowtest_yellowsapling.png",
wield_image = "glowtest_yellowsapling.png",
paramtype = "light",
walkable = false,
light_source = 8,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("glowtest:sredsapling", {
description = "Small Blood Sapling",
drawtype = "plantlike",
visual_scale = 0.7,
tiles = {"glowtest_redsapling.png"},
inventory_image = "glowtest_redsapling.png",
wield_image = "glowtest_redsapling.png",
paramtype = "light",
walkable = false,
light_source = 8,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
selection_box = {
type = "fixed",
fixed = { -0.15, -0.5, -0.15, 0.15, 0.2, 0.15 },
},
})
minetest.register_node("glowtest:mredsapling", {
description = "Medium Blood Sapling",
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"glowtest_redsapling.png"},
inventory_image = "glowtest_redsapling.png",
wield_image = "glowtest_redsapling.png",
paramtype = "light",
walkable = false,
light_source = 8,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("glowtest:lredsapling", {
description = "Large Blood Sapling",
drawtype = "plantlike",
visual_scale = 2.0,
tiles = {"glowtest_redsapling.png"},
inventory_image = "glowtest_redsapling.png",
wield_image = "glowtest_redsapling.png",
paramtype = "light",
walkable = false,
light_source = 8,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("glowtest:swhitesapling", {
description = "Small White Sapling",
drawtype = "plantlike",
visual_scale = 0.7,
tiles = {"glowtest_whitesapling.png"},
inventory_image = "glowtest_whitesapling.png",
wield_image = "glowtest_whitesapling.png",
paramtype = "light",
walkable = false,
light_source = 8,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
selection_box = {
type = "fixed",
fixed = { -0.15, -0.5, -0.15, 0.15, 0.2, 0.15 },
},
})
minetest.register_node("glowtest:mwhitesapling", {
description = "Medium White Sapling",
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"glowtest_whitesapling.png"},
inventory_image = "glowtest_whitesapling.png",
wield_image = "glowtest_whitesapling.png",
paramtype = "light",
walkable = false,
light_source = 8,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("glowtest:lwhitesapling", {
description = "Large White Sapling",
drawtype = "plantlike",
visual_scale = 2.0,
tiles = {"glowtest_whitesapling.png"},
inventory_image = "glowtest_whitesapling.png",
wield_image = "glowtest_whitesapling.png",
paramtype = "light",
walkable = false,
light_source = 8,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("glowtest:sblacksapling", {
description = "Small Cursed Sapling",
drawtype = "plantlike",
visual_scale = 0.7,
tiles = {"glowtest_blacksapling.png"},
inventory_image = "glowtest_blacksapling.png",
wield_image = "glowtest_blacksapling.png",
paramtype = "light",
walkable = false,
light_source = 8,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("glowtest:mblacksapling", {
description = "Medium Cursed Sapling",
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"glowtest_blacksapling.png"},
inventory_image = "glowtest_blacksapling.png",
wield_image = "glowtest_blacksapling.png",
paramtype = "light",
walkable = false,
light_source = 8,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("glowtest:lblacksapling", {
description = "Large Cursed Sapling",
drawtype = "plantlike",
visual_scale = 2.0,
tiles = {"glowtest_blacksapling.png"},
inventory_image = "glowtest_blacksapling.png",
wield_image = "glowtest_blacksapling.png",
paramtype = "light",
walkable = false,
light_source = 8,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})

189
glowtest/glowtest/runes.lua Normal file
View File

@ -0,0 +1,189 @@
--\ Runes \
minetest.register_node("glowtest:rune_1", {
description = "Wyvern Rune",
tiles = {"default_stone.png^glowtest_rune_1.png"},
is_ground_content = true,
light_source = 14,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("glowtest:rune_1_off", {
tiles = {"default_stone.png^glowtest_rune_1_off.png"},
is_ground_content = true,
groups = {cracky=3,not_in_creative_inventory=1},
drop = "glowtest:rune_1",
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("glowtest:rune_2", {
description = "Eye Rune",
tiles = {"default_stone.png^glowtest_rune_2.png"},
is_ground_content = true,
light_source = 14,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("glowtest:rune_2_off", {
tiles = {"default_stone.png^glowtest_rune_2_off.png"},
is_ground_content = true,
groups = {cracky=3,not_in_creative_inventory=1},
drop = "glowtest:rune_2",
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("glowtest:rune_1_cursed", {
description = "Cursed Wyvern Rune",
tiles = {"default_stone.png^glowtest_rune_1_cursed.png"},
is_ground_content = true,
light_source = 14,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("glowtest:rune_1_cursed_off", {
tiles = {"default_stone.png^glowtest_rune_1_off.png"},
is_ground_content = true,
groups = {cracky=3,not_in_creative_inventory=1},
drop = "glowtest:rune_1_cursed",
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("glowtest:rune_2_cursed", {
description = "Cursed Eye Rune",
tiles = {"default_stone.png^glowtest_rune_2_cursed.png"},
is_ground_content = true,
light_source = 14,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("glowtest:rune_2_cursed_off", {
tiles = {"default_stone.png^glowtest_rune_2_off.png"},
is_ground_content = true,
groups = {cracky=3,not_in_creative_inventory=1},
drop = "glowtest:rune_2_cursed",
sounds = default.node_sound_stone_defaults(),
})
minetest.register_abm(
{nodenames = {"glowtest:rune_1","glowtest:rune_2"},
interval = 1.0,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
local objs = minetest.env:get_objects_inside_radius(pos, 3)
for k, obj in pairs(objs) do
obj:set_hp(obj:get_hp()+2)
end
end,
})
minetest.register_abm(
{nodenames = {"glowtest:rune_1_cursed","glowtest:rune_2_cursed"},
interval = 1.0,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
local objs = minetest.env:get_objects_inside_radius(pos, 3)
for k, obj in pairs(objs) do
obj:set_hp(obj:get_hp()-2)
end
end,
})
minetest.register_abm(
{nodenames = {"glowtest:rune_1_cursed"},
interval = 1,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
if minetest.env:get_timeofday() > 0.2 and minetest.env:get_timeofday() < 0.8
then
minetest.env:set_node(pos, {name="glowtest:rune_1_cursed_off"})
end
end,
})
minetest.register_abm(
{nodenames = {"glowtest:rune_1_cursed_off"},
interval = 1,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
if minetest.env:get_timeofday() < 0.2 or minetest.env:get_timeofday() > 0.8
then
minetest.env:set_node(pos, {name="glowtest:rune_1_cursed"})
end
end,
})
minetest.register_abm(
{nodenames = {"glowtest:rune_2_cursed"},
interval = 1,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
if minetest.env:get_timeofday() > 0.2 and minetest.env:get_timeofday() < 0.8
then
minetest.env:set_node(pos, {name="glowtest:rune_2_cursed_off"})
end
end,
})
minetest.register_abm(
{nodenames = {"glowtest:rune_2_cursed_off"},
interval = 1,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
if minetest.env:get_timeofday() < 0.2 or minetest.env:get_timeofday() > 0.8
then
minetest.env:set_node(pos, {name="glowtest:rune_2_cursed"})
end
end,
})
minetest.register_abm(
{nodenames = {"glowtest:rune_1_off"},
interval = 1,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
if minetest.env:get_timeofday() > 0.2 and minetest.env:get_timeofday() < 0.8
then
minetest.env:set_node(pos, {name="glowtest:rune_1"})
end
end,
})
minetest.register_abm(
{nodenames = {"glowtest:rune_1"},
interval = 1,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
if minetest.env:get_timeofday() < 0.2 or minetest.env:get_timeofday() > 0.8
then
minetest.env:set_node(pos, {name="glowtest:rune_1_off"})
end
end,
})
minetest.register_abm(
{nodenames = {"glowtest:rune_2_off"},
interval = 1,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
if minetest.env:get_timeofday() > 0.2 and minetest.env:get_timeofday() < 0.8
then
minetest.env:set_node(pos, {name="glowtest:rune_2"})
end
end,
})
minetest.register_abm(
{nodenames = {"glowtest:rune_2"},
interval = 1,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
if minetest.env:get_timeofday() < 0.2 or minetest.env:get_timeofday() > 0.8
then
minetest.env:set_node(pos, {name="glowtest:rune_2_off"})
end
end,
})

View File

@ -1,713 +1,3 @@
-- Jungletree mod by Bas080.
-- License WTFPL.
-- Forked by paramat.
-- Perlin Jungletrees Ongen 0.1.0.
-- License WTFPL as before, see license.txt file.
-- Deleted habitat mod.
-- Only find ground level in randomly chosen columns within biome.
-- Only check for grass away from trunks when altitude <= MAXALT.
-- Increased roots depth to 2 or 5 nodes.
-- Fixed bug "if height <= 0 then" line 131.
-- Jungletree function defined and spawn jungletrees on generated chunk.
-- Deleted laggy "find_node_near" functions with large radius that checked for water and sand, now only check trunk spacing.
-- Added debug messages option.
-- Added remove default trees option.
-- Perlin matched to snow biomes perlin(112, 3, 0.5, 150) to keep jungle away from snow biomes.
-- Noise range for more biome shapes.
-- Added abm to grow saplings into jungletrees.
-- ONGEN option.
-- Variables MINSPA and MAXSPA to control denstity at centre and edge.
-- More red and yellow leaves.
local MAXALT = 23 -- 23 -- Maximum altitude.
local MINSPA = 2 -- 2 -- Minimum spacing to other trunks or roots in deep jungle.
local MAXSPA = 11 -- 11 -- Average spacing to other trunks or roots at jungle edge.
local NORMPLANT = 16
-- Snowy perlin. Should match your snow biomes mod perlin.
local SEEDDIFF = 112 -- 112 -- World specific perlin seed = world seed + seeddiff.
local OCTAVES = 3 -- 3 -- Each higher octave adds variation on a scale half as big.
local PERSISTENCE = 0.5 -- 0.5 -- Relative amplitude of each higher octave.
local SCALE = 150 -- 150 -- Scale of largest pattern variation.
local NOISEH = -0.6 -- -0.6 ]
local NOISEL = -1.2 -- -1.2 ] Noise range for jungle biome. Negative values keep jungle away from snow biomes. Snow biomes when noise > 0.53.
local SAPLING_ABM_INTERVAL = 23 -- 23
local SAPLING_ABM_CHANCE = 13 -- 13
local ONGEN = true -- Spawn jungletrees on generated chunk? (true / false).
local REMOVE_TREES = true -- Remove default trees on generated chunk in jungle biomes?
local DEBUG = true
local colchamin = MINSPA ^ 2
local factor = (MAXSPA ^ 2 - colchamin) * 4
local nav = (NOISEH + NOISEL) / 2
local nra = NOISEH - NOISEL
if ONGEN then
minetest.register_on_generated(function(minp, maxp, seed)
-- If generated chunk is a surface chunk
if minp.y == -32 then
-- Define perlin noise, co-ords of min and max points, chunk dimensions.
local perlin = minetest.env:get_perlin(SEEDDIFF, OCTAVES, PERSISTENCE, SCALE)
local x0 = minp.x
local z0 = minp.z
local x1 = maxp.x
local z1 = maxp.z
local xl = x1 - x0
local zl = z1 - z0
-- Speed hack: checks 9 points in chunk for conifer biome.
if not (perlin:get2d({x=x0, y=z0}) > NOISEL and perlin:get2d({x=x0, y=z0}) < NOISEH)
and not (perlin:get2d({x=x0, y=z1}) > NOISEL and perlin:get2d({x=x0, y=z1}) < NOISEH)
and not (perlin:get2d({x=x1, y=z0}) > NOISEL and perlin:get2d({x=x1, y=z0}) < NOISEH)
and not (perlin:get2d({x=x1, y=z1}) > NOISEL and perlin:get2d({x=x1, y=z1}) < NOISEH)
and not (perlin:get2d({x=x0, y=z0+(zl/2)}) > NOISEL and perlin:get2d({x=x0, y=z0+(zl/2)}) < NOISEH)
and not (perlin:get2d({x=x1, y=z0+(zl/2)}) > NOISEL and perlin:get2d({x=x1, y=z0+(zl/2)}) < NOISEH)
and not (perlin:get2d({x=x0+(xl/2), y=z0}) > NOISEL and perlin:get2d({x=x0+(xl/2), y=z0}) < NOISEH)
and not (perlin:get2d({x=x0+(xl/2), y=z1}) > NOISEL and perlin:get2d({x=x0+(xl/2), y=z1}) < NOISEH)
and not (perlin:get2d({x=x0+(xl/2), y=z0+(zl/2)}) > NOISEL and perlin:get2d({x=x0+(xl/2), y=z0+(zl/2)}) < NOISEH) then
return
end
if REMOVE_TREES == true then
-- Remove default trees in chunk.
local trees = minetest.env:find_nodes_in_area(minp, maxp, {"default:leaves","default:tree","default:apple"})
for i,v in pairs(trees) do
minetest.env:remove_node(v)
end
if DEBUG then
print ("[jungletree] Trees removed ("..minp.x.." "..minp.y.." "..minp.z..")")
end
end
-- Loop through all columns in chunk, for each column do.
for i = 0, xl do
for j = 0, zl do
local x = x0 + i
local z = z0 + j
local noise = perlin:get2d({x = x, y = z})
if noise > NOISEL and noise < NOISEH then
-- Calculate column chance for varying tree density.
local colcha = colchamin + math.floor(factor * (math.abs(noise - nav) / nra) ^ 2)
if math.random(1,colcha) == 1 then
-- Find ground level y.
local ground_y = nil
for y=maxp.y,minp.y,-1 do
local nodename = minetest.env:get_node({x=x,y=y,z=z}).name
if nodename ~= "air" and nodename ~= "default:water_source" then
ground_y = y
break
end
end
-- Check if ground, check altitude
if ground_y and ground_y <= MAXALT then
-- Check for grass, check trunk spacing
local nodename = minetest.env:get_node({x=x,y=ground_y,z=z}).name
local junnear = minetest.env:find_node_near({x=x,y=ground_y,z=z}, MINSPA, "default:jungletree")
local defnear = minetest.env:find_node_near({x=x,y=ground_y,z=z}, MINSPA, "default:tree")
if nodename == "default:dirt_with_grass" and junnear == nil and defnear == nil and math.random(NORMPLANT) == 16 then
glowtest_sgreentree({x=x,y=ground_y+1,z=z})
elseif nodename == "default:dirt_with_grass" and junnear == nil and defnear == nil and math.random(NORMPLANT) == 2 then
glowtest_mgreentree({x=x,y=ground_y+1,z=z})
elseif nodename == "default:dirt_with_grass" and junnear == nil and defnear == nil and math.random(NORMPLANT) == 3 then
glowtest_lgreentree({x=x,y=ground_y+1,z=z})
elseif nodename == "default:dirt_with_grass" and junnear == nil and defnear == nil and math.random(NORMPLANT) == 4 then
glowtest_sbluetree({x=x,y=ground_y+1,z=z})
elseif nodename == "default:dirt_with_grass" and junnear == nil and defnear == nil and math.random(NORMPLANT) == 5 then
glowtest_mbluetree({x=x,y=ground_y+1,z=z})
elseif nodename == "default:dirt_with_grass" and junnear == nil and defnear == nil and math.random(NORMPLANT) == 6 then
glowtest_lbluetree({x=x,y=ground_y+1,z=z})
elseif nodename == "default:dirt_with_grass" and junnear == nil and defnear == nil and math.random(NORMPLANT) == 7 then
glowtest_spinktree({x=x,y=ground_y+1,z=z})
elseif nodename == "default:dirt_with_grass" and junnear == nil and defnear == nil and math.random(NORMPLANT) == 8 then
glowtest_mpinktree({x=x,y=ground_y+1,z=z})
elseif nodename == "default:dirt_with_grass" and junnear == nil and defnear == nil and math.random(NORMPLANT) == 9 then
glowtest_lpinktree({x=x,y=ground_y+1,z=z})
elseif nodename == "default:dirt_with_grass" and junnear == nil and defnear == nil and math.random(NORMPLANT) == 10 then
glowtest_syellowtree({x=x,y=ground_y+1,z=z})
elseif nodename == "default:dirt_with_grass" and junnear == nil and defnear == nil and math.random(NORMPLANT) == 11 then
glowtest_myellowtree({x=x,y=ground_y+1,z=z})
elseif nodename == "default:dirt_with_grass" and junnear == nil and defnear == nil and math.random(NORMPLANT) == 12 then
glowtest_lyellowtree({x=x,y=ground_y+1,z=z})
elseif nodename == "default:dirt_with_grass" and junnear == nil and defnear == nil and math.random(NORMPLANT) == 13 then
glowtest_swhitetree({x=x,y=ground_y+1,z=z})
elseif nodename == "default:dirt_with_grass" and junnear == nil and defnear == nil and math.random(NORMPLANT) == 14 then
glowtest_mwhitetree({x=x,y=ground_y+1,z=z})
elseif nodename == "default:dirt_with_grass" and junnear == nil and defnear == nil and math.random(NORMPLANT) == 15 then
glowtest_lwhitetree({x=x,y=ground_y+1,z=z})
elseif nodename == "default:desert_sand" and math.random(NORMPLANT) == 16 then
glowtest_sredtree({x=x,y=ground_y+1,z=z})
elseif nodename == "default:desert_sand" and math.random(NORMPLANT) == 2 then
glowtest_mredtree({x=x,y=ground_y+1,z=z})
elseif nodename == "default:desert_sand" and math.random(NORMPLANT) == 3 then
glowtest_lredtree({x=x,y=ground_y+1,z=z})
elseif nodename == "default:desert_sand" and math.random(NORMPLANT) == 4 then
glowtest_sblacktree({x=x,y=ground_y+1,z=z})
elseif nodename == "default:desert_sand" and math.random(NORMPLANT) == 5 then
glowtest_mblacktree({x=x,y=ground_y+1,z=z})
elseif nodename == "default:desert_sand" and math.random(NORMPLANT) == 6 then
glowtest_lblacktree({x=x,y=ground_y+1,z=z})
end
end
end
end
end
end
end
end)
end
minetest.register_node("glowtest:tree", {
description = "Glowing Tree",
tiles = {"default_tree_top.png", "default_tree_top.png", "default_tree.png"},
paramtype2 = "facedir",
light_source = 8,
groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
sounds = default.node_sound_wood_defaults(),
drop = "default:tree",
on_place = minetest.rotate_node
})
minetest.register_node("glowtest:stonetree", {
description = "Glowing Stone Tree",
tiles = {"default_stone.png"},
paramtype2 = "facedir",
light_source = 8,
groups = {tree=1,cracky=3},
sounds = default.node_sound_wood_defaults(),
drop = "default:stone",
on_place = minetest.rotate_node
})
minetest.register_node("glowtest:blueleaf", {
description = "Glowing Blue Leaf",
drawtype = "allfaces_optional",
visual_scale = 1.3,
tiles = {"glowtest_blueleaf.png"},
paramtype = "light",
light_source = 8,
groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
drop = {
max_items = 1,
items = {
{ items = {'glowtest:sbluesapling'}, rarity = 20},
{ items = {'glowtest:mbluesapling'}, rarity = 40},
{ items = {'glowtest:lbluesapling'}, rarity = 60},
{ items = {'glowtest:blueleaf'} }
}
},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("glowtest:redleaf", {
description = "Glowing Blood Leaf",
drawtype = "allfaces_optional",
visual_scale = 1.3,
tiles = {"glowtest_redleaf.png"},
paramtype = "light",
light_source = 8,
groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
drop = {
max_items = 1,
items = {
{ items = {'glowtest:sredsapling'}, rarity = 20},
{ items = {'glowtest:mredsapling'}, rarity = 40},
{ items = {'glowtest:lredsapling'}, rarity = 60},
{ items = {'glowtest:redleaf'} }
}
},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("glowtest:blackleaf", {
description = "Glowing Cursed Leaf",
drawtype = "allfaces_optional",
visual_scale = 1.3,
tiles = {"glowtest_blackleaf.png"},
paramtype = "light",
light_source = 8,
groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
drop = {
max_items = 1,
items = {
{ items = {'glowtest:sblacksapling'}, rarity = 20},
{ items = {'glowtest:mblacksapling'}, rarity = 40},
{ items = {'glowtest:lblacksapling'}, rarity = 60},
{ items = {'glowtest:blackleaf'} }
}
},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("glowtest:pinkleaf", {
description = "Glowing Pink Leaf",
drawtype = "allfaces_optional",
visual_scale = 1.3,
tiles = {"glowtest_pinkleaf.png"},
paramtype = "light",
light_source = 8,
groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
drop = {
max_items = 1,
items = {
{ items = {'glowtest:spinksapling'}, rarity = 20},
{ items = {'glowtest:mpinksapling'}, rarity = 40},
{ items = {'glowtest:lpinksapling'}, rarity = 60},
{ items = {'glowtest:pinkleaf'} }
}
},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("glowtest:yellowleaf", {
description = "Glowing Yellow Leaf",
drawtype = "allfaces_optional",
visual_scale = 1.3,
tiles = {"glowtest_yellowleaf.png"},
paramtype = "light",
light_source = 8,
groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
drop = {
max_items = 1,
items = {
{ items = {'glowtest:syellowsapling'}, rarity = 20},
{ items = {'glowtest:myellowsapling'}, rarity = 40},
{ items = {'glowtest:lyellowsapling'}, rarity = 60},
{ items = {'glowtest:yellowleaf'} }
}
},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("glowtest:greenleaf", {
description = "Glowing Green Leaf",
drawtype = "allfaces_optional",
visual_scale = 1.3,
tiles = {"glowtest_greenleaf.png"},
paramtype = "light",
light_source = 8,
groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
drop = {
max_items = 1,
items = {
{ items = {'glowtest:sgreensapling'}, rarity = 20},
{ items = {'glowtest:mgreensapling'}, rarity = 40},
{ items = {'glowtest:lgreensapling'}, rarity = 60},
{ items = {'glowtest:greenleaf'} }
}
},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("glowtest:whiteleaf", {
description = "Glowing White Leaf",
drawtype = "allfaces_optional",
visual_scale = 1.3,
tiles = {"glowtest_whiteleaf.png"},
paramtype = "light",
light_source = 8,
groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
drop = {
max_items = 1,
items = {
{ items = {'glowtest:swhitesapling'}, rarity = 20},
{ items = {'glowtest:mwhitesapling'}, rarity = 40},
{ items = {'glowtest:lwhitesapling'}, rarity = 60},
{ items = {'glowtest:whiteleaf'} }
}
},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("glowtest:glow_ore", {
description = "Limestone Ore",
tiles = {"default_dirt.png^glowtest_glow_ore.png"},
is_ground_content = true,
light_source = 4,
groups = {cracky=3},
drop = {
max_items = 2,
items = {
{ items = {'glowtest:sgreensapling'}, rarity = 20},
{ items = {'glowtest:mgreensapling'}, rarity = 40},
{ items = {'glowtest:lgreensapling'}, rarity = 60},
{ items = {'glowtest:sbluesapling'}, rarity = 20},
{ items = {'glowtest:mbluesapling'}, rarity = 40},
{ items = {'glowtest:lbluesapling'}, rarity = 60},
{ items = {'glowtest:spinksapling'}, rarity = 20},
{ items = {'glowtest:mpinksapling'}, rarity = 40},
{ items = {'glowtest:lpinksapling'}, rarity = 60},
{ items = {'glowtest:syellowsapling'}, rarity = 20},
{ items = {'glowtest:myellowsapling'}, rarity = 40},
{ items = {'glowtest:lyellowsapling'}, rarity = 60},
{ items = {'glowtest:swhitesapling'}, rarity = 20},
{ items = {'glowtest:mwhitesapling'}, rarity = 40},
{ items = {'glowtest:lwhitesapling'}, rarity = 60},
{ items = {'glowtest:glowlump'} }
}
},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("glowtest:glow_ore_cursed", {
description = "Limestone Ore",
tiles = {"default_desert_stone.png^glowtest_cursed_glow_ore.png"},
is_ground_content = true,
light_source = 4,
groups = {cracky=3},
drop = {
max_items = 2,
items = {
{ items = {'glowtest:sblacksapling'}, rarity = 20},
{ items = {'glowtest:mblacksapling'}, rarity = 40},
{ items = {'glowtest:lblacksapling'}, rarity = 60},
{ items = {'glowtest:sredsapling'}, rarity = 20},
{ items = {'glowtest:mredsapling'}, rarity = 40},
{ items = {'glowtest:lredsapling'}, rarity = 60},
{ items = {'glowtest:glowlump_cursed'} }
}
},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("glowtest:sgreensapling", {
description = "Small Green Sapling",
drawtype = "plantlike",
visual_scale = 0.7,
tiles = {"glowtest_greensapling.png"},
inventory_image = "glowtest_greensapling.png",
wield_image = "glowtest_greensapling.png",
paramtype = "light",
walkable = false,
light_source = 8,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
selection_box = {
type = "fixed",
fixed = { -0.15, -0.5, -0.15, 0.15, 0.2, 0.15 },
},
})
minetest.register_node("glowtest:mgreensapling", {
description = "Medium Green Sapling",
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"glowtest_greensapling.png"},
inventory_image = "glowtest_greensapling.png",
wield_image = "glowtest_greensapling.png",
paramtype = "light",
walkable = false,
light_source = 8,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("glowtest:lgreensapling", {
description = "Large Green Sapling",
drawtype = "plantlike",
visual_scale = 2.0,
tiles = {"glowtest_greensapling.png"},
inventory_image = "glowtest_greensapling.png",
wield_image = "glowtest_greensapling.png",
paramtype = "light",
walkable = false,
light_source = 8,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("glowtest:sbluesapling", {
description = "Small Blue Sapling",
drawtype = "plantlike",
visual_scale = 0.7,
tiles = {"glowtest_bluesapling.png"},
inventory_image = "glowtest_bluesapling.png",
wield_image = "glowtest_bluesapling.png",
paramtype = "light",
walkable = false,
light_source = 8,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
selection_box = {
type = "fixed",
fixed = { -0.15, -0.5, -0.15, 0.15, 0.2, 0.15 },
},
})
minetest.register_node("glowtest:mbluesapling", {
description = "Medium Blue Sapling",
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"glowtest_bluesapling.png"},
inventory_image = "glowtest_bluesapling.png",
wield_image = "glowtest_bluesapling.png",
paramtype = "light",
walkable = false,
light_source = 8,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("glowtest:lbluesapling", {
description = "Large Blue Sapling",
drawtype = "plantlike",
visual_scale = 2.0,
tiles = {"glowtest_bluesapling.png"},
inventory_image = "glowtest_bluesapling.png",
wield_image = "glowtest_bluesapling.png",
paramtype = "light",
walkable = false,
light_source = 8,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("glowtest:spinksapling", {
description = "Small Pink Sapling",
drawtype = "plantlike",
visual_scale = 0.7,
tiles = {"glowtest_pinksapling.png"},
inventory_image = "glowtest_pinksapling.png",
wield_image = "glowtest_pinksapling.png",
paramtype = "light",
walkable = false,
light_source = 8,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
selection_box = {
type = "fixed",
fixed = { -0.15, -0.5, -0.15, 0.15, 0.2, 0.15 },
},
})
minetest.register_node("glowtest:mpinksapling", {
description = "Medium Pink Sapling",
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"glowtest_pinksapling.png"},
inventory_image = "glowtest_pinksapling.png",
wield_image = "glowtest_pinksapling.png",
paramtype = "light",
walkable = false,
light_source = 8,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("glowtest:lpinksapling", {
description = "Large Pink Sapling",
drawtype = "plantlike",
visual_scale = 2.0,
tiles = {"glowtest_pinksapling.png"},
inventory_image = "glowtest_pinksapling.png",
wield_image = "glowtest_pinksapling.png",
paramtype = "light",
walkable = false,
light_source = 8,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("glowtest:syellowsapling", {
description = "Small Yellow Sapling",
drawtype = "plantlike",
visual_scale = 0.7,
tiles = {"glowtest_yellowsapling.png"},
inventory_image = "glowtest_yellowsapling.png",
wield_image = "glowtest_yellowsapling.png",
paramtype = "light",
walkable = false,
light_source = 8,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
selection_box = {
type = "fixed",
fixed = { -0.15, -0.5, -0.15, 0.15, 0.2, 0.15 },
},
})
minetest.register_node("glowtest:myellowsapling", {
description = "Medium Yellow Sapling",
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"glowtest_yellowsapling.png"},
inventory_image = "glowtest_yellowsapling.png",
wield_image = "glowtest_yellowsapling.png",
paramtype = "light",
walkable = false,
light_source = 8,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("glowtest:lyellowsapling", {
description = "Large Yellow Sapling",
drawtype = "plantlike",
visual_scale = 2.0,
tiles = {"glowtest_yellowsapling.png"},
inventory_image = "glowtest_yellowsapling.png",
wield_image = "glowtest_yellowsapling.png",
paramtype = "light",
walkable = false,
light_source = 8,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("glowtest:sredsapling", {
description = "Small Blood Sapling",
drawtype = "plantlike",
visual_scale = 0.7,
tiles = {"glowtest_redsapling.png"},
inventory_image = "glowtest_redsapling.png",
wield_image = "glowtest_redsapling.png",
paramtype = "light",
walkable = false,
light_source = 8,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
selection_box = {
type = "fixed",
fixed = { -0.15, -0.5, -0.15, 0.15, 0.2, 0.15 },
},
})
minetest.register_node("glowtest:mredsapling", {
description = "Medium Blood Sapling",
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"glowtest_redsapling.png"},
inventory_image = "glowtest_redsapling.png",
wield_image = "glowtest_redsapling.png",
paramtype = "light",
walkable = false,
light_source = 8,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("glowtest:lredsapling", {
description = "Large Blood Sapling",
drawtype = "plantlike",
visual_scale = 2.0,
tiles = {"glowtest_redsapling.png"},
inventory_image = "glowtest_redsapling.png",
wield_image = "glowtest_redsapling.png",
paramtype = "light",
walkable = false,
light_source = 8,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("glowtest:swhitesapling", {
description = "Small White Sapling",
drawtype = "plantlike",
visual_scale = 0.7,
tiles = {"glowtest_whitesapling.png"},
inventory_image = "glowtest_whitesapling.png",
wield_image = "glowtest_whitesapling.png",
paramtype = "light",
walkable = false,
light_source = 8,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
selection_box = {
type = "fixed",
fixed = { -0.15, -0.5, -0.15, 0.15, 0.2, 0.15 },
},
})
minetest.register_node("glowtest:mwhitesapling", {
description = "Medium White Sapling",
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"glowtest_whitesapling.png"},
inventory_image = "glowtest_whitesapling.png",
wield_image = "glowtest_whitesapling.png",
paramtype = "light",
walkable = false,
light_source = 8,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("glowtest:lwhitesapling", {
description = "Large White Sapling",
drawtype = "plantlike",
visual_scale = 2.0,
tiles = {"glowtest_whitesapling.png"},
inventory_image = "glowtest_whitesapling.png",
wield_image = "glowtest_whitesapling.png",
paramtype = "light",
walkable = false,
light_source = 8,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("glowtest:rune_1", {
description = "Wyvern's Soul Rune",
tiles = {"default_stone.png^glowtest_rune_1.png"},
is_ground_content = true,
light_source = 14,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("glowtest:rune_2", {
description = "Eye Rune",
tiles = {"default_stone.png^glowtest_rune_2.png"},
is_ground_content = true,
light_source = 14,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("glowtest:sblacksapling", {
description = "Small Cursed Sapling",
drawtype = "plantlike",
visual_scale = 0.7,
tiles = {"glowtest_blacksapling.png"},
inventory_image = "glowtest_blacksapling.png",
wield_image = "glowtest_blacksapling.png",
paramtype = "light",
walkable = false,
light_source = 8,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("glowtest:mblacksapling", {
description = "Medium Cursed Sapling",
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"glowtest_blacksapling.png"},
inventory_image = "glowtest_blacksapling.png",
wield_image = "glowtest_blacksapling.png",
paramtype = "light",
walkable = false,
light_source = 8,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("glowtest:lblacksapling", {
description = "Large Cursed Sapling",
drawtype = "plantlike",
visual_scale = 2.0,
tiles = {"glowtest_blacksapling.png"},
inventory_image = "glowtest_blacksapling.png",
wield_image = "glowtest_blacksapling.png",
paramtype = "light",
walkable = false,
light_source = 8,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
-- TREE FUNCTIONS
-- Green
@ -1739,30 +1029,4 @@ minetest.register_abm({
action = function(pos, node, active_object_count, active_object_count_wider)
glowtest_lblacktree(pos)
end,
})
--Ores
minetest.register_ore({
ore_type = "scatter",
ore = "glowtest:glow_ore_cursed",
wherein = "default:desert_stone",
clust_scarcity = 12*12*12,
clust_num_ores = 5,
clust_size = 3,
height_min = -100,
height_max = 10,
flags = "absheight",
})
minetest.register_ore({
ore_type = "scatter",
ore = "glowtest:glow_ore",
wherein = "default:dirt",
clust_scarcity = 12*12*12,
clust_num_ores = 5,
clust_size = 3,
height_min = -100,
height_max = 10,
flags = "absheight",
})
})

8
glowtest/init.lua Normal file
View File

@ -0,0 +1,8 @@
dofile(minetest.get_modpath("glowtest").."/glowtest/crafting_recipes.lua")
dofile(minetest.get_modpath("glowtest").."/glowtest/mapgen.lua")
dofile(minetest.get_modpath("glowtest").."/glowtest/mobs_api.lua")
dofile(minetest.get_modpath("glowtest").."/glowtest/mobs.lua")
dofile(minetest.get_modpath("glowtest").."/glowtest/nodes.lua")
dofile(minetest.get_modpath("glowtest").."/glowtest/trees.lua")
dofile(minetest.get_modpath("glowtest").."/glowtest/crystal.lua")
dofile(minetest.get_modpath("glowtest").."/glowtest/runes.lua")

72590
glowtest/models/ent_model.x Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

BIN
glowtest/textures/Thumbs.db Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 B

View File

Before

Width:  |  Height:  |  Size: 287 B

After

Width:  |  Height:  |  Size: 287 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 588 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 335 B

View File

Before

Width:  |  Height:  |  Size: 313 B

After

Width:  |  Height:  |  Size: 313 B

View File

Before

Width:  |  Height:  |  Size: 272 B

After

Width:  |  Height:  |  Size: 272 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 743 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 572 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

View File

Before

Width:  |  Height:  |  Size: 277 B

After

Width:  |  Height:  |  Size: 277 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 704 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 687 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 614 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 B

View File

Before

Width:  |  Height:  |  Size: 313 B

After

Width:  |  Height:  |  Size: 313 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 645 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 B

View File

Before

Width:  |  Height:  |  Size: 315 B

After

Width:  |  Height:  |  Size: 315 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 604 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 B

View File

Before

Width:  |  Height:  |  Size: 289 B

After

Width:  |  Height:  |  Size: 289 B

View File

Before

Width:  |  Height:  |  Size: 614 B

After

Width:  |  Height:  |  Size: 614 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 665 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 547 B

View File

Before

Width:  |  Height:  |  Size: 500 B

After

Width:  |  Height:  |  Size: 500 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 613 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 B

View File

Before

Width:  |  Height:  |  Size: 317 B

After

Width:  |  Height:  |  Size: 317 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 641 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 347 B

View File

Before

Width:  |  Height:  |  Size: 314 B

After

Width:  |  Height:  |  Size: 314 B

0
modpack.txt Normal file
View File

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 346 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 351 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 365 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 345 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 356 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 364 B