Add files via upload

This commit is contained in:
PiDemon 2021-05-01 14:42:34 -06:00 committed by GitHub
parent 82364cbfe3
commit 76a9c6d38d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 72 additions and 0 deletions

28
LICENSE.txt Normal file
View File

@ -0,0 +1,28 @@
License for Code
----------------
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
License for Textures
---------------------------------------
All textures are licensed under CC-BY-SA 4.0

41
init.lua Normal file
View File

@ -0,0 +1,41 @@
local function get_moth_formspec()
return "size[10,10]"..
"field[1,1;8,1;target;Recipent: ;name]"..
"textarea[1,3;8,5;message;Message: ;Help me!]"..
"button_exit[1,8;5,1;send;Fly Away...]"
end
minetest.register_node("moth:moth", {
description = "Moth",
inventory_image = "moth_img.png",
wield_image = "moth_img.png",
paramtype = "light",
sunlight_propagates = true,
drawtype = "plantlike",
walkable = false,
tiles = {{
name = "moth.png",
animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 1}
}},
groups = {oddly_breakable_by_hand=3},
on_use = function(itemstack, player, pointed_thing)
minetest.show_formspec(player:get_player_name(), "moth_send", get_moth_formspec())
end
})
minetest.register_on_player_receive_fields(function(player, formname, fields)
if formname == "moth_send" then
if fields.send then
local inv = player:get_inventory()
inv:remove_item("main", "moth:moth")
local rec = minetest.get_player_by_name(fields.target)
if rec then
local pos = rec:get_pos()
pos.y = pos.y + 1
minetest.set_node(pos, {name = "moth:moth"})
minetest.show_formspec(rec:get_player_name(), "moth_show", "size[10,10]".."label[0.5,0.5;A moth whispers to you...]".."label[0.5,1;(From "..minetest.formspec_escape(player:get_player_name())..")".."]".."textarea[0.5,2.5;7.5,7;;" ..minetest.formspec_escape(fields.message) .. ";]")
end
end
end
end)
if minetest.get_modpath("flowers") then
minetest.override_item("flowers:dandelion_white", {on_use = function(itemstack, player, pointed_thing) minetest.set_node(player:get_pos(), {name = "moth:moth"}) end})
end

3
mod.conf Normal file
View File

@ -0,0 +1,3 @@
name = moth
description = Adds moths which can send messages (from Lord of the Rings)
optional_depends = flowers

BIN
screenshot_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

BIN
screenshot_2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB