removed pipe mod + updated quests mod
@ -1,16 +0,0 @@
|
||||
License for Code
|
||||
----------------
|
||||
|
||||
Copyright (C) 2016 cd2 (cdqwertz) <cdqwertz@gmail.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2.1 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
http://www.gnu.org/licenses/lgpl-2.1.html
|
||||
|
||||
License for Media
|
||||
-----------------
|
||||
|
||||
CC-BY-SA 3.0 UNPORTED. Created by cd2 (cdqwertz)
|
@ -1,2 +0,0 @@
|
||||
default
|
||||
blueprint
|
@ -1,124 +0,0 @@
|
||||
local pipe_form = "size[8,6]"
|
||||
local pipe_form = pipe_form..default.gui_colors
|
||||
local pipe_form = pipe_form..default.gui_bg
|
||||
local pipe_form = pipe_form.."list[current_name;main;3,0.3;2,1;]"
|
||||
local pipe_form = pipe_form..default.itemslot_bg(3,0.3,2,1)
|
||||
local pipe_form = pipe_form.."list[current_player;main;0,1.85;8,1;]"
|
||||
local pipe_form = pipe_form..default.itemslot_bg(0,1.85,8,1)
|
||||
local pipe_form = pipe_form.."list[current_player;main;0,3.08;8,3;8]"
|
||||
local pipe_form = pipe_form..default.itemslot_bg(0,3.08,8,3)
|
||||
|
||||
minetest.register_node("pipe:pipe", {
|
||||
description = "Pipe",
|
||||
tiles = {"pipe_top.png", "pipe_bottom.png", "pipe_side.png"},
|
||||
groups = {choppy = 3},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-5/32, -5/32, -0.5, 5/32, 5/32, 0.5},
|
||||
},
|
||||
},
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("formspec", pipe_form)
|
||||
meta:set_string("infotext", "Pipe")
|
||||
local inv = meta:get_inventory()
|
||||
inv:set_size("main", 2)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"pipe:pipe"},
|
||||
interval = 1.0,
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local dir = vector.multiply(minetest.facedir_to_dir(minetest.get_node({x = pos.x, y= pos.y, z=pos.z}).param2), -1)
|
||||
local next_pos = vector.add(pos, dir)
|
||||
local inv = meta:get_inventory()
|
||||
local next_meta = minetest.get_meta(next_pos)
|
||||
local next_inv = next_meta:get_inventory()
|
||||
|
||||
if next_inv:room_for_item("main", inv:get_list("main")[1]) and not inv:get_list("main")[1]:is_empty() then
|
||||
next_inv:add_item("main", inv:get_list("main")[1])
|
||||
inv:remove_item("main", inv:get_list("main")[1])
|
||||
end
|
||||
if next_inv:room_for_item("main", inv:get_list("main")[2]) and not inv:get_list("main")[2]:is_empty() then
|
||||
next_inv:add_item("main", inv:get_list("main")[2])
|
||||
inv:remove_item("main", inv:get_list("main")[2])
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("pipe:pump", {
|
||||
description = "Pump",
|
||||
tiles = {"pipe_pump_top.png", "pipe_pump_top.png", "pipe_pump_side_alt.png", "pipe_pump_side.png", "pipe_pump_front.png", "pipe_pump_front.png"},
|
||||
groups = {choppy = 3},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, 0, 0.5},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"pipe:pump"},
|
||||
interval = 1.0,
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local meta = minetest.get_meta(pos)
|
||||
|
||||
local next_dir = vector.multiply(minetest.facedir_to_dir(minetest.get_node({x = pos.x, y= pos.y, z=pos.z}).param2), -1)
|
||||
local dir = minetest.facedir_to_dir(minetest.get_node({x = pos.x, y= pos.y, z=pos.z}).param2)
|
||||
|
||||
local last_pos = vector.add(pos, dir)
|
||||
local next_pos = vector.add(pos, next_dir)
|
||||
|
||||
local next_meta = minetest.get_meta(next_pos)
|
||||
local last_meta = minetest.get_meta(last_pos)
|
||||
|
||||
local last_inv = last_meta:get_inventory()
|
||||
local next_inv = next_meta:get_inventory()
|
||||
|
||||
local item_pos = 1
|
||||
|
||||
if not last_inv:get_list("main") then
|
||||
return
|
||||
end
|
||||
|
||||
for k,v in pairs(last_inv:get_list("main")) do
|
||||
if not v:is_empty() then
|
||||
item_pos = k
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if next_inv:room_for_item("main", last_inv:get_list("main")[item_pos]) and not last_inv:get_list("main")[item_pos]:is_empty() then
|
||||
next_inv:add_item("main", last_inv:get_list("main")[item_pos])
|
||||
last_inv:remove_item("main", last_inv:get_list("main")[item_pos])
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-- craft
|
||||
|
||||
blueprint.register_blueprint("pipe", {
|
||||
description = "Pipe",
|
||||
materials = {"default:wood"},
|
||||
out = "pipe:pipe",
|
||||
color = "blue"
|
||||
})
|
||||
|
||||
blueprint.register_blueprint("pump", {
|
||||
description = "Pump",
|
||||
materials = {"furnace:iron_plate", "furnace:iron_plate", "furnace:iron_plate", "pipe:pipe"},
|
||||
out = "pipe:pump",
|
||||
color = "blue"
|
||||
})
|
Before Width: | Height: | Size: 226 B |
Before Width: | Height: | Size: 217 B |
Before Width: | Height: | Size: 316 B |
Before Width: | Height: | Size: 294 B |
Before Width: | Height: | Size: 235 B |
Before Width: | Height: | Size: 198 B |
Before Width: | Height: | Size: 254 B |
@ -78,13 +78,17 @@ function quests.finish_goal(player, quest, goal)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if goal.reward then
|
||||
minetest.get_player_by_name(player):get_inventory():add_item("main", goal.reward)
|
||||
cmsg.push_message_player(minetest.get_player_by_name(player), goal.ending or "[quest] You completed a goal and you got a reward!")
|
||||
else
|
||||
cmsg.push_message_player(minetest.get_player_by_name(player), goal.ending or "[quest] You completed a goal!")
|
||||
end
|
||||
|
||||
if goal.xp then
|
||||
xp.add_xp(minetest.get_player_by_name(player), goal.xp)
|
||||
end
|
||||
end
|
||||
|
||||
goal.done = true
|
||||
@ -123,6 +127,7 @@ function quests.add_dig_goal(quest, title, node, number, description, ending)
|
||||
max = number,
|
||||
progress = 0,
|
||||
done = false,
|
||||
xp = 0,
|
||||
|
||||
description = description or "",
|
||||
ending = ending or nil
|
||||
@ -139,6 +144,7 @@ function quests.add_place_goal(quest, title, node, number, description, ending)
|
||||
max = number,
|
||||
progress = 0,
|
||||
done = false,
|
||||
xp = 0,
|
||||
|
||||
description = description or "",
|
||||
ending = ending or nil
|
||||
@ -156,6 +162,7 @@ function quests.add_craft_goal(quest, title, item, number, description, ending)
|
||||
max = number,
|
||||
progress = 0,
|
||||
done = false,
|
||||
xp = 0,
|
||||
|
||||
description = description or "",
|
||||
ending = ending or nil
|
||||
@ -279,7 +286,7 @@ minetest.register_on_newplayer(function(player)
|
||||
do
|
||||
local quest = quests.new(name, "Tutorial", "Hey you!\nI didnt see you before. Are you new here?\nOh, Ok.\nI will help you to find the city \"NAME HERE\".\nYou will be save there.\n But first you need some basic equipment!")
|
||||
local q1 = quests.add_dig_goal(quest, "Harvest Dirt/Grass", {"default:dirt", "default:grass", "default:wet_grass"}, 10, "You need to harvest some Dirt to get stones!")
|
||||
local q2 = quests.add_dig_goal(quest, "Harvest Grass", {"default:plant_grass", "default:plant_grass_2", "default:plant_grass_3", "default:plant_grass_4", "default:plant_grass_5", "default:liana"}, 12, "Now you need to get some Grass to craft strings.")
|
||||
local q2 = quests.add_dig_goal(quest, "Harvest Grass", {"default:plant_grass", "default:plant_grass_2", "default:plant_grass_3", "default:plant_grass_4", "default:plant_grass_5", "default:liana", "default:grass", "default:wet_grass"}, 12, "Now you need to get some Grass to craft strings.")
|
||||
local q3 = quests.add_dig_goal(quest, "Harvest Leaves", {"default:leaves_1", "default:leaves_2", "default:leaves_3" ,"default:leaves_4"}, 6, "Harvest some leaves to craft twigs.")
|
||||
|
||||
local q4 = quests.add_place_goal(quest, "Place Workbench", {"default:workbench"}, 1, "You should craft a workbench and place it in front of you!", "If you want to know how to craft things,\n just open the crafting guide I gave you.\nYou can find all craftable items there!")
|
||||
@ -315,10 +322,15 @@ minetest.register_on_newplayer(function(player)
|
||||
local q5 = quests.add_dig_goal(quest, "Mine Diamond", {"default:stone_with_diamond"}, 10, "")
|
||||
|
||||
q1.reward = "torch:torch 10"
|
||||
q1.xp = 10
|
||||
q2.reward = "farming:apple 30"
|
||||
q2.xp = 15
|
||||
q3.reward = "default:pick"
|
||||
q3.xp = 30
|
||||
q4.reward = "default:torch 99"
|
||||
q4.xp = 40
|
||||
q5.reward = "default:torch 99"
|
||||
q5.xp = xp.get_xp(5, 1)
|
||||
|
||||
quest.xp = 0
|
||||
quests.add_quest(name, quest)
|
||||
|