First commit
This commit is contained in:
commit
56e76a4298
13
License.txt
Normal file
13
License.txt
Normal file
@ -0,0 +1,13 @@
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
Version 2, December 2004
|
||||
|
||||
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim or modified
|
||||
copies of this license document, and changing it is allowed as long
|
||||
as the name is changed.
|
||||
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. You just DO WHAT THE FUCK YOU WANT TO.
|
53
init.lua
Normal file
53
init.lua
Normal file
@ -0,0 +1,53 @@
|
||||
--simple bandaid mod
|
||||
|
||||
minetest.register_craftitem("bandaid:bandaid", {
|
||||
description = "Bandaid",
|
||||
inventory_image = "bandaid.png",
|
||||
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
bandaid_heal(placer,itemstack)
|
||||
return(itemstack)
|
||||
end,
|
||||
on_secondary_use = function(itemstack, user, pointed_thing)
|
||||
bandaid_heal(user,itemstack)
|
||||
return(itemstack)
|
||||
end,
|
||||
})
|
||||
function bandaid_heal(player,itemstack)
|
||||
local hp = player:get_hp()
|
||||
local pos = player:getpos()
|
||||
if hp < 20 then
|
||||
player:set_hp(hp + 10)
|
||||
minetest.sound_play("relief", {
|
||||
pos = pos,
|
||||
max_hear_distance = 100,
|
||||
gain = 10.0,
|
||||
})
|
||||
minetest.add_item(pos, drop)
|
||||
minetest.add_particlespawner({
|
||||
amount = 40,
|
||||
time = 0.1,
|
||||
minpos = {x=pos.x-0.5, y=pos.y, z=pos.z-0.5},
|
||||
maxpos = {x=pos.x+0.5, y=pos.y+1, z=pos.z+0.5},
|
||||
minvel = {x=0, y=1, z=0},
|
||||
maxvel = {x=0, y=2, z=0},
|
||||
minacc = {x=0, y=0, z=0},
|
||||
maxacc = {x=0, y=0, z=0},
|
||||
minexptime = 1,
|
||||
maxexptime = 1,
|
||||
minsize = 1,
|
||||
maxsize = 2,
|
||||
collisiondetection = false,
|
||||
vertical = false,
|
||||
texture = "heart.png",
|
||||
})
|
||||
itemstack:take_item(1)
|
||||
return(itemstack)
|
||||
end
|
||||
end
|
||||
minetest.register_craft({
|
||||
output = "bandaid:bandaid",
|
||||
recipe = {
|
||||
{"default:paper", "group:wool", "default:paper"}
|
||||
}
|
||||
})
|
BIN
sounds/relief.1.ogg
Normal file
BIN
sounds/relief.1.ogg
Normal file
Binary file not shown.
BIN
sounds/relief.2.ogg
Normal file
BIN
sounds/relief.2.ogg
Normal file
Binary file not shown.
BIN
sounds/relief.3.ogg
Normal file
BIN
sounds/relief.3.ogg
Normal file
Binary file not shown.
BIN
textures/bandaid.png
Normal file
BIN
textures/bandaid.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
Loading…
x
Reference in New Issue
Block a user