mapgen and carts improvements

>player will sit down in a minecart
>minecart model has been changed
>ice doors have been added
>cave crystals have been added
>new dungeons were added
>mapgen should be a bit faster as a special ore is used instead of stone
to spawn dungeons.
>trader collisionbox improved
master
D00Med 2017-01-03 08:23:12 +10:00
parent 726bf6e033
commit dabfe13bec
22 changed files with 143 additions and 13 deletions

View File

@ -20,6 +20,7 @@ function carts:manage_attachment(player, obj)
if status then
player:set_attach(obj, "", {x=0, y=6, z=0}, {x=0, y=0, z=0})
player:set_eye_offset({x=0, y=-4, z=0},{x=0, y=-4, z=0})
player:set_animation({x=81, y=160}, 30, 0)
else
player:set_detach()
player:set_eye_offset({x=0, y=0, z=0},{x=0, y=0, z=0})

View File

@ -45,10 +45,12 @@ Originally from PixelBOX (Gambit):
carts_cart.png*
sofar + stujones11:
carts_cart.b3d and carts_cart.blend
carts_cart2.b3d and carts_cart2.blend
hexafraction, modified by sofar
carts_rail_*.png
http://www.freesound.org/people/YleArkisto/sounds/253159/ - YleArkisto - CC-BY-3.0
carts_cart_moving.*.ogg
carts_cart.b3d, carts_cart.blend - CC BY-SA 3.0 by toby109tt(aka tobyplowy)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -431,7 +431,7 @@ function doors.register(name, def)
def.on_destruct = function(pos)
minetest.remove_node({x = pos.x, y = pos.y + 1, z = pos.z})
end
def.drawtype = "mesh"
def.paramtype = "light"
def.paramtype2 = "facedir"
@ -524,6 +524,23 @@ doors.register("door_boss_locked", {
}
})
doors.register("door_ice", {
tiles = {{name = "doors_door_ice.png", backface_culling = true}},
description = "Ice Door",
inventory_image = "doors_item_ice.png",
protected = true,
use_texture_alpha = true,
groups = {cracky = 1, level = 2},
sounds = default.node_sound_metal_defaults(),
sound_open = "doors_door_open",
sound_close = "doors_door_close",
recipe = {
{"default:ice", "default:ice"},
{"default:ice", "default:ice"},
{"default:ice", "default:ice"},
}
})
doors.register("door_steel", {
tiles = {{name = "doors_door_steel.png", backface_culling = true}},
description = "Steel Door",

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 409 B

View File

@ -560,6 +560,84 @@ minetest.override_item("default:stone_with_gold", {
--new nodes
minetest.register_node("hyrule_mapgen:crystal_1", {
description = "Cave Crystal",
tiles = {
"hyrule_mapgen_crystal1.png",
},
groups = {cracky=1},
drawtype = "nodebox",
use_texture_alpha = true,
paramtype = "light",
paramtype2 = "facedir",
light_source = 6,
node_box = {
type = "fixed",
fixed = {
{-0.125, -0.5, -0.0625, 0.1875, 0.4375, 0.25}, -- NodeBox6
{0, -0.5, -0.3125, 0.1875, 0.1875, -0.125}, -- NodeBox7
{-0.3125, -0.5, -0.1875, -0.0625, -0.0625, 0.0625}, -- NodeBox8
{0.1875, -0.5, 0.0625, 0.3125, 0, 0.1875}, -- NodeBox9
{-0.25, -0.5, 0.125, 0, 0.0625, 0.375}, -- NodeBox10
}
},
sounds = default.node_sound_glass_defaults()
})
minetest.register_node("hyrule_mapgen:crystal_3", {
description = "Cave Crystal",
tiles = {
"hyrule_mapgen_crystal3.png",
},
groups = {cracky=1},
use_texture_alpha = true,
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
light_source = 6,
node_box = {
type = "fixed",
fixed = {
{-0.1875, -0.5, -0.25, 0, 0.1875, -0.0625}, -- NodeBox16
{0, -0.5, 0.0625, 0.25, 0.5, 0.3125}, -- NodeBox19
{-0.375, -0.5, 0.0625, -0.1875, -0.0625, 0.25}, -- NodeBox20
}
},
sounds = default.node_sound_glass_defaults()
})
minetest.register_node("hyrule_mapgen:crystal_2", {
description = "Cave Crystal",
tiles = {
"hyrule_mapgen_crystal2.png",
},
groups = {cracky=1},
use_texture_alpha = true,
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
light_source = 6,
node_box = {
type = "fixed",
fixed = {
{-0.125, -0.5, -0.1875, 0.125, 0.4375, 0.125}, -- NodeBox11
{0.0625, -0.5, 0.1875, 0.25, 0.1875, 0.375}, -- NodeBox12
{-0.375, -0.5, -0.25, -0.1875, -0.0625, -0.0625}, -- NodeBox13
{-0.3125, -0.5, 0.0625, -0.0625, 0.125, 0.3125}, -- NodeBox14
{0.0625, -0.5, -0.3125, 0.25, 0.25, -0.125}, -- NodeBox15
}
},
sounds = default.node_sound_glass_defaults()
})
minetest.register_node("hyrule_mapgen:dungeon_seed", {
description = "Dungeon Seed",
tiles = {"default_stone.png"},
groups = {cracky = 3, not_in_creative_inventory=1},
sounds = default.node_sound_stone_defaults(),
drop = "default:stone"
})
minetest.register_node("hyrule_mapgen:ice_brick", {
description = "Ice Brick",
tiles = {"hyrule_mapgen_ice_brick.png"},
@ -705,12 +783,15 @@ minetest.register_node("hyrule_mapgen:chest", {
return inv:is_empty("main")
end,
on_rightclick = function(pos, node, clicker, item, _)
local name = clicker:get_player_name()
if clicker:get_wielded_item():get_name() == "hyruletools:key" then
item:take_item()
local meta = minetest.get_meta(pos)
local item = meta:get_string("item")
minetest.env:add_item(pos, item)
minetest.env:remove_node(pos)
else
minetest.chat_send_player(name, "It is locked, you need a key!")
end
end,
})
@ -768,10 +849,13 @@ minetest.register_node("hyrule_mapgen:chest_bosskey", {
return inv:is_empty("main")
end,
on_rightclick = function(pos, node, clicker, item, _)
local name = clicker:get_player_name()
if clicker:get_wielded_item():get_name() == "hyruletools:key" then
item:take_item()
minetest.env:add_item(pos, "hyruletools:key_boss")
minetest.env:remove_node(pos)
else
minetest.chat_send_player(name, "It's locked, you need a key!")
end
end,
})

View File

@ -1017,9 +1017,9 @@ minetest.register_decoration({
minetest.register_decoration({
deco_type = "schematic",
place_on = {"default:snowblock"},
sidelen = 36,
sidelen = 46,
noise_params = {
offset = 0.001,
offset = 0,
scale = 0.001,
spread = {x = 100, y = 100, z = 100},
seed = 329,
@ -1253,6 +1253,17 @@ minetest.register_ore({
y_max = -66,
})
minetest.register_ore({
ore_type = "scatter",
ore = "hyrule_mapgen:dungeon_seed",
wherein = "default:stone",
clust_scarcity = 22 * 22 * 22,
clust_num_ores = 1,
clust_size = 2,
y_min = -9113,
y_max = -66,
})
--rupees
minetest.register_node("hyrule_mapgen:stone_with_redrupee", {
@ -1390,7 +1401,7 @@ minetest.register_on_generated(function(minp, maxp)
end)
minetest.register_on_generated(function(minp, maxp)
if maxp.y < -100 or maxp.y > 20 then
if maxp.y < -150 or maxp.y > 20 then
return
end
local dirt = minetest.find_nodes_in_area(minp, maxp,
@ -1398,7 +1409,7 @@ minetest.register_on_generated(function(minp, maxp)
for n = 1, #dirt do
if math.random(1, 50) == 1 then
local pos = {x = dirt[n].x, y = dirt[n].y, z = dirt[n].z }
if minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name == "air" then
if minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name == "air" and pos.y >= -100 then
if math.random(1,2) == 1 then
minetest.add_node({x=pos.x, y=pos.y+1, z=pos.z}, {name = "hyrule_mapgen:stalagmite0"})
elseif math.random(1,2) == 1 then
@ -1406,6 +1417,14 @@ minetest.register_on_generated(function(minp, maxp)
else
minetest.add_node({x=pos.x, y=pos.y+1, z=pos.z}, {name = "hyrule_mapgen:stalagmite2"})
end
elseif minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name == "air" then
if math.random(1,2) == 1 then
minetest.add_node({x=pos.x, y=pos.y+1, z=pos.z}, {name = "hyrule_mapgen:crystal_1"})
elseif math.random(1,2) == 1 then
minetest.add_node({x=pos.x, y=pos.y+1, z=pos.z}, {name = "hyrule_mapgen:crystal_2"})
else
minetest.add_node({x=pos.x, y=pos.y+1, z=pos.z}, {name = "hyrule_mapgen:crystal_3"})
end
end
end
end
@ -1433,7 +1452,7 @@ end)
--villages
local village_rarity = 50000
local village_rarity = 100000
minetest.register_on_generated(function(minp, maxp)
if maxp.y < -1 or maxp.y > 21000 then
@ -1470,19 +1489,26 @@ end)
--dungeons
--below ground
local dungeon_rarity = 5000000
local dungeon_rarity = 500
minetest.register_on_generated(function(minp, maxp)
if maxp.y > -500 or maxp.y < -3000 then
if maxp.y > -60 or maxp.y < -30000 then
return
end
local stone = minetest.find_nodes_in_area(minp, maxp,
{"default:stone"})
{"hyrule_mapgen:dungeon_seed"})
for n = 1, #stone do
if math.random(1, dungeon_rarity) == 1 then
local pos = {x = stone[n].x, y = stone[n].y, z = stone[n].z }
minetest.place_schematic(pos, minetest.get_modpath("hyrule_mapgen").."/schematics/dungeon_retro.mts", random, {}, true)
if pos.y <= -500 then
local number = math.random(1,2)
minetest.place_schematic(pos, minetest.get_modpath("hyrule_mapgen").."/schematics/dungeon_retro"..number..".mts", random, {}, true)
minetest.add_node({x=pos.x+math.random(1,12), y=pos.y+1, z=pos.z+math.random(1,12)}, {name = "mobs_loz:mimic_chest"})
else
local number = math.random(1,2)
minetest.place_schematic(pos, minetest.get_modpath("hyrule_mapgen").."/schematics/dungeon"..number..".mts", random, {}, true)
minetest.add_node({x=pos.x+math.random(1,12), y=pos.y+1, z=pos.z+math.random(1,12)}, {name = "mobs_loz:mimic_chest"})
end
end
end
end)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 B

View File

@ -957,7 +957,7 @@ minetest.register_entity("hyruletools:spark2", {
self.activated = true
end)
minetest.after(10, function()
--self.object:remove()
self.object:remove()
end)
end,
on_step = function (self, pos, node, dtime)

View File

@ -60,7 +60,7 @@ mobs:register_mob("mobs_npc:shopkeeper", {
hp_min = 10,
hp_max = 20,
armor = 100,
collisionbox = {-0.4,0,-0.4, 0.4,1.8,0.4},
collisionbox = {-0.4, -0.01,-0.4, 0.4,1.8,0.4},
visual = "mesh",
mesh = "shopkeeper.b3d",
textures = {