master
cale 2015-12-31 11:01:14 +01:00
commit b1b82636e9
108 changed files with 2256 additions and 0 deletions

1
game.conf Normal file
View File

@ -0,0 +1 @@
name = rpgtest

1
game.conf~ Normal file
View File

@ -0,0 +1 @@
name = rpgtest

View File

@ -0,0 +1,53 @@
# Central Message
## Overview
* Description: Simple API to display short messages at the center of the screen
* Author: Wuzzy
* License of everything: WTFPL
* Shortname: `central_message`
* Version: 0.2.0 (using Semantic Versioning 2.0.0, see [SemVer](http://semver.org/))
## Longer description
This Minetest mod allows other mods to display a short message at the center of the screen.
Each message is displayed for 5 seconds, then it is removed.
When multiple messages are pushed quickly in succession, the messages will be “stacked”
on the screen.
This mod can be useful to inform about all sorts of events and is an alternative to use the chat log
to display special events.
Some usage examples:
* Messages about game events, like victory, defeat, next round starting, etc.
* Error message directed to a single player
* Informational messages
* Administational messages to warn players about a coming server shutdown
## Settings
This mod can be configured via `minetest.conf`.
Currently, these settings are recognized:
* `central_message_max`: Limit the number of messages displayed at once, by providing a number. Use `inf` here for no limit. Default: 7
* `central_message_color`: Set the message color of all messages. Value must be `ColorString` (see `lua_api.txt`). Default: `0xFFFFFF` (white)
## API
### `cmsg.push_message_player(player, message)`
Display a new message to one player only.
#### Parameters
* `player`: An `ObjectRef` to the player to which to send the message
* `message`: A `string` containing the message to be displayed to the player
#### Return value
Always `nil`.
### `cmsg.push_message_all(message)`
Display a new message to all connected players.
#### Parameters
* `player`: An `ObjectRef` to the player to which to send the message
* `message`: A `string` containing the message to be displayed to all players
#### Return value
Always `nil`.

View File

View File

@ -0,0 +1 @@
Simple API to show messages to the center of the screen to players.

View File

@ -0,0 +1,114 @@
cmsg = {}
cmsg.hudids = {}
cmsg.messages = {}
cmsg.settings = {}
cmsg.next_msgids = {}
cmsg.settings.max_messages = 7
local setting = minetest.setting_get("central_message_max")
if type(tonumber(setting)) == "number" then
cmsg.settings.max_messages = tonumber(setting)
elseif setting == "inf" then
cmsg.settings.max_messages = nil
end
cmsg.settings.color = 0xFFFFFF
setting = minetest.setting_get("central_message_color")
if type(tonumber(setting)) == "number" then
cmsg.settings.color = tonumber(setting)
end
local function update_display(player, pname)
local messages = {}
local start, stop
stop = #cmsg.messages[pname]
if cmsg.settings.max_messages ~= nil then
local max = math.min(cmsg.settings.max_messages, #cmsg.messages[pname])
if #cmsg.messages[pname] > cmsg.settings.max_messages then
start = stop - max
else
start = 1
end
else
start = 1
end
for i=start, stop do
table.insert(messages, cmsg.messages[pname][i].text)
end
local concat = table.concat(messages, "\n")
player:hud_change(cmsg.hudids[pname], "text", concat)
end
cmsg.push_message_player = function(player, text)
local function push(tbl)
-- Horrible Workaround code starts here
if not (cmsg.last_push < cmsg.steps) then
minetest.after(0, push, tbl)
return
end
local player = tbl.player
local text = tbl.text
-- Horrible Workaround code ends here
local pname = player:get_player_name()
if cmsg.hudids[pname] == nil then
cmsg.hudids[pname] = player:hud_add({
hud_elem_type = "text",
text = text,
number = cmsg.settings.color,
position = {x=0.5, y=0.5},
offset = {x=-0,y=-256},
direction = 3,
alignment = {x=0,y=1},
scale = {x=800,y=20*cmsg.settings.max_messages},
})
cmsg.messages[pname] = {}
cmsg.next_msgids[pname] = 0
table.insert(cmsg.messages[pname], {text=text, msgid=cmsg.next_msgids[pname]})
else
cmsg.next_msgids[pname] = cmsg.next_msgids[pname] + 1
table.insert(cmsg.messages[pname], {text=text, msgid=cmsg.next_msgids[pname]})
update_display(player, pname)
end
minetest.after(5, function(param)
local pname = param.player:get_player_name()
for i=1, #cmsg.messages[pname] do
if param.msgid == cmsg.messages[pname][i].msgid then
table.remove(cmsg.messages[pname], i)
break
end
end
update_display(player, pname)
end, {player=player, msgid=cmsg.next_msgids[pname]})
-- Update timer for Horrible Workaround
cmsg.last_push = cmsg.steps
end
if cmsg.last_push < cmsg.steps then
push({player=player, text=text})
else
minetest.after(0, push, {player=player, text=text})
end
end
cmsg.push_message_all = function(text)
local players = minetest.get_connected_players()
for i=1,#players do
cmsg.push_message_player(players[i], text)
end
end
minetest.register_on_leaveplayer(function(player)
cmsg.hudids[player:get_player_name()] = nil
end)
-- Horrible Workaround code starts here
cmsg.steps = 0
cmsg.last_push = -1
minetest.register_globalstep(function(dtime)
cmsg.steps = cmsg.steps + 1
end)
-- Horrible Workaround code ends here

16
mods/classes/LICENSE.txt Normal file
View File

@ -0,0 +1,16 @@
License for Code
----------------
Copyright (C) 2015 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)

3
mods/classes/depends.txt Normal file
View File

@ -0,0 +1,3 @@
default
legendary_items
mobs

View File

@ -0,0 +1,3 @@
default
legendary_items
mobs

39
mods/classes/init.lua Normal file
View File

@ -0,0 +1,39 @@
classes = {}
classes.register_weapon = function(name,levels, def)
for i = 0, levels, 1 do
minetest.register_tool("classes:"..name .. "_lvl_" .. tostring(i), {
description = def.description.."\n Level: ".. tostring(i).. "\n Damage: " .. tostring(def.damage+ i) .." \n Class: " .. def.class,
inventory_image = def.inventory_image,
wield_scale = def.wield_scale,
tool_capabilities = {
max_drop_level=3,
damage_groups = {fleshy=def.damage+ i},
},
})
end
end
classes.register_weapon("spear", 5, {
description = "Spear",
inventory_image = "classes_spear.png",
wield_scale = {x = 2, y=2, z = 1},
damage = 15,
class = "warrior",
})
classes.register_weapon("chemical_spear", 7, {
description = "Chemical Spear",
inventory_image = "classes_chemical_spear.png",
wield_scale = {x = 2, y=2, z = 1},
damage = 17,
class = "warrior",
})
classes.register_weapon("hoe", 20, {
description = "Hoe",
inventory_image = "classes_hoe.png",
wield_scale = {x = 1, y=1, z = 1},
damage = 10,
class = "farmer",
})

39
mods/classes/init.lua~ Normal file
View File

@ -0,0 +1,39 @@
classes = {}
classes.register_weapon = function(name,levels, def)
for i = 0, levels, 1 do
minetest.register_tool("classes:"..name .. "_lvl_" .. tostring(i), {
description = def.description.."\n Level: ".. tostring(i).. "\n Damage: " .. tostring(def.damage+ i) .." \n Class: " .. def.class,
inventory_image = def.inventory_image,
wield_scale = def.wield_scale,
tool_capabilities = {
max_drop_level=3,
damage_groups = {fleshy=def.damage+ i},
},
})
end
end
classes.register_weapon("spear", 5, {
description = "Spear",
inventory_image = "classes_spear.png",
wield_scale = {x = 2, y=2, z = 1},
damage = 15,
class = "warrior",
})
classes.register_weapon("chemical_spear", 7, {
description = "Chemical Spear",
inventory_image = "classes_chemical_spear.png",
wield_scale = {x = 2, y=2, z = 1},
damage = 17,
class = "warrior",
})
classes.register_weapon("hoe", 20, {
description = "Hoe",
inventory_image = "classes_hoe.png",
wield_scale = {x = 1, y=1, z = 1},
damage = 10,
class = "farmer",
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 B

3
mods/decor/depends.txt Normal file
View File

@ -0,0 +1,3 @@
default
legendary_items
mobs

3
mods/decor/depends.txt~ Normal file
View File

@ -0,0 +1,3 @@
default
legendary_items
mobs

0
mods/decor/init.lua Normal file
View File

0
mods/decor/init.lua~ Normal file
View File

16
mods/default/LICENSE.txt Normal file
View File

@ -0,0 +1,16 @@
License for Code
----------------
Copyright (C) 2015 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)

38
mods/default/craft.lua Normal file
View File

@ -0,0 +1,38 @@
minetest.register_craft({
output = "default:string_strong",
recipe = {
{"default:string", "default:string", "default:string"},
}
})
minetest.register_craft({
output = "default:string",
recipe = {
{"group:plant", "group:plant", "group:plant"},
}
})
minetest.register_craft({
output = "default:plant_grass",
recipe = {
{"default:grass"},
}
})
minetest.register_craft({
output = "default:basic_hammer",
recipe = {
{"", "default:log_1", ""},
{"", "default:string_strong", ""},
{"", "default:log_3", ""},
}
})
minetest.register_craft({
output = "default:axe_stone",
recipe = {
{"", "default:stone_item", ""},
{"", "default:string_strong", ""},
{"", "default:log_3", ""},
}
})

38
mods/default/craft.lua~ Normal file
View File

@ -0,0 +1,38 @@
minetest.register_craft({
output = "default:string_strong",
recipe = {
{"default:string", "default:string", "default:string"},
}
})
minetest.register_craft({
output = "default:string",
recipe = {
{"group:plant", "group:plant", "group:plant"},
}
})
minetest.register_craft({
output = "default:plant_grass",
recipe = {
{"default:grass"},
}
})
minetest.register_craft({
output = "default:basic_hammer",
recipe = {
{"", "default:log_1", ""},
{"", "default:string_strong", ""},
{"", "default:log_3", ""},
}
})
minetest.register_craft({
output = "default:axe_stone",
recipe = {
{"", "default:stone_item", ""},
{"", "default:string_strong", ""},
{"", "default:log_3", ""},
}
})

View File

@ -0,0 +1,30 @@
minetest.register_craftitem("default:string", {
description = "String",
inventory_image = "default_string.png",
})
minetest.register_craftitem("default:stone_item", {
description = "Stone",
inventory_image = "default_stone_item.png",
})
minetest.register_craftitem("default:iron_lump", {
description = "Iron Lump",
inventory_image = "default_iron_lump.png",
})
minetest.register_craftitem("default:string_strong", {
description = "String (STRONG)",
inventory_image = "default_string_strong.png",
})
minetest.register_craftitem("default:coin", {
description = "Coin",
inventory_image = "default_coin.png",
})
minetest.register_craftitem("default:xp", {
description = "XP",
inventory_image = "default_xp.png",
stack_max = 99*99,
})

View File

@ -0,0 +1,30 @@
minetest.register_craftitem("default:string", {
description = "String",
inventory_image = "default_string.png",
})
minetest.register_craftitem("default:stone_item", {
description = "Stone",
inventory_image = "default_stone_item.png",
})
minetest.register_craftitem("default:iron_lump", {
description = "Iron Lump",
inventory_image = "default_iron_lump.png",
})
minetest.register_craftitem("default:string_strong", {
description = "String (STRONG)",
inventory_image = "default_string_strong.png",
})
minetest.register_craftitem("default:coin", {
description = "Coin",
inventory_image = "default_coin.png",
})
minetest.register_craftitem("default:xp", {
description = "XP",
inventory_image = "default_xp.png",
stack_max = 99*99,
})

10
mods/default/init.lua Normal file
View File

@ -0,0 +1,10 @@
default = {}
local modpath = minetest.get_modpath("default")
dofile(modpath.."/player.lua")
dofile(modpath.."/craftitems.lua")
dofile(modpath.."/nodes.lua")
dofile(modpath.."/tools.lua")
dofile(modpath.."/craft.lua")
dofile(modpath.."/mapgen.lua")

10
mods/default/init.lua~ Normal file
View File

@ -0,0 +1,10 @@
default = {}
local modpath = minetest.get_modpath("default")
dofile(modpath.."/player.lua")
dofile(modpath.."/craftitems.lua")
dofile(modpath.."/nodes.lua")
dofile(modpath.."/tools.lua")
dofile(modpath.."/craft.lua")
dofile(modpath.."/mapgen.lua")

87
mods/default/mapgen.lua Normal file
View File

@ -0,0 +1,87 @@
minetest.register_alias("mapgen_stone", "default:stone")
minetest.register_alias("mapgen_tree", "default:log_1")
minetest.register_alias("mapgen_leaves", "default:leaves_1")
minetest.register_alias("mapgen_dirt", "default:dirt")
minetest.register_alias("mapgen_sand", "default:sand")
minetest.register_alias("mapgen_dirt_with_grass", "default:grass")
minetest.register_alias("mapgen_water_source", "default:water_source")
minetest.register_biome({
name = "grassland",
node_top = "default:grass",
depth_top = 1,
node_filler = "default:dirt",
depth_filler = 0,
y_min = 6,
y_max = 31000,
heat_point = 45,
humidity_point = 30,
})
minetest.register_biome({
name = "beach",
node_top = "default:sand",
depth_top = 1,
node_filler = "default:sand",
depth_filler = 2,
y_min = -112,
y_max = 5,
heat_point = 45,
humidity_point = 30,
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:grass"},
sidelen = 16,
noise_params = {
offset = -0.015,
scale = 0.5,
spread = {x=200, y=200, z=200},
seed = 329,
octaves = 3,
persist = 0.6
},
biomes = {
"grassland"
},
y_min = 0,
y_max = 31000,
decoration = "default:plant_grass",
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:sand"},
sidelen = 16,
noise_params = {
offset = -0.015,
scale = 0.05,
spread = {x=200, y=200, z=200},
seed = 329,
octaves = 3,
persist = 0.6
},
biomes = {
"beach"
},
y_min = 0,
y_max = 31000,
decoration = "default:plant_grass",
})
minetest.register_biome({
name = "swamp",
node_top = "default:dirt",
depth_top = 1,
node_filler = "default:dirt",
depth_filler = 2,
node_stone = "default:wet_stone",
y_min = -3,
y_max = 4,
heat_point = 95,
humidity_point = 90,
})

87
mods/default/mapgen.lua~ Normal file
View File

@ -0,0 +1,87 @@
minetest.register_alias("mapgen_stone", "default:stone")
minetest.register_alias("mapgen_tree", "default:log_1")
minetest.register_alias("mapgen_leaves", "default:leaves_1")
minetest.register_alias("mapgen_dirt", "default:dirt")
minetest.register_alias("mapgen_sand", "default:sand")
minetest.register_alias("mapgen_dirt_with_grass", "default:grass")
minetest.register_alias("mapgen_water_source", "default:water_source")
minetest.register_biome({
name = "grassland",
node_top = "default:grass",
depth_top = 1,
node_filler = "default:dirt",
depth_filler = 0,
y_min = 6,
y_max = 31000,
heat_point = 45,
humidity_point = 30,
})
minetest.register_biome({
name = "beach",
node_top = "default:sand",
depth_top = 1,
node_filler = "default:sand",
depth_filler = 2,
y_min = -112,
y_max = 5,
heat_point = 45,
humidity_point = 30,
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:grass"},
sidelen = 16,
noise_params = {
offset = -0.015,
scale = 0.5,
spread = {x=200, y=200, z=200},
seed = 329,
octaves = 3,
persist = 0.6
},
biomes = {
"grassland"
},
y_min = 0,
y_max = 31000,
decoration = "default:plant_grass",
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:sand"},
sidelen = 16,
noise_params = {
offset = -0.015,
scale = 0.05,
spread = {x=200, y=200, z=200},
seed = 329,
octaves = 3,
persist = 0.6
},
biomes = {
"beach"
},
y_min = 0,
y_max = 31000,
decoration = "default:plant_grass",
})
minetest.register_biome({
name = "swamp",
node_top = "default:dirt",
depth_top = 1,
node_filler = "default:dirt",
depth_filler = 2,
node_stone = "default:wet_stone",
y_min = -3,
y_max = 4,
heat_point = 95,
humidity_point = 90,
})

319
mods/default/nodes.lua Normal file
View File

@ -0,0 +1,319 @@
minetest.register_node("default:dirt", {
description = "Dirt",
tiles = {"default_dirt.png"},
groups = {crumbly = 3},
})
minetest.register_node("default:sand", {
description = "Sand",
tiles = {"default_sand.png"},
groups = {crumbly = 3},
})
minetest.register_node("default:grass", {
description = "Grass",
tiles = {"default_grass.png"},
groups = {crumbly = 3},
})
minetest.register_node("default:stone", {
description = "Stone",
tiles = {"default_stone.png"},
groups = {cracky = 3},
drop = "default:stone_item 5",
})
minetest.register_node("default:stonebrick", {
description = "Stonebrick",
tiles = {"default_stonebrick.png"},
groups = {cracky = 3},
})
minetest.register_node("default:wet_stone", {
description = "Wet Stone",
tiles = {"default_wet_stone.png"},
groups = {cracky = 3},
drop = {"default:stone_item 5"},
})
minetest.register_node("default:stone_with_iron", {
description = "Stone with Iron",
tiles = {"default_stone_with_iron.png"},
groups = {cracky = 2},
drop = {"default:stone_item 2", "default:iron_lump"},
})
minetest.register_node("default:wood", {
description = "Wood",
tiles = {"default_wood.png"},
groups = {choppy = 3},
})
minetest.register_node("default:leaves_1", {
description = "leaves",
paramtype = "light",
drawtype = "allfaces",
tiles = {"default_leaves_1.png"},
groups = {crumbly = 3, leaves = 1},
walkable = false,
climbable = true,
})
minetest.register_node("default:stones_on_floor", {
description = "Stones on Floor",
tiles = {"default_stones_on_floor.png"},
groups = {snappy = 3},
paramtype = "light",
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5},
},
},
drop = "default:stone_item 2",
})
minetest.register_node("default:log_1", {
description = "Log (thick)",
tiles = {"default_log.png"},
groups = {choppy = 3},
paramtype = "light",
paramtype2 = "facedir",
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {
{-0.4, -0.5, -0.4, 0.4, 0.5, 0.4},
},
},
})
minetest.register_node("default:log_2", {
description = "Log",
tiles = {"default_log.png"},
groups = {choppy = 3},
paramtype = "light",
paramtype2 = "facedir",
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {
{-0.3, -0.5, -0.3, 0.3, 0.5, 0.3},
},
},
})
minetest.register_node("default:log_3", {
description = "Log (thin)",
tiles = {"default_log.png"},
groups = {choppy = 3},
paramtype = "light",
paramtype2 = "facedir",
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {
{-0.2, -0.5, -0.2, 0.2, 0.5, 0.2},
},
},
})
minetest.register_node("default:box", {
description = "Box",
tiles = {"default_log.png"},
groups = {choppy = 3},
paramtype = "light",
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5},
{-0.5, -0.5, -0.5, -0.4375, 0.5, 0.5},
{-0.5, -0.5, -0.5, 0.5, 0.5, -0.4375},
{-0.5, -0.5, 0.4375, 0.5, 0.5, 0.5},
{0.4375, -0.5, -0.5, 0.5, 0.5, 0.5},
},
},
})
minetest.register_node("default:treasure_chest", {
description = "Treasure Chest",
tiles = {"default_treasure_chest.png"},
groups = {choppy = 3},
drop = "default:stick 2",
on_construct = function(pos)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
inv:set_size("main", 8*4)
local items = {"default:dirt", "default:sand", "default:iron_lump", "default:stone_item", "default:coin"}
local item = items[math.random(5)]
inv:add_item("main", {name = item, count = math.random(2,10)})
local item = items[math.random(5)]
inv:add_item("main", {name = item, count = math.random(2,10)})
end,
after_dig_node = function(pos, oldnode, oldmetadata, digger)
local meta = minetest.get_meta(pos)
meta:from_table(oldmetadata)
local inv = meta:get_inventory()
for i = 1, inv:get_size("main") do
local stack = inv:get_stack("main", i)
if not stack:is_empty() then
local p = { x = pos.x + math.random(0, 5)/5 - 0.5,
y = pos.y,
z = pos.z + math.random(0, 5)/5 - 0.5
}
minetest.add_item(p, stack)
end
end
end
})
minetest.register_node("default:glass", {
description = "Glass",
tiles = {"default_glass.png"},
drawtype = "glasslike",
paramtype = "light",
groups = {crumbly = 3},
})
minetest.register_node("default:present", {
description = "Present",
tiles = {"default_present_top.png", "default_present_top.png", "default_present_side.png", "default_present_side.png", "default_present_side.png", "default_present_side.png"},
groups = {crumbly = 3},
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {
{-0.4, -0.5, -0.4, 0.4, 0, 0.4},
},
},
paramtype = "light",
})
minetest.register_node("default:present_big", {
description = "Present (big)",
tiles = {"default_present_top.png", "default_present_top.png", "default_present_side.png", "default_present_side.png", "default_present_side.png", "default_present_side.png"},
groups = {crumbly = 3},
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {
{-0.4, -0.5, -0.4, 0.4, 0.4, 0.4},
},
},
paramtype = "light",
})
minetest.register_node("default:ladder", {
description = "Ladder",
drawtype = "signlike",
tiles = {"default_ladder.png"},
inventory_image = "default_ladder.png",
wield_image = "default_ladder.png",
paramtype = "light",
paramtype2 = "wallmounted",
sunlight_propagates = true,
walkable = false,
climbable = true,
is_ground_content = false,
selection_box = {
type = "wallmounted",
},
groups = {crumbly = 3},
legacy_wallmounted = true,
})
-- flowing and sources
minetest.register_node("default:water_source", {
description = "Water Source",
drawtype = "liquid",
tiles = {"default_water.png"},
walkable = false,
pointable = false,
diggable = false,
buildable = false,
buildable_to = true,
paramtype = "light",
alpha = 160,
drowning = 1,
liquidtype = "source",
liquid_alternative_flowing = "default:water_flowing",
liquid_alternative_source = "default:water_source",
liquid_viscosity = 3,
groups = {liquid=3, water = 1},
post_effect_color = {a=100, r=0, g=64, b=200},
})
minetest.register_node("default:water_flowing", {
description = "Water Flowing",
tiles = {"default_water.png"},
special_tiles = {
{
name = "default_water.png",
backface_culling = false,
},
{
name = "default_water.png",
backface_culling = true,
},
},
walkable = false,
drawtype = "flowingliquid",
pointable = false,
diggable = false,
buildable = false,
buildable_to = true,
alpha = 160,
drowning = 1,
paramtype = "light",
liquidtype = "flowing",
liquid_alternative_flowing = "default:water_flowing",
liquid_alternative_source = "default:water_source",
liquid_viscosity = 3,
groups = {liquid=3, not_in_creative_inventory=1, water = 1},
post_effect_color = {a=100, r=0, g=64, b=200},
})
-- plants
minetest.register_node("default:plant_grass", {
description = "Grass (Plant)",
tiles = {"default_plant_grass.png"},
drawtype = "plantlike",
paramtype = "light",
invetory_image = "default_plant_grass.png",
builtable = false,
walkable = false,
groups = {crumbly = 3, plant = 1},
})
minetest.register_node("default:flower_1", {
description = "Flower",
tiles = {"default_flower_1.png"},
drawtype = "plantlike",
paramtype = "light",
invetory_image = "default_flower_1.png",
builtable = false,
walkable = false,
groups = {crumbly = 3, plant = 1},
})
minetest.register_node("default:flower_2", {
description = "Flower (glowing)",
tiles = {"default_flower_2.png"},
drawtype = "plantlike",
paramtype = "light",
invetory_image = "default_flower_2.png",
light_source = 10,
builtable = false,
walkable = false,
groups = {crumbly = 3, plant = 1},
})

