commit b1b82636e9cb1312b781e0c7be6b22298b4d3c13 Author: cale Date: Thu Dec 31 11:01:14 2015 +0100 uploaded diff --git a/game.conf b/game.conf new file mode 100644 index 0000000..acd72d0 --- /dev/null +++ b/game.conf @@ -0,0 +1 @@ +name = rpgtest diff --git a/game.conf~ b/game.conf~ new file mode 100644 index 0000000..acd72d0 --- /dev/null +++ b/game.conf~ @@ -0,0 +1 @@ +name = rpgtest diff --git a/mods/central_message/README.md b/mods/central_message/README.md new file mode 100644 index 0000000..f4fc0d6 --- /dev/null +++ b/mods/central_message/README.md @@ -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`. diff --git a/mods/central_message/depends.txt b/mods/central_message/depends.txt new file mode 100644 index 0000000..e69de29 diff --git a/mods/central_message/description.txt b/mods/central_message/description.txt new file mode 100644 index 0000000..4a6c5db --- /dev/null +++ b/mods/central_message/description.txt @@ -0,0 +1 @@ +Simple API to show messages to the center of the screen to players. diff --git a/mods/central_message/init.lua b/mods/central_message/init.lua new file mode 100644 index 0000000..b4482b8 --- /dev/null +++ b/mods/central_message/init.lua @@ -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 diff --git a/mods/classes/LICENSE.txt b/mods/classes/LICENSE.txt new file mode 100644 index 0000000..cca02cd --- /dev/null +++ b/mods/classes/LICENSE.txt @@ -0,0 +1,16 @@ +License for Code +---------------- + +Copyright (C) 2015 cd2 (cdqwertz) + +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) diff --git a/mods/classes/depends.txt b/mods/classes/depends.txt new file mode 100644 index 0000000..3b93871 --- /dev/null +++ b/mods/classes/depends.txt @@ -0,0 +1,3 @@ +default +legendary_items +mobs diff --git a/mods/classes/depends.txt~ b/mods/classes/depends.txt~ new file mode 100644 index 0000000..3b93871 --- /dev/null +++ b/mods/classes/depends.txt~ @@ -0,0 +1,3 @@ +default +legendary_items +mobs diff --git a/mods/classes/init.lua b/mods/classes/init.lua new file mode 100644 index 0000000..87671ec --- /dev/null +++ b/mods/classes/init.lua @@ -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", +}) + diff --git a/mods/classes/init.lua~ b/mods/classes/init.lua~ new file mode 100644 index 0000000..87671ec --- /dev/null +++ b/mods/classes/init.lua~ @@ -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", +}) + diff --git a/mods/classes/textures/classes_chemical_spear.png b/mods/classes/textures/classes_chemical_spear.png new file mode 100644 index 0000000..53b4c35 Binary files /dev/null and b/mods/classes/textures/classes_chemical_spear.png differ diff --git a/mods/classes/textures/classes_hoe.png b/mods/classes/textures/classes_hoe.png new file mode 100644 index 0000000..870ffca Binary files /dev/null and b/mods/classes/textures/classes_hoe.png differ diff --git a/mods/classes/textures/classes_spear.png b/mods/classes/textures/classes_spear.png new file mode 100644 index 0000000..137d578 Binary files /dev/null and b/mods/classes/textures/classes_spear.png differ diff --git a/mods/decor/depends.txt b/mods/decor/depends.txt new file mode 100644 index 0000000..3b93871 --- /dev/null +++ b/mods/decor/depends.txt @@ -0,0 +1,3 @@ +default +legendary_items +mobs diff --git a/mods/decor/depends.txt~ b/mods/decor/depends.txt~ new file mode 100644 index 0000000..3b93871 --- /dev/null +++ b/mods/decor/depends.txt~ @@ -0,0 +1,3 @@ +default +legendary_items +mobs diff --git a/mods/decor/init.lua b/mods/decor/init.lua new file mode 100644 index 0000000..e69de29 diff --git a/mods/decor/init.lua~ b/mods/decor/init.lua~ new file mode 100644 index 0000000..e69de29 diff --git a/mods/default/LICENSE.txt b/mods/default/LICENSE.txt new file mode 100644 index 0000000..cca02cd --- /dev/null +++ b/mods/default/LICENSE.txt @@ -0,0 +1,16 @@ +License for Code +---------------- + +Copyright (C) 2015 cd2 (cdqwertz) + +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) diff --git a/mods/default/craft.lua b/mods/default/craft.lua new file mode 100644 index 0000000..f96fb55 --- /dev/null +++ b/mods/default/craft.lua @@ -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", ""}, + } +}) diff --git a/mods/default/craft.lua~ b/mods/default/craft.lua~ new file mode 100644 index 0000000..f96fb55 --- /dev/null +++ b/mods/default/craft.lua~ @@ -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", ""}, + } +}) diff --git a/mods/default/craftitems.lua b/mods/default/craftitems.lua new file mode 100644 index 0000000..ab6f538 --- /dev/null +++ b/mods/default/craftitems.lua @@ -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, +}) diff --git a/mods/default/craftitems.lua~ b/mods/default/craftitems.lua~ new file mode 100644 index 0000000..ab6f538 --- /dev/null +++ b/mods/default/craftitems.lua~ @@ -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, +}) diff --git a/mods/default/init.lua b/mods/default/init.lua new file mode 100644 index 0000000..18d5fab --- /dev/null +++ b/mods/default/init.lua @@ -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") diff --git a/mods/default/init.lua~ b/mods/default/init.lua~ new file mode 100644 index 0000000..18d5fab --- /dev/null +++ b/mods/default/init.lua~ @@ -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") diff --git a/mods/default/mapgen.lua b/mods/default/mapgen.lua new file mode 100644 index 0000000..41787fb --- /dev/null +++ b/mods/default/mapgen.lua @@ -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, +}) + + + diff --git a/mods/default/mapgen.lua~ b/mods/default/mapgen.lua~ new file mode 100644 index 0000000..41787fb --- /dev/null +++ b/mods/default/mapgen.lua~ @@ -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, +}) + + + diff --git a/mods/default/nodes.lua b/mods/default/nodes.lua new file mode 100644 index 0000000..56e7480 --- /dev/null +++ b/mods/default/nodes.lua @@ -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}, +}) diff --git a/mods/default/nodes.lua~ b/mods/default/nodes.lua~ new file mode 100644 index 0000000..56e7480 --- /dev/null +++ b/mods/default/nodes.lua~ @@ -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}, +}) diff --git a/mods/default/player.lua b/mods/default/player.lua new file mode 100644 index 0000000..c6e9c01 --- /dev/null +++ b/mods/default/player.lua @@ -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) + diff --git a/mods/default/player.lua~ b/mods/default/player.lua~ new file mode 100644 index 0000000..c6e9c01 --- /dev/null +++ b/mods/default/player.lua~ @@ -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) + diff --git a/mods/default/textures/bubble.png b/mods/default/textures/bubble.png new file mode 100644 index 0000000..c34f144 Binary files /dev/null and b/mods/default/textures/bubble.png differ diff --git a/mods/default/textures/crack_anylength.png b/mods/default/textures/crack_anylength.png new file mode 100644 index 0000000..d62f8ba Binary files /dev/null and b/mods/default/textures/crack_anylength.png differ diff --git a/mods/default/textures/default_alt_dirt.png b/mods/default/textures/default_alt_dirt.png new file mode 100644 index 0000000..d8125d1 Binary files /dev/null and b/mods/default/textures/default_alt_dirt.png differ diff --git a/mods/default/textures/default_axe_stone.png b/mods/default/textures/default_axe_stone.png new file mode 100644 index 0000000..62dfd70 Binary files /dev/null and b/mods/default/textures/default_axe_stone.png differ diff --git a/mods/default/textures/default_basic_hammer.png b/mods/default/textures/default_basic_hammer.png new file mode 100644 index 0000000..a5e6bee Binary files /dev/null and b/mods/default/textures/default_basic_hammer.png differ diff --git a/mods/default/textures/default_blade.png b/mods/default/textures/default_blade.png new file mode 100644 index 0000000..bc479f9 Binary files /dev/null and b/mods/default/textures/default_blade.png differ diff --git a/mods/default/textures/default_coin.png b/mods/default/textures/default_coin.png new file mode 100644 index 0000000..396a360 Binary files /dev/null and b/mods/default/textures/default_coin.png differ diff --git a/mods/default/textures/default_dirt.png b/mods/default/textures/default_dirt.png new file mode 100644 index 0000000..d3df41d Binary files /dev/null and b/mods/default/textures/default_dirt.png differ diff --git a/mods/default/textures/default_dry_grass.png b/mods/default/textures/default_dry_grass.png new file mode 100644 index 0000000..7e081c6 Binary files /dev/null and b/mods/default/textures/default_dry_grass.png differ diff --git a/mods/default/textures/default_flower_1.png b/mods/default/textures/default_flower_1.png new file mode 100644 index 0000000..3c717a4 Binary files /dev/null and b/mods/default/textures/default_flower_1.png differ diff --git a/mods/default/textures/default_flower_2.png b/mods/default/textures/default_flower_2.png new file mode 100644 index 0000000..03195b6 Binary files /dev/null and b/mods/default/textures/default_flower_2.png differ diff --git a/mods/default/textures/default_glass.png b/mods/default/textures/default_glass.png new file mode 100644 index 0000000..a076454 Binary files /dev/null and b/mods/default/textures/default_glass.png differ diff --git a/mods/default/textures/default_grass.png b/mods/default/textures/default_grass.png new file mode 100644 index 0000000..dda28e1 Binary files /dev/null and b/mods/default/textures/default_grass.png differ diff --git a/mods/default/textures/default_iron_lump.png b/mods/default/textures/default_iron_lump.png new file mode 100644 index 0000000..93022e9 Binary files /dev/null and b/mods/default/textures/default_iron_lump.png differ diff --git a/mods/default/textures/default_knife.png b/mods/default/textures/default_knife.png new file mode 100644 index 0000000..17fff68 Binary files /dev/null and b/mods/default/textures/default_knife.png differ diff --git a/mods/default/textures/default_ladder.png b/mods/default/textures/default_ladder.png new file mode 100644 index 0000000..48e3d68 Binary files /dev/null and b/mods/default/textures/default_ladder.png differ diff --git a/mods/default/textures/default_leaves_1.png b/mods/default/textures/default_leaves_1.png new file mode 100644 index 0000000..fe4a920 Binary files /dev/null and b/mods/default/textures/default_leaves_1.png differ diff --git a/mods/default/textures/default_leaves_cutter.png b/mods/default/textures/default_leaves_cutter.png new file mode 100644 index 0000000..eee1596 Binary files /dev/null and b/mods/default/textures/default_leaves_cutter.png differ diff --git a/mods/default/textures/default_log.png b/mods/default/textures/default_log.png new file mode 100644 index 0000000..4a4f3b3 Binary files /dev/null and b/mods/default/textures/default_log.png differ diff --git a/mods/default/textures/default_plant_grass.png b/mods/default/textures/default_plant_grass.png new file mode 100644 index 0000000..8980d58 Binary files /dev/null and b/mods/default/textures/default_plant_grass.png differ diff --git a/mods/default/textures/default_present_side.png b/mods/default/textures/default_present_side.png new file mode 100644 index 0000000..7366019 Binary files /dev/null and b/mods/default/textures/default_present_side.png differ diff --git a/mods/default/textures/default_present_top.png b/mods/default/textures/default_present_top.png new file mode 100644 index 0000000..76e09b7 Binary files /dev/null and b/mods/default/textures/default_present_top.png differ diff --git a/mods/default/textures/default_sand.png b/mods/default/textures/default_sand.png new file mode 100644 index 0000000..a91958e Binary files /dev/null and b/mods/default/textures/default_sand.png differ diff --git a/mods/default/textures/default_stone.png b/mods/default/textures/default_stone.png new file mode 100644 index 0000000..db9839a Binary files /dev/null and b/mods/default/textures/default_stone.png differ diff --git a/mods/default/textures/default_stone_item.png b/mods/default/textures/default_stone_item.png new file mode 100644 index 0000000..ac28a29 Binary files /dev/null and b/mods/default/textures/default_stone_item.png differ diff --git a/mods/default/textures/default_stone_with_iron.png b/mods/default/textures/default_stone_with_iron.png new file mode 100644 index 0000000..8a73521 Binary files /dev/null and b/mods/default/textures/default_stone_with_iron.png differ diff --git a/mods/default/textures/default_stonebrick.png b/mods/default/textures/default_stonebrick.png new file mode 100644 index 0000000..0757808 Binary files /dev/null and b/mods/default/textures/default_stonebrick.png differ diff --git a/mods/default/textures/default_stones_on_floor.png b/mods/default/textures/default_stones_on_floor.png new file mode 100644 index 0000000..4701103 Binary files /dev/null and b/mods/default/textures/default_stones_on_floor.png differ diff --git a/mods/default/textures/default_string.png b/mods/default/textures/default_string.png new file mode 100644 index 0000000..3350d0c Binary files /dev/null and b/mods/default/textures/default_string.png differ diff --git a/mods/default/textures/default_string_strong.png b/mods/default/textures/default_string_strong.png new file mode 100644 index 0000000..b99501b Binary files /dev/null and b/mods/default/textures/default_string_strong.png differ diff --git a/mods/default/textures/default_treasure_chest.png b/mods/default/textures/default_treasure_chest.png new file mode 100644 index 0000000..cad8daf Binary files /dev/null and b/mods/default/textures/default_treasure_chest.png differ diff --git a/mods/default/textures/default_water.png b/mods/default/textures/default_water.png new file mode 100644 index 0000000..67dbace Binary files /dev/null and b/mods/default/textures/default_water.png differ diff --git a/mods/default/textures/default_wet_sand.png b/mods/default/textures/default_wet_sand.png new file mode 100644 index 0000000..b78c1fc Binary files /dev/null and b/mods/default/textures/default_wet_sand.png differ diff --git a/mods/default/textures/default_wet_stone.png b/mods/default/textures/default_wet_stone.png new file mode 100644 index 0000000..6ac679e Binary files /dev/null and b/mods/default/textures/default_wet_stone.png differ diff --git a/mods/default/textures/default_wood.png b/mods/default/textures/default_wood.png new file mode 100644 index 0000000..4ebbb39 Binary files /dev/null and b/mods/default/textures/default_wood.png differ diff --git a/mods/default/textures/default_xp.png b/mods/default/textures/default_xp.png new file mode 100644 index 0000000..1928b37 Binary files /dev/null and b/mods/default/textures/default_xp.png differ diff --git a/mods/default/textures/gui_bg.png b/mods/default/textures/gui_bg.png new file mode 100644 index 0000000..a66c641 Binary files /dev/null and b/mods/default/textures/gui_bg.png differ diff --git a/mods/default/textures/gui_hotbar.png b/mods/default/textures/gui_hotbar.png new file mode 100644 index 0000000..c5362f9 Binary files /dev/null and b/mods/default/textures/gui_hotbar.png differ diff --git a/mods/default/textures/gui_hotbar_selected.png b/mods/default/textures/gui_hotbar_selected.png new file mode 100644 index 0000000..0528f9d Binary files /dev/null and b/mods/default/textures/gui_hotbar_selected.png differ diff --git a/mods/default/textures/gui_itemslot_bg.png b/mods/default/textures/gui_itemslot_bg.png new file mode 100644 index 0000000..d37e1ef Binary files /dev/null and b/mods/default/textures/gui_itemslot_bg.png differ diff --git a/mods/default/textures/heart.png b/mods/default/textures/heart.png new file mode 100644 index 0000000..70ef96a Binary files /dev/null and b/mods/default/textures/heart.png differ diff --git a/mods/default/textures/player.png b/mods/default/textures/player.png new file mode 100644 index 0000000..72b3f72 Binary files /dev/null and b/mods/default/textures/player.png differ diff --git a/mods/default/textures/player_back.png b/mods/default/textures/player_back.png new file mode 100644 index 0000000..672b5b7 Binary files /dev/null and b/mods/default/textures/player_back.png differ diff --git a/mods/default/textures/wieldhand.png b/mods/default/textures/wieldhand.png new file mode 100644 index 0000000..0c90e12 Binary files /dev/null and b/mods/default/textures/wieldhand.png differ diff --git a/mods/default/tools.lua b/mods/default/tools.lua new file mode 100644 index 0000000..a3f0e0b --- /dev/null +++ b/mods/default/tools.lua @@ -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} + } + } +}) diff --git a/mods/default/tools.lua~ b/mods/default/tools.lua~ new file mode 100644 index 0000000..a3f0e0b --- /dev/null +++ b/mods/default/tools.lua~ @@ -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} + } + } +}) diff --git a/mods/legendary_items/LICENSE.txt b/mods/legendary_items/LICENSE.txt new file mode 100644 index 0000000..cca02cd --- /dev/null +++ b/mods/legendary_items/LICENSE.txt @@ -0,0 +1,16 @@ +License for Code +---------------- + +Copyright (C) 2015 cd2 (cdqwertz) + +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) diff --git a/mods/legendary_items/init.lua b/mods/legendary_items/init.lua new file mode 100644 index 0000000..c2af889 --- /dev/null +++ b/mods/legendary_items/init.lua @@ -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, +}) + + diff --git a/mods/legendary_items/init.lua~ b/mods/legendary_items/init.lua~ new file mode 100644 index 0000000..c2af889 --- /dev/null +++ b/mods/legendary_items/init.lua~ @@ -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, +}) + + diff --git a/mods/legendary_items/textures/legendary_items_paper.png b/mods/legendary_items/textures/legendary_items_paper.png new file mode 100644 index 0000000..3463389 Binary files /dev/null and b/mods/legendary_items/textures/legendary_items_paper.png differ diff --git a/mods/legendary_items/textures/legendary_items_paper_green.png b/mods/legendary_items/textures/legendary_items_paper_green.png new file mode 100644 index 0000000..ce951be Binary files /dev/null and b/mods/legendary_items/textures/legendary_items_paper_green.png differ diff --git a/mods/legendary_items/textures/legendary_items_sword.png b/mods/legendary_items/textures/legendary_items_sword.png new file mode 100644 index 0000000..53ed75f Binary files /dev/null and b/mods/legendary_items/textures/legendary_items_sword.png differ diff --git a/mods/legendary_items/textures/legendary_items_tp.png b/mods/legendary_items/textures/legendary_items_tp.png new file mode 100644 index 0000000..a48640c Binary files /dev/null and b/mods/legendary_items/textures/legendary_items_tp.png differ diff --git a/mods/mobs/LICENSE.txt b/mods/mobs/LICENSE.txt new file mode 100644 index 0000000..cca02cd --- /dev/null +++ b/mods/mobs/LICENSE.txt @@ -0,0 +1,16 @@ +License for Code +---------------- + +Copyright (C) 2015 cd2 (cdqwertz) + +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) diff --git a/mods/mobs/init.lua b/mods/mobs/init.lua new file mode 100644 index 0000000..befb89a --- /dev/null +++ b/mods/mobs/init.lua @@ -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, +}) diff --git a/mods/mobs/init.lua~ b/mods/mobs/init.lua~ new file mode 100644 index 0000000..befb89a --- /dev/null +++ b/mods/mobs/init.lua~ @@ -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, +}) diff --git a/mods/mobs/textures/mobs_angry_block.png b/mods/mobs/textures/mobs_angry_block.png new file mode 100644 index 0000000..ef0bf17 Binary files /dev/null and b/mods/mobs/textures/mobs_angry_block.png differ diff --git a/mods/mobs/textures/mobs_angry_block_top.png b/mods/mobs/textures/mobs_angry_block_top.png new file mode 100644 index 0000000..8f4c25a Binary files /dev/null and b/mods/mobs/textures/mobs_angry_block_top.png differ diff --git a/mods/potions/LICENSE.txt b/mods/potions/LICENSE.txt new file mode 100644 index 0000000..cca02cd --- /dev/null +++ b/mods/potions/LICENSE.txt @@ -0,0 +1,16 @@ +License for Code +---------------- + +Copyright (C) 2015 cd2 (cdqwertz) + +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) diff --git a/mods/potions/depends.txt b/mods/potions/depends.txt new file mode 100644 index 0000000..07f8b9f --- /dev/null +++ b/mods/potions/depends.txt @@ -0,0 +1,2 @@ +default +central_message diff --git a/mods/potions/depends.txt~ b/mods/potions/depends.txt~ new file mode 100644 index 0000000..07f8b9f --- /dev/null +++ b/mods/potions/depends.txt~ @@ -0,0 +1,2 @@ +default +central_message diff --git a/mods/potions/init.lua b/mods/potions/init.lua new file mode 100644 index 0000000..1e68853 --- /dev/null +++ b/mods/potions/init.lua @@ -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, +}) diff --git a/mods/potions/init.lua~ b/mods/potions/init.lua~ new file mode 100644 index 0000000..1e68853 --- /dev/null +++ b/mods/potions/init.lua~ @@ -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, +}) diff --git a/mods/potions/textures/potions_blue.png b/mods/potions/textures/potions_blue.png new file mode 100644 index 0000000..c3bfed7 Binary files /dev/null and b/mods/potions/textures/potions_blue.png differ diff --git a/mods/potions/textures/potions_green.png b/mods/potions/textures/potions_green.png new file mode 100644 index 0000000..3f3b1e6 Binary files /dev/null and b/mods/potions/textures/potions_green.png differ diff --git a/mods/potions/textures/potions_red.png b/mods/potions/textures/potions_red.png new file mode 100644 index 0000000..6bfdfab Binary files /dev/null and b/mods/potions/textures/potions_red.png differ diff --git a/mods/potions/textures/potions_yellow.png b/mods/potions/textures/potions_yellow.png new file mode 100644 index 0000000..fd1681f Binary files /dev/null and b/mods/potions/textures/potions_yellow.png differ diff --git a/mods/quests/LICENSE.txt b/mods/quests/LICENSE.txt new file mode 100644 index 0000000..cca02cd --- /dev/null +++ b/mods/quests/LICENSE.txt @@ -0,0 +1,16 @@ +License for Code +---------------- + +Copyright (C) 2015 cd2 (cdqwertz) + +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) diff --git a/mods/quests/depends.txt b/mods/quests/depends.txt new file mode 100644 index 0000000..07f8b9f --- /dev/null +++ b/mods/quests/depends.txt @@ -0,0 +1,2 @@ +default +central_message diff --git a/mods/quests/depends.txt~ b/mods/quests/depends.txt~ new file mode 100644 index 0000000..07f8b9f --- /dev/null +++ b/mods/quests/depends.txt~ @@ -0,0 +1,2 @@ +default +central_message diff --git a/mods/quests/init.lua b/mods/quests/init.lua new file mode 100644 index 0000000..00502aa --- /dev/null +++ b/mods/quests/init.lua @@ -0,0 +1,91 @@ +minetest.register_node("quests:quest_block", { + description = "Quest Block", + tiles = {"quests_block.png"}, + groups = {quest = 1, cracky = 3}, + on_punch = function(pos, node, player, pointed_thing) + + local meta = minetest.get_meta(pos) + local items = {"default:dirt", "default:sand", "default:iron_lump", "default:stone_item", "default:string"} + local item = items[math.random(5)] + meta:set_string("infotext", "Bring me some " .. item .. ", pls :)") + meta:set_string("item", item) + end, + + on_rightclick = function(pos, node, player, itemstack, pointed_thing) + local meta = minetest.get_meta(pos) + print(itemstack) + print(itemstack:to_table()) + if not itemstack or not itemstack:to_table() then + return + end + if itemstack:to_table().name == meta:get_string("item") then + meta:set_string("infotext", "Thank you!") + player:get_inventory():add_item("main", {name = "default:xp"}) + minetest.add_particlespawner({ + amount = 500, + time = 5, + minpos = {x=pos.x, y=pos.y, z=pos.z}, + maxpos = {x=pos.x, y=pos.y, z=pos.z}, + minvel = {x=-2, y=0, z=-2}, + maxvel = {x=2, y=0, z=2}, + minacc = {x=-2, y=0, z=-2}, + maxacc = {x=2, y=0, z=2}, + minexptime = 5, + maxexptime = 5, + minsize = 1, + maxsize = 1, + collisiondetection = false, + vertical = false, + texture = "default_xp.png", + }) + minetest.remove_node(pos) + cmsg.push_message_player(player, "You got some XP!") + else + meta:set_string("infotext", "That isnt the item I am searching for..") + end + end, +}) + +minetest.register_node("quests:map", { + description = "Map", + tiles = {"quests_map_top.png", "quests_map_top.png", "quests_map.png", "quests_map.png", "quests_map.png", "quests_map.png"}, + groups = {quest = 1, cracky = 3}, + on_punch = function(pos, node, player, pointed_thing) + player:get_inventory():add_item("main", {name = "default:xp", count = math.random(3, 20)}) + minetest.add_particlespawner({ + amount = 500, + time = 5, + minpos = {x=pos.x, y=pos.y, z=pos.z}, + maxpos = {x=pos.x, y=pos.y, z=pos.z}, + minvel = {x=-2, y=0, z=-2}, + maxvel = {x=2, y=0, z=2}, + minacc = {x=-2, y=0, z=-2}, + maxacc = {x=2, y=0, z=2}, + minexptime = 5, + maxexptime = 5, + minsize = 1, + maxsize = 1, + collisiondetection = false, + vertical = false, + texture = "default_xp.png", + }) + minetest.remove_node(pos) + cmsg.push_message_player(player, "You got some XP!") + end, +}) + +minetest.register_node("quests:ray", { + description = "Ray", + tiles = {"quests_glowing_ray.png"}, + groups = {ray=1}, + paramtype = "light", + paramtype2 = "facedir", + drawtype = "nodebox", + light_source = 7, + node_box = { + type = "fixed", + fixed = { + {-0.2, -0.5, -0.2, 0.2, 0.5, 0.2}, + }, + }, +}) diff --git a/mods/quests/init.lua~ b/mods/quests/init.lua~ new file mode 100644 index 0000000..00502aa --- /dev/null +++ b/mods/quests/init.lua~ @@ -0,0 +1,91 @@ +minetest.register_node("quests:quest_block", { + description = "Quest Block", + tiles = {"quests_block.png"}, + groups = {quest = 1, cracky = 3}, + on_punch = function(pos, node, player, pointed_thing) + + local meta = minetest.get_meta(pos) + local items = {"default:dirt", "default:sand", "default:iron_lump", "default:stone_item", "default:string"} + local item = items[math.random(5)] + meta:set_string("infotext", "Bring me some " .. item .. ", pls :)") + meta:set_string("item", item) + end, + + on_rightclick = function(pos, node, player, itemstack, pointed_thing) + local meta = minetest.get_meta(pos) + print(itemstack) + print(itemstack:to_table()) + if not itemstack or not itemstack:to_table() then + return + end + if itemstack:to_table().name == meta:get_string("item") then + meta:set_string("infotext", "Thank you!") + player:get_inventory():add_item("main", {name = "default:xp"}) + minetest.add_particlespawner({ + amount = 500, + time = 5, + minpos = {x=pos.x, y=pos.y, z=pos.z}, + maxpos = {x=pos.x, y=pos.y, z=pos.z}, + minvel = {x=-2, y=0, z=-2}, + maxvel = {x=2, y=0, z=2}, + minacc = {x=-2, y=0, z=-2}, + maxacc = {x=2, y=0, z=2}, + minexptime = 5, + maxexptime = 5, + minsize = 1, + maxsize = 1, + collisiondetection = false, + vertical = false, + texture = "default_xp.png", + }) + minetest.remove_node(pos) + cmsg.push_message_player(player, "You got some XP!") + else + meta:set_string("infotext", "That isnt the item I am searching for..") + end + end, +}) + +minetest.register_node("quests:map", { + description = "Map", + tiles = {"quests_map_top.png", "quests_map_top.png", "quests_map.png", "quests_map.png", "quests_map.png", "quests_map.png"}, + groups = {quest = 1, cracky = 3}, + on_punch = function(pos, node, player, pointed_thing) + player:get_inventory():add_item("main", {name = "default:xp", count = math.random(3, 20)}) + minetest.add_particlespawner({ + amount = 500, + time = 5, + minpos = {x=pos.x, y=pos.y, z=pos.z}, + maxpos = {x=pos.x, y=pos.y, z=pos.z}, + minvel = {x=-2, y=0, z=-2}, + maxvel = {x=2, y=0, z=2}, + minacc = {x=-2, y=0, z=-2}, + maxacc = {x=2, y=0, z=2}, + minexptime = 5, + maxexptime = 5, + minsize = 1, + maxsize = 1, + collisiondetection = false, + vertical = false, + texture = "default_xp.png", + }) + minetest.remove_node(pos) + cmsg.push_message_player(player, "You got some XP!") + end, +}) + +minetest.register_node("quests:ray", { + description = "Ray", + tiles = {"quests_glowing_ray.png"}, + groups = {ray=1}, + paramtype = "light", + paramtype2 = "facedir", + drawtype = "nodebox", + light_source = 7, + node_box = { + type = "fixed", + fixed = { + {-0.2, -0.5, -0.2, 0.2, 0.5, 0.2}, + }, + }, +}) diff --git a/mods/quests/textures/quests_block.png b/mods/quests/textures/quests_block.png new file mode 100644 index 0000000..583dd14 Binary files /dev/null and b/mods/quests/textures/quests_block.png differ diff --git a/mods/quests/textures/quests_glowing_ray.png b/mods/quests/textures/quests_glowing_ray.png new file mode 100644 index 0000000..b3230b2 Binary files /dev/null and b/mods/quests/textures/quests_glowing_ray.png differ diff --git a/mods/quests/textures/quests_map.png b/mods/quests/textures/quests_map.png new file mode 100644 index 0000000..db65251 Binary files /dev/null and b/mods/quests/textures/quests_map.png differ diff --git a/mods/quests/textures/quests_map_top.png b/mods/quests/textures/quests_map_top.png new file mode 100644 index 0000000..648630b Binary files /dev/null and b/mods/quests/textures/quests_map_top.png differ diff --git a/mods/quests/textures/quests_skin_1.png b/mods/quests/textures/quests_skin_1.png new file mode 100644 index 0000000..6017a08 Binary files /dev/null and b/mods/quests/textures/quests_skin_1.png differ