Village, giant octorock

master
D00Med 2016-12-20 14:38:20 +10:00
parent fa77724a33
commit 4c31fb4d83
18 changed files with 270 additions and 4 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 756 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 833 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 916 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 214 B

After

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 858 B

View File

@ -1076,3 +1076,18 @@ minetest.register_on_generated(function(minp, maxp)
end
end
end)
--place a village on singleplayer spawn on day 1
minetest.register_on_newplayer(function(player)
if not village_spawned and minetest.get_day_count() == 0 then
local name = player:get_player_name()
if name == "singleplayer" then
minetest.after(2, function()
local pos = player:getpos()
minetest.place_schematic({x=pos.x, y=pos.y-1, z=pos.z}, minetest.get_modpath("hyrule_mapgen").."/schematics/village.mts", 0, {}, true)
end)
end
end
end)

Binary file not shown.

View File

@ -3113,4 +3113,140 @@ minetest.register_craft({
{'hyruletools:ice_fragment', 'group:stick'},
{'', 'group:stick'},
}
})
})
--letters from default books Originally by celeron55, Perttu Ahola <celeron55@gmail.com> (LGPL 2.1)
--Various Minetest developers and contributors (LGPL 2.1)
local lpp = 14 -- Lines per book's page
local function book_on_use(itemstack, user)
local player_name = user:get_player_name()
local data = minetest.deserialize(itemstack:get_metadata())
local title, text, owner = "", "", player_name
local page, page_max, lines, string = 1, 1, {}, ""
if data then
title = data.title
text = data.text
owner = data.owner
for str in (text .. "\n"):gmatch("([^\n]*)[\n]") do
lines[#lines+1] = str
end
if data.page then
page = data.page
page_max = data.page_max
for i = ((lpp * page) - lpp) + 1, lpp * page do
if not lines[i] then break end
string = string .. lines[i] .. "\n"
end
end
end
local formspec
if owner == player_name then
formspec = "size[8,8]" .. default.gui_bg ..
"background[0,0;8,8;hyruletools_paper.png]" ..
"field[0.5,1;7.5,0;title;Title:;" ..
minetest.formspec_escape(title) .. "]" ..
"textarea[0.5,1.5;7.5,7;text;Contents:;" ..
minetest.formspec_escape(text) .. "]" ..
"button_exit[2.5,7.5;3,1;save;Save]"
else
formspec = "size[8,8]" .. default.gui_bg ..
"hyruletools_paper.png" ..
"label[0.5,0.5;by " .. owner .. "]" ..
"tablecolumns[color;text]" ..
"tableoptions[background=#00000000;highlight=#00000000;border=false]" ..
"table[0.4,0;7,0.5;title;#FFFF00," .. minetest.formspec_escape(title) .. "]" ..
"textarea[0.5,1.5;7.5,7;;" ..
minetest.formspec_escape(string ~= "" and string or text) .. ";]" ..
"button[2.4,7.6;0.8,0.8;book_prev;<]" ..
"label[3.2,7.7;Page " .. page .. " of " .. page_max .. "]" ..
"button[4.9,7.6;0.8,0.8;book_next;>]"
end
minetest.show_formspec(player_name, "hyruletools:letter", formspec)
end
minetest.register_on_player_receive_fields(function(player, formname, fields)
if formname ~= "hyruletools:letter" then return end
local inv = player:get_inventory()
local stack = player:get_wielded_item()
if fields.save and fields.title ~= "" and fields.text ~= "" then
local new_stack, data
if stack:get_name() ~= "hyruletools:letter_written" then
local count = stack:get_count()
if count == 1 then
stack:set_name("hyruletools:letter_written")
else
stack:set_count(count - 1)
new_stack = ItemStack("hyruletools:letter_written")
end
else
data = minetest.deserialize(stack:get_metadata())
end
if not data then data = {} end
data.title = fields.title
data.text = fields.text
data.text_len = #data.text
data.page = 1
data.page_max = math.ceil((#data.text:gsub("[^\n]", "") + 1) / lpp)
data.owner = player:get_player_name()
local data_str = minetest.serialize(data)
if new_stack then
new_stack:set_metadata(data_str)
if inv:room_for_item("main", new_stack) then
inv:add_item("main", new_stack)
else
minetest.add_item(player:getpos(), new_stack)
end
else
stack:set_metadata(data_str)
end
elseif fields.book_next or fields.book_prev then
local data = minetest.deserialize(stack:get_metadata())
if not data or not data.page then
return
end
if fields.book_next then
data.page = data.page + 1
if data.page > data.page_max then
data.page = 1
end
else
data.page = data.page - 1
if data.page == 0 then
data.page = data.page_max
end
end
local data_str = minetest.serialize(data)
stack:set_metadata(data_str)
book_on_use(stack, player)
end
player:set_wielded_item(stack)
end)
minetest.register_craftitem("hyruletools:letter", {
description = "Letter",
inventory_image = "hyruletools_letter_inv.png",
groups = {book = 1, flammable = 3},
on_use = book_on_use,
})
minetest.register_craftitem("hyruletools:letter_written", {
description = "Letter With Text",
inventory_image = "hyruletools_letter_inv.png",
groups = {book = 1, not_in_creative_inventory = 1, flammable = 3},
stack_max = 1,
on_use = book_on_use,
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -85,4 +85,62 @@ mobs:register_arrow("mobs_loz:octorock_rock", {
mobs:register_spawn("mobs_loz:octorock", {"default:sand", "default:dirt_with_grass3", "default:desert_sand"}, 20, 10, 15000, 2, 31000)
mobs:register_egg("mobs_loz:octorock", "Octorock", "default_sand.png", 1)
mobs:register_egg("mobs_loz:octorock", "Octorock", "default_sand.png", 1)
mobs:register_mob("mobs_loz:octorock_boss", {
type = "monster",
passive = false,
attack_type = "shoot",
shoot_interval = 1.5,
arrow = "mobs_loz:octorock_rock",
shoot_offset = 1,
hp_min = 20,
hp_max = 35,
armor = 80,
collisionbox = {-1, 0, -1, 1, 2, 1},
visual_size = {x=3.5, y=3.5},
visual = "mesh",
mesh = "octorock.b3d",
textures = {
{"mobs_octorock_giant.png"},
},
makes_footstep_sound = true,
view_range = 10,
walk_velocity = 1,
run_velocity = 1.5,
jump = false,
jump_height = 0,
fall_damage = 0,
fall_speed = -6,
stepheight = 3,
drops = {
{name = "hyruletools:blue_rupee",
chance = 5, min = 5, max = 5},
},
on_die = function(self)
local pos = self.object:getpos()
if math.random(1,2) == 2 then
minetest.env:add_entity(pos, "hyruletools:heart_entity")
end
minetest.env:add_entity(pos, "experience:orb")
end,
water_damage = 1,
lava_damage = 1,
light_damage = 0,
animation = {
speed_normal = 12,
speed_run = 12,
stand_start = 1,
stand_end = 12,
walk_start = 18,
walk_end = 38,
run_start = 18,
run_end = 38,
shoot_start = 1,
shoot_end = 12,
},
})
--mobs:register_spawn("mobs_loz:octorock_boss", {"default:sand", "default:dirt_with_grass3", "default:desert_sand"}, 20, 10, 15000, 2, 31000)
mobs:register_egg("mobs_loz:octorock_boss", "Giant Octorock", "default_sand.png", 1)

View File

@ -8,9 +8,9 @@ mobs:register_mob("mobs_loz:deku_scrub", {
reach = 1,
damage = 2,
attack_type = "shoot",
shoot_interval = 1.5,
shoot_interval = 1.7,
arrow = "mobs_loz:deku_nut",
shoot_offset = 1,
shoot_offset = 1.5,
hp_min = 10,
hp_max = 25,
armor = 80,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 635 B

After

Width:  |  Height:  |  Size: 376 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 391 B

After

Width:  |  Height:  |  Size: 771 B

View File

@ -78,6 +78,54 @@ function stairs.register_stair(subname, recipeitem, groups, images, description,
return minetest.item_place(itemstack, placer, pointed_thing, param2)
end,
})
minetest.register_node(":stairs:stair_corner_" .. subname, {
description = description.." Corner",
drawtype = "nodebox",
paramtype = "light",
node_box = {
type = "fixed",
fixed = {
{-0, -0.5, -0, 0.5, 0.5, 0.5}, -- NodeBox1
{-0.5, -0.5, -0.5, 0.5, 0, 0.5}, -- NodeBox2
}
},
tiles = images,
paramtype2 = "facedir",
is_ground_content = false,
groups = groups,
sounds = sounds,
on_place = function(itemstack, placer, pointed_thing)
if pointed_thing.type ~= "node" then
return itemstack
end
local p0 = pointed_thing.under
local p1 = pointed_thing.above
local param2 = 0
local placer_pos = placer:getpos()
if placer_pos then
local dir = {
x = p1.x - placer_pos.x,
y = p1.y - placer_pos.y,
z = p1.z - placer_pos.z
}
param2 = minetest.dir_to_facedir(dir)
end
if p0.y - 1 == p1.y then
param2 = param2 + 20
if param2 == 21 then
param2 = 23
elseif param2 == 23 then
param2 = 21
end
end
return minetest.item_place(itemstack, placer, pointed_thing, param2)
end,
})
-- for replace ABM
if replace then
@ -106,6 +154,15 @@ function stairs.register_stair(subname, recipeitem, groups, images, description,
{recipeitem, recipeitem, recipeitem},
},
})
minetest.register_craft({
output = 'stairs:stair_corner_' .. subname .. ' 8',
recipe = {
{"", "", recipeitem},
{"", "", recipeitem},
{recipeitem, recipeitem, recipeitem},
},
})
-- Fuel
local baseburntime = minetest.get_craft_result({