319
mods/default/nodes.lua~ Normal file
View File

@ -0,0 +1,319 @@
minetest.register_node("default:dirt", {
description = "Dirt",
tiles = {"default_dirt.png"},
groups = {crumbly = 3},
})
minetest.register_node("default:sand", {
description = "Sand",
tiles = {"default_sand.png"},
groups = {crumbly = 3},
})
minetest.register_node("default:grass", {
description = "Grass",
tiles = {"default_grass.png"},
groups = {crumbly = 3},
})
minetest.register_node("default:stone", {
description = "Stone",
tiles = {"default_stone.png"},
groups = {cracky = 3},
drop = "default:stone_item 5",
})
minetest.register_node("default:stonebrick", {
description = "Stonebrick",
tiles = {"default_stonebrick.png"},
groups = {cracky = 3},
})
minetest.register_node("default:wet_stone", {
description = "Wet Stone",
tiles = {"default_wet_stone.png"},
groups = {cracky = 3},
drop = {"default:stone_item 5"},
})
minetest.register_node("default:stone_with_iron", {
description = "Stone with Iron",
tiles = {"default_stone_with_iron.png"},
groups = {cracky = 2},
drop = {"default:stone_item 2", "default:iron_lump"},
})
minetest.register_node("default:wood", {
description = "Wood",
tiles = {"default_wood.png"},
groups = {choppy = 3},
})
minetest.register_node("default:leaves_1", {
description = "leaves",
paramtype = "light",
drawtype = "allfaces",
tiles = {"default_leaves_1.png"},
groups = {crumbly = 3, leaves = 1},
walkable = false,
climbable = true,
})
minetest.register_node("default:stones_on_floor", {
description = "Stones on Floor",
tiles = {"default_stones_on_floor.png"},
groups = {snappy = 3},
paramtype = "light",
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5},
},
},
drop = "default:stone_item 2",
})
minetest.register_node("default:log_1", {
description = "Log (thick)",
tiles = {"default_log.png"},
groups = {choppy = 3},
paramtype = "light",
paramtype2 = "facedir",
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {
{-0.4, -0.5, -0.4, 0.4, 0.5, 0.4},
},
},
})
minetest.register_node("default:log_2", {
description = "Log",
tiles = {"default_log.png"},
groups = {choppy = 3},
paramtype = "light",
paramtype2 = "facedir",
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {
{-0.3, -0.5, -0.3, 0.3, 0.5, 0.3},
},
},
})
minetest.register_node("default:log_3", {
description = "Log (thin)",
tiles = {"default_log.png"},
groups = {choppy = 3},
paramtype = "light",
paramtype2 = "facedir",
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {
{-0.2, -0.5, -0.2, 0.2, 0.5, 0.2},
},
},
})
minetest.register_node("default:box", {
description = "Box",
tiles = {"default_log.png"},
groups = {choppy = 3},
paramtype = "light",
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5},
{-0.5, -0.5, -0.5, -0.4375, 0.5, 0.5},
{-0.5, -0.5, -0.5, 0.5, 0.5, -0.4375},
{-0.5, -0.5, 0.4375, 0.5, 0.5, 0.5},
{0.4375, -0.5, -0.5, 0.5, 0.5, 0.5},
},
},
})
minetest.register_node("default:treasure_chest", {
description = "Treasure Chest",
tiles = {"default_treasure_chest.png"},
groups = {choppy = 3},
drop = "default:stick 2",
on_construct = function(pos)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
inv:set_size("main", 8*4)
local items = {"default:dirt", "default:sand", "default:iron_lump", "default:stone_item", "default:coin"}
local item = items[math.random(5)]
inv:add_item("main", {name = item, count = math.random(2,10)})
local item = items[math.random(5)]
inv:add_item("main", {name = item, count = math.random(2,10)})
end,
after_dig_node = function(pos, oldnode, oldmetadata, digger)
local meta = minetest.get_meta(pos)
meta:from_table(oldmetadata)
local inv = meta:get_inventory()
for i = 1, inv:get_size("main") do
local stack = inv:get_stack("main", i)
if not stack:is_empty() then
local p = { x = pos.x + math.random(0, 5)/5 - 0.5,
y = pos.y,
z = pos.z + math.random(0, 5)/5 - 0.5
}
minetest.add_item(p, stack)
end
end
end
})
minetest.register_node("default:glass", {
description = "Glass",
tiles = {"default_glass.png"},
drawtype = "glasslike",
paramtype = "light",
groups = {crumbly = 3},
})
minetest.register_node("default:present", {
description = "Present",
tiles = {"default_present_top.png", "default_present_top.png", "default_present_side.png", "default_present_side.png", "default_present_side.png", "default_present_side.png"},
groups = {crumbly = 3},
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {
{-0.4, -0.5, -0.4, 0.4, 0, 0.4},
},
},
paramtype = "light",
})
minetest.register_node("default:present_big", {
description = "Present (big)",
tiles = {"default_present_top.png", "default_present_top.png", "default_present_side.png", "default_present_side.png", "default_present_side.png", "default_present_side.png"},
groups = {crumbly = 3},
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {
{-0.4, -0.5, -0.4, 0.4, 0.4, 0.4},
},
},
paramtype = "light",
})
minetest.register_node("default:ladder", {
description = "Ladder",
drawtype = "signlike",
tiles = {"default_ladder.png"},
inventory_image = "default_ladder.png",
wield_image = "default_ladder.png",
paramtype = "light",
paramtype2 = "wallmounted",
sunlight_propagates = true,
walkable = false,
climbable = true,
is_ground_content = false,
selection_box = {
type = "wallmounted",
},
groups = {crumbly = 3},
legacy_wallmounted = true,
})
-- flowing and sources
minetest.register_node("default:water_source", {
description = "Water Source",
drawtype = "liquid",
tiles = {"default_water.png"},
walkable = false,
pointable = false,
diggable = false,
buildable = false,
buildable_to = true,
paramtype = "light",
alpha = 160,
drowning = 1,
liquidtype = "source",
liquid_alternative_flowing = "default:water_flowing",
liquid_alternative_source = "default:water_source",
liquid_viscosity = 3,
groups = {liquid=3, water = 1},
post_effect_color = {a=100, r=0, g=64, b=200},
})
minetest.register_node("default:water_flowing", {
description = "Water Flowing",
tiles = {"default_water.png"},
special_tiles = {
{
name = "default_water.png",
backface_culling = false,
},
{
name = "default_water.png",
backface_culling = true,
},
},
walkable = false,
drawtype = "flowingliquid",
pointable = false,
diggable = false,
buildable = false,
buildable_to = true,
alpha = 160,
drowning = 1,
paramtype = "light",
liquidtype = "flowing",
liquid_alternative_flowing = "default:water_flowing",
liquid_alternative_source = "default:water_source",
liquid_viscosity = 3,
groups = {liquid=3, not_in_creative_inventory=1, water = 1},
post_effect_color = {a=100, r=0, g=64, b=200},
})
-- plants
minetest.register_node("default:plant_grass", {
description = "Grass (Plant)",
tiles = {"default_plant_grass.png"},
drawtype = "plantlike",
paramtype = "light",
invetory_image = "default_plant_grass.png",
builtable = false,
walkable = false,
groups = {crumbly = 3, plant = 1},
})
minetest.register_node("default:flower_1", {
description = "Flower",
tiles = {"default_flower_1.png"},
drawtype = "plantlike",
paramtype = "light",
invetory_image = "default_flower_1.png",
builtable = false,
walkable = false,
groups = {crumbly = 3, plant = 1},
})
minetest.register_node("default:flower_2", {
description = "Flower (glowing)",
tiles = {"default_flower_2.png"},
drawtype = "plantlike",
paramtype = "light",
invetory_image = "default_flower_2.png",
light_source = 10,
builtable = false,
walkable = false,
groups = {crumbly = 3, plant = 1},
})

35
mods/default/player.lua Normal file
View File

@ -0,0 +1,35 @@
function default.itemslot_bg(x,y,w,h)
local imgs = ""
for i = 0, w-1,1 do
for j=0, h-1,1 do
imgs = imgs .."image["..x+i..","..y+j..";1,1;gui_itemslot_bg.png]"
end
end
return imgs
end
default.inv_form = "size[8,7.5;]"
default.inv_form = default.inv_form.."listcolors[#00000000;#10101030;#00000000;#68B259;#FFF]"
default.inv_form = default.inv_form.."bgcolor[#a88e69FF;false]"
default.inv_form = default.inv_form.."list[current_player;main;0,3.5;8,4;]"
default.inv_form = default.inv_form..default.itemslot_bg(0,3.5,8,4)
default.inv_form = default.inv_form.."list[current_player;craft;1.5,0;3,3;]"
default.inv_form = default.inv_form..default.itemslot_bg(1.5,0,3,3)
default.inv_form = default.inv_form.."list[current_player;craftpreview;5,1;1,1;]"
default.inv_form = default.inv_form..default.itemslot_bg(5,1,1,1)
minetest.register_on_joinplayer(function(player)
player:hud_set_hotbar_image("gui_hotbar.png")
player:hud_set_hotbar_selected_image("gui_hotbar_selected.png")
player:set_inventory_formspec(default.inv_form)
-- Testing of HUD elements
player:hud_add({
hud_elem_type = "waypoint",
name = "spawn",
text = "",
number = 255,
world_pos = {x=0,y=0,z=0}
})
end)

35
mods/default/player.lua~ Normal file
View File

@ -0,0 +1,35 @@
function default.itemslot_bg(x,y,w,h)
local imgs = ""
for i = 0, w-1,1 do
for j=0, h-1,1 do
imgs = imgs .."image["..x+i..","..y+j..";1,1;gui_itemslot_bg.png]"
end
end
return imgs
end
default.inv_form = "size[8,7.5;]"
default.inv_form = default.inv_form.."listcolors[#00000000;#10101030;#00000000;#68B259;#FFF]"
default.inv_form = default.inv_form.."bgcolor[#a88e69FF;false]"
default.inv_form = default.inv_form.."list[current_player;main;0,3.5;8,4;]"
default.inv_form = default.inv_form..default.itemslot_bg(0,3.5,8,4)
default.inv_form = default.inv_form.."list[current_player;craft;1.5,0;3,3;]"
default.inv_form = default.inv_form..default.itemslot_bg(1.5,0,3,3)
default.inv_form = default.inv_form.."list[current_player;craftpreview;5,1;1,1;]"
default.inv_form = default.inv_form..default.itemslot_bg(5,1,1,1)
minetest.register_on_joinplayer(function(player)
player:hud_set_hotbar_image("gui_hotbar.png")
player:hud_set_hotbar_selected_image("gui_hotbar_selected.png")
player:set_inventory_formspec(default.inv_form)
-- Testing of HUD elements
player:hud_add({
hud_elem_type = "waypoint",
name = "spawn",
text = "",
number = 255,
world_pos = {x=0,y=0,z=0}
})
end)

Binary file not shown.

After

Width:  |  Height:  |  Size: 369 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 450 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 278 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 459 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 463 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 461 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 302 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 490 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 537 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 245 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 245 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 495 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 370 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 608 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 249 B

93
mods/default/tools.lua Normal file
View File

@ -0,0 +1,93 @@
minetest.register_item(":", {
type = "none",
wield_image = "wieldhand.png",
wield_scale = {x=1,y=1,z=2.5},
tool_capabilities = {
full_punch_interval = 0.9,
max_drop_level = 0,
groupcaps = {
crumbly = {times={[2]=3.00, [3]=0.70}, uses=0, maxlevel=1},
snappy = {times={[3]=0.40}, uses=0, maxlevel=1},
oddly_breakable_by_hand = {times={[1]=3.50,[2]=2.00,[3]=0.70}, uses=0}
},
damage_groups = {fleshy=2},
}
})
minetest.register_tool("default:basic_hammer", {
description = "Basic Hammer\n Level: - \n Damage: 8",
inventory_image = "default_basic_hammer.png",
tool_capabilities = {
max_drop_level=3,
groupcaps= {
cracky={times={[3]=1.00}, uses=10, maxlevel=1},
choppy={times={[2]=1.50, [3]=1.00}, uses=20, maxlevel=1}
},
damage_groups = {fleshy=8},
}
})
minetest.register_tool("default:axe_stone", {
description = "Stone Axe\n Level: - \n Damage: 5",
inventory_image = "default_axe_stone.png",
tool_capabilities = {
max_drop_level=3,
groupcaps= {
cracky={times={[3]=1.50}, uses=5, maxlevel=1},
choppy={times={[2]=3.50, [3]=1.10}, uses=10, maxlevel=1}
},
damage_groups = {fleshy=5},
}
})
minetest.register_tool("default:blade", {
description = "Blade\n Level: - \n Damage: 10",
inventory_image = "default_blade.png",
tool_capabilities = {
max_drop_level=3,
groupcaps= {
leaves={times={[1]=0.50}, uses=1000, maxlevel=1}
},
damage_groups = {fleshy=10},
}
})
minetest.register_tool("default:knife", {
description = "Knife\n Level: - \n Damage: 12",
inventory_image = "default_knife.png",
tool_capabilities = {
max_drop_level=3,
groupcaps= {
leaves={times={[1]=0.10}, uses=1000, maxlevel=1},
choppy={times={[3]=2.00}, uses=50, maxlevel=1}
},
damage_groups = {fleshy=12},
}
})
minetest.register_tool("default:knife_big", {
description = "Knife (big)\n Level: - \n Damage: 15",
inventory_image = "default_knife.png",
wield_scale = {x = 1.5, y=1.5, z = 1},
tool_capabilities = {
max_drop_level=3,
groupcaps= {
leaves={times={[1]=0.05}, uses=1000, maxlevel=1},
choppy={times={[3]=2.00}, uses=50, maxlevel=1}
},
damage_groups = {fleshy=15},
}
})
minetest.register_tool("default:leaves_cutter", {
description = "Leaves Cutter",
inventory_image = "default_leaves_cutter.png",
tool_capabilities = {
max_drop_level=3,
groupcaps= {
leaves={times={[1]=0.10}, uses=1000, maxlevel=1},
choppy={times={[3]=2.00}, uses=50, maxlevel=1}
}
}
})

93
mods/default/tools.lua~ Normal file
View File

@ -0,0 +1,93 @@
minetest.register_item(":", {
type = "none",
wield_image = "wieldhand.png",
wield_scale = {x=1,y=1,z=2.5},
tool_capabilities = {
full_punch_interval = 0.9,
max_drop_level = 0,
groupcaps = {
crumbly = {times={[2]=3.00, [3]=0.70}, uses=0, maxlevel=1},
snappy = {times={[3]=0.40}, uses=0, maxlevel=1},
oddly_breakable_by_hand = {times={[1]=3.50,[2]=2.00,[3]=0.70}, uses=0}
},
damage_groups = {fleshy=2},
}
})
minetest.register_tool("default:basic_hammer", {
description = "Basic Hammer\n Level: - \n Damage: 8",
inventory_image = "default_basic_hammer.png",
tool_capabilities = {
max_drop_level=3,
groupcaps= {
cracky={times={[3]=1.00}, uses=10, maxlevel=1},
choppy={times={[2]=1.50, [3]=1.00}, uses=20, maxlevel=1}
},
damage_groups = {fleshy=8},
}
})
minetest.register_tool("default:axe_stone", {
description = "Stone Axe\n Level: - \n Damage: 5",
inventory_image = "default_axe_stone.png",
tool_capabilities = {
max_drop_level=3,
groupcaps= {
cracky={times={[3]=1.50}, uses=5, maxlevel=1},
choppy={times={[2]=3.50, [3]=1.10}, uses=10, maxlevel=1}
},
damage_groups = {fleshy=5},
}
})
minetest.register_tool("default:blade", {
description = "Blade\n Level: - \n Damage: 10",
inventory_image = "default_blade.png",
tool_capabilities = {
max_drop_level=3,
groupcaps= {
leaves={times={[1]=0.50}, uses=1000, maxlevel=1}
},
damage_groups = {fleshy=10},
}
})
minetest.register_tool("default:knife", {
description = "Knife\n Level: - \n Damage: 12",
inventory_image = "default_knife.png",
tool_capabilities = {
max_drop_level=3,
groupcaps= {
leaves={times={[1]=0.10}, uses=1000, maxlevel=1},
choppy={times={[3]=2.00}, uses=50, maxlevel=1}
},
damage_groups = {fleshy=12},
}
})
minetest.register_tool("default:knife_big", {
description = "Knife (big)\n Level: - \n Damage: 15",
inventory_image = "default_knife.png",
wield_scale = {x = 1.5, y=1.5, z = 1},
tool_capabilities = {
max_drop_level=3,
groupcaps= {
leaves={times={[1]=0.05}, uses=1000, maxlevel=1},
choppy={times={[3]=2.00}, uses=50, maxlevel=1}
},
damage_groups = {fleshy=15},
}
})
minetest.register_tool("default:leaves_cutter", {
description = "Leaves Cutter",
inventory_image = "default_leaves_cutter.png",
tool_capabilities = {
max_drop_level=3,
groupcaps= {
leaves={times={[1]=0.10}, uses=1000, maxlevel=1},
choppy={times={[3]=2.00}, uses=50, maxlevel=1}
}
}
})

View File

@ -0,0 +1,16 @@
License for Code
----------------
Copyright (C) 2015 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)

View File

@ -0,0 +1,72 @@
minetest.register_craftitem("legendary_items:paper", {
description = "The Legendary Paper",
inventory_image = "legendary_items_paper.png",
})
minetest.register_craftitem("legendary_items:paper_green", {
description = "Green Paper (rare)",
inventory_image = "legendary_items_paper_green.png",
})
minetest.register_craftitem("legendary_items:teleporting", {
description = "Stick of Teleporting",
inventory_image = "legendary_items_tp.png",
on_place = function(itemstack, placer, pointed_thing)
if not placer or not placer:is_player() then
return
end
placer:setpos(pointed_thing.above)
minetest.add_particlespawner({
amount = 50,
time = 1,
minpos = {x=pointed_thing.above.x, y=pointed_thing.above.y, z=pointed_thing.above.z},
maxpos = {x=pointed_thing.above.x, y=pointed_thing.above.y, z=pointed_thing.above.z},
minvel = {x=-2, y=-2, z=-2},
maxvel = {x=2, y=4, z=2},
minacc = {x=-2, y=-2, z=-2},
maxacc = {x=2, y=4, z=2},
minexptime = 1,
maxexptime = 1,
minsize = 1,
maxsize = 1,
collisiondetection = false,
vertical = false,
texture = "heart.png",
})
end,
})
minetest.register_tool("legendary_items:sword", {
description = "The Legendary Sword",
inventory_image = "legendary_items_sword.png",
wield_scale = {x = 2, y=2, z = 1},
tool_capabilities = {
max_drop_level=3,
damage_groups = {fleshy=50},
},
on_place = function(itemstack, placer, pointed_thing)
if not placer or not placer:is_player() then
return
end
placer:set_hp(placer:get_hp()+8)
minetest.add_particlespawner({
amount = 50,
time = 1,
minpos = {x=pointed_thing.above.x, y=pointed_thing.above.y, z=pointed_thing.above.z},
maxpos = {x=pointed_thing.above.x, y=pointed_thing.above.y, z=pointed_thing.above.z},
minvel = {x=-2, y=-2, z=-2},
maxvel = {x=2, y=4, z=2},
minacc = {x=-2, y=-2, z=-2},
maxacc = {x=2, y=4, z=2},
minexptime = 1,
maxexptime = 1,
minsize = 1,
maxsize = 1,
collisiondetection = false,
vertical = false,
texture = "heart.png",
})
end,
})

View File

@ -0,0 +1,72 @@
minetest.register_craftitem("legendary_items:paper", {
description = "The Legendary Paper",
inventory_image = "legendary_items_paper.png",
})
minetest.register_craftitem("legendary_items:paper_green", {
description = "Green Paper (rare)",
inventory_image = "legendary_items_paper_green.png",
})
minetest.register_craftitem("legendary_items:teleporting", {
description = "Stick of Teleporting",
inventory_image = "legendary_items_tp.png",
on_place = function(itemstack, placer, pointed_thing)
if not placer or not placer:is_player() then
return
end
placer:setpos(pointed_thing.above)
minetest.add_particlespawner({
amount = 50,
time = 1,
minpos = {x=pointed_thing.above.x, y=pointed_thing.above.y, z=pointed_thing.above.z},
maxpos = {x=pointed_thing.above.x, y=pointed_thing.above.y, z=pointed_thing.above.z},
minvel = {x=-2, y=-2, z=-2},
maxvel = {x=2, y=4, z=2},
minacc = {x=-2, y=-2, z=-2},
maxacc = {x=2, y=4, z=2},
minexptime = 1,
maxexptime = 1,
minsize = 1,
maxsize = 1,
collisiondetection = false,
vertical = false,
texture = "heart.png",
})
end,
})
minetest.register_tool("legendary_items:sword", {
description = "The Legendary Sword",
inventory_image = "legendary_items_sword.png",
wield_scale = {x = 2, y=2, z = 1},
tool_capabilities = {
max_drop_level=3,
damage_groups = {fleshy=50},
},
on_place = function(itemstack, placer, pointed_thing)
if not placer or not placer:is_player() then
return
end
placer:set_hp(placer:get_hp()+8)
minetest.add_particlespawner({
amount = 50,
time = 1,
minpos = {x=pointed_thing.above.x, y=pointed_thing.above.y, z=pointed_thing.above.z},
maxpos = {x=pointed_thing.above.x, y=pointed_thing.above.y, z=pointed_thing.above.z},
minvel = {x=-2, y=-2, z=-2},
maxvel = {x=2, y=4, z=2},
minacc = {x=-2, y=-2, z=-2},
maxacc = {x=2, y=4, z=2},
minexptime = 1,
maxexptime = 1,
minsize = 1,
maxsize = 1,
collisiondetection = false,
vertical = false,
texture = "heart.png",
})
end,
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 450 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 444 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 B

16
mods/mobs/LICENSE.txt Normal file
View File

@ -0,0 +1,16 @@
License for Code
----------------
Copyright (C) 2015 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)

57
mods/mobs/init.lua Normal file
View File

@ -0,0 +1,57 @@
local function get_velocity(v, yaw, y)
local x = -math.sin(yaw) * v
local z = math.cos(yaw) * v
return {x = x, y = y, z = z}
end
minetest.register_entity("mobs:angry_block", {
hp_max = 30,
physical = true,
collisionbox = {-0.5,-0.5,-0.5, 0.5,0.5,0.5},
visual = "cube",
visual_size = {x=1, y=1},
textures = {"mobs_angry_block_top.png", "mobs_angry_block_top.png", "mobs_angry_block.png", "mobs_angry_block.png", "mobs_angry_block.png", "mobs_angry_block.png"},
spritediv = {x=1, y=1},
initial_sprite_basepos = {x=0, y=0},
is_visible = true,
makes_footstep_sound = false,
automatic_rotate = true,
speed = 0,
pl = nil,
on_punch = function(self, puncher, time_from_last_punch, tool_capabilities, direction)
if not puncher or not puncher:is_player() then
return
end
self.pl = puncher
end,
on_step = function(self, dtime)
if math.random(0, 50) == 15 then
self.object:setvelocity({x=math.random(-2, 2), y=-1, z=math.random(-2, 2)})
if self.pl ~= nil then
self.pl:set_hp(self.pl:get_hp()-3)
if vector.distance(self.object:getpos(), self.pl:getpos()) > 5 then
self.pl = nil
end
end
end
end,
})
minetest.register_craftitem("mobs:angry_block", {
description = "Angry Block",
inventory_image = "[inventorycube{mobs_angry_block_top.png{mobs_angry_block.png{mobs_angry_block.png",
on_place = function(itemstack, placer, pointed_thing)
if pointed_thing.type ~= "node" then
return
end
minetest.add_entity(pointed_thing.above, "mobs:angry_block")
if not minetest.setting_getbool("creative_mode") then
itemstack:take_item()
end
return itemstack
end,
})

57
mods/mobs/init.lua~ Normal file
View File

@ -0,0 +1,57 @@
local function get_velocity(v, yaw, y)
local x = -math.sin(yaw) * v
local z = math.cos(yaw) * v
return {x = x, y = y, z = z}
end
minetest.register_entity("mobs:angry_block", {
hp_max = 30,
physical = true,
collisionbox = {-0.5,-0.5,-0.5, 0.5,0.5,0.5},
visual = "cube",
visual_size = {x=1, y=1},
textures = {"mobs_angry_block_top.png", "mobs_angry_block_top.png", "mobs_angry_block.png", "mobs_angry_block.png", "mobs_angry_block.png", "mobs_angry_block.png"},
spritediv = {x=1, y=1},
initial_sprite_basepos = {x=0, y=0},
is_visible = true,
makes_footstep_sound = false,
automatic_rotate = true,
speed = 0,
pl = nil,
on_punch = function(self, puncher, time_from_last_punch, tool_capabilities, direction)
if not puncher or not puncher:is_player() then
return
end
self.pl = puncher
end,
on_step = function(self, dtime)
if math.random(0, 50) == 15 then
self.object:setvelocity({x=math.random(-2, 2), y=-1, z=math.random(-2, 2)})
if self.pl ~= nil then
self.pl:set_hp(self.pl:get_hp()-3)
if vector.distance(self.object:getpos(), self.pl:getpos()) > 5 then
self.pl = nil
end
end
end
end,
})
minetest.register_craftitem("mobs:angry_block", {
description = "Angry Block",
inventory_image = "[inventorycube{mobs_angry_block_top.png{mobs_angry_block.png{mobs_angry_block.png",
on_place = function(itemstack, placer, pointed_thing)
if pointed_thing.type ~= "node" then
return
end
minetest.add_entity(pointed_thing.above, "mobs:angry_block")
if not minetest.setting_getbool("creative_mode") then
itemstack:take_item()
end
return itemstack
end,
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 B

16
mods/potions/LICENSE.txt Normal file
View File

@ -0,0 +1,16 @@
License for Code
----------------
Copyright (C) 2015 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)

2
mods/potions/depends.txt Normal file
View File

@ -0,0 +1,2 @@
default
central_message

View File

@ -0,0 +1,2 @@
default
central_message

114
mods/potions/init.lua Normal file
View File

@ -0,0 +1,114 @@
minetest.register_craftitem("potions:healing", {
description = "Potion of Healing",
inventory_image = "potions_red.png",
on_drop = function(itemstack, dropper, pos)
if not dropper or not dropper:is_player() then
return
end
dropper:set_hp(dropper:get_hp()+10)
itemstack:take_item()
return itemstack
end,
on_use = function(itemstack, user, pointed_thing)
if not user or not user:is_player() then
return
end
user:set_hp(user:get_hp()+10)
itemstack:take_item()
return itemstack
end,
})
minetest.register_craftitem("potions:jumping", {
description = "Potion of Jumping",
inventory_image = "potions_blue.png",
on_drop = function(itemstack, dropper, pos)
if not dropper or not dropper:is_player() then
return
end
dropper:set_physics_override({
gravity = 0.1,
})
minetest.after(10.0, function(pl)
if not pl or not pl:is_player() then
return
end
pl:set_physics_override({
gravity = 1,
})
end, dropper)
itemstack:take_item()
return itemstack
end,
on_use = function(itemstack, user, pointed_thing)
if not user or not user:is_player() then
return
end
user:set_physics_override({
gravity = 0.1,
})
minetest.after(10.0, function(pl)
if not pl or not pl:is_player() then
return
end
pl:set_physics_override({
gravity = 1,
})
end, user)
itemstack:take_item()
return itemstack
end,
})
minetest.register_craftitem("potions:running", {
description = "Potion of Running",
inventory_image = "potions_yellow.png",
on_drop = function(itemstack, dropper, pos)
if not dropper or not dropper:is_player() then
return
end
dropper:set_physics_override({
speed = 3,
})
minetest.after(10.0, function(pl)
if not pl or not pl:is_player() then
return
end
pl:set_physics_override({
speed = 1,
})
end, dropper)
itemstack:take_item()
return itemstack
end,
on_use = function(itemstack, user, pointed_thing)
if not user or not user:is_player() then
return
end
user:set_physics_override({
speed = 3,
})
minetest.after(10.0, function(pl)
if not pl or not pl:is_player() then
return
end
pl:set_physics_override({
speed = 1,
})
end, user)
itemstack:take_item()
return itemstack
end,
})

114
mods/potions/init.lua~ Normal file
View File

@ -0,0 +1,114 @@
minetest.register_craftitem("potions:healing", {
description = "Potion of Healing",
inventory_image = "potions_red.png",
on_drop = function(itemstack, dropper, pos)
if not dropper or not dropper:is_player() then
return
end
dropper:set_hp(dropper:get_hp()+10)
itemstack:take_item()
return itemstack
end,
on_use = function(itemstack, user, pointed_thing)
if not user or not user:is_player() then
return
end
user:set_hp(user:get_hp()+10)
itemstack:take_item()
return itemstack
end,
})
minetest.register_craftitem("potions:jumping", {
description = "Potion of Jumping",
inventory_image = "potions_blue.png",
on_drop = function(itemstack, dropper, pos)
if not dropper or not dropper:is_player() then
return
end
dropper:set_physics_override({
gravity = 0.1,
})
minetest.after(10.0, function(pl)
if not pl or not pl:is_player() then
return
end
pl:set_physics_override({
gravity = 1,
})
end, dropper)
itemstack:take_item()
return itemstack
end,
on_use = function(itemstack, user, pointed_thing)
if not user or not user:is_player() then
return
end
user:set_physics_override({
gravity = 0.1,
})
minetest.after(10.0, function(pl)
if not pl or not pl:is_player() then
return
end
pl:set_physics_override({
gravity = 1,
})
end, user)
itemstack:take_item()
return itemstack
end,
})
minetest.register_craftitem("potions:running", {
description = "Potion of Running",
inventory_image = "potions_yellow.png",
on_drop = function(itemstack, dropper, pos)
if not dropper or not dropper:is_player() then
return
end
dropper:set_physics_override({
speed = 3,
})
minetest.after(10.0, function(pl)
if not pl or not pl:is_player() then
return
end
pl:set_physics_override({
speed = 1,
})
end, dropper)
itemstack:take_item()
return itemstack
end,
on_use = function(itemstack, user, pointed_thing)
if not user or not user:is_player() then
return
end
user:set_physics_override({
speed = 3,
})
minetest.after(10.0, function(pl)
if not pl or not pl:is_player() then
return
end
pl:set_physics_override({
speed = 1,
})
end, user)
itemstack:take_item()
return itemstack
end,
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 B

16
mods/quests/LICENSE.txt Normal file
View File

@ -0,0 +1,16 @@
License for Code
----------------
Copyright (C) 2015 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)

2
mods/quests/depends.txt Normal file
View File

@ -0,0 +1,2 @@
default
central_message

Some files were not shown because too many files have changed in this diff Show More