add health potions

master
tchncs 2016-10-02 10:35:06 +02:00
commit 6514a792e6
6 changed files with 158 additions and 0 deletions

17
.gitattributes vendored Normal file
View File

@ -0,0 +1,17 @@
# Auto detect text files and perform LF normalization
* text=auto
# Custom for Visual Studio
*.cs diff=csharp
# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain

47
.gitignore vendored Normal file
View File

@ -0,0 +1,47 @@
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msm
*.msp
# Windows shortcuts
*.lnk
# =========================
# Operating System Files
# =========================
# OSX
# =========================
.DS_Store
.AppleDouble
.LSOverride
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

81
bottles.lua Normal file
View File

@ -0,0 +1,81 @@
minetest.register_node("magical_potion:medicine_small", {
description = "Small bottle of Medicine",
drawtype = "plantlike",
tiles = {"medicine_bottle_small.png"},
wield_image = "medicine_bottle_small.png",
paramtype = "light",
stack_max = 1,
is_ground_content = false,
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "medicine_bottle_small.png",
on_use = function(itemstack, player)
local health = player:get_hp();
player:set_hp(health+5)
if minetest.get_modpath("vessels") then
player:get_inventory():add_item("main", "vessels:glass_bottle")
end
itemstack:take_item(1)
return itemstack
end,
})
minetest.register_node("magical_potion:medicine_big", {
description = "Big bottle of Medicine",
drawtype = "plantlike",
tiles = {"medicine_bottle_big.png"},
wield_image = "medicine_bottle_big.png",
paramtype = "light",
stack_max = 1,
is_ground_content = false,
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "medicine_bottle_big.png",
on_use = function(itemstack, player)
local health = player:get_hp();
player:set_hp(health+10)
if minetest.get_modpath("vessels") then
player:get_inventory():add_item("main", "vessels:glass_bottle")
end
itemstack:take_item(1)
return itemstack
end,
})
minetest.register_node("magical_potion:medicine_huge", {
description = "Huge bottle of Medicine",
drawtype = "plantlike",
tiles = {"medicine_bottle_huge.png"},
wield_image = "medicine_bottle_huge.png",
paramtype = "light",
stack_max = 1,
is_ground_content = false,
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1},
sounds = default.node_sound_glass_defaults(),
inventory_image = "medicine_bottle_huge.png",
on_use = function(itemstack, player)
local health = player:get_hp();
player:set_hp(health+20)
itemstack:replace("vessels:glass_bottle")
if minetest.get_modpath("vessels") then
player:get_inventory():add_item("main", "vessels:glass_bottle")
end
itemstack:take_item(1)
return itemstack
end,
})

2
depends.txt Normal file
View File

@ -0,0 +1,2 @@
vessels
player_effect ?

3
init.lua Normal file
View File

@ -0,0 +1,3 @@
local magical_potion = {}
dofile(minetest.get_modpath("magical_potion").."/bottles.lua")

8
readme.md Normal file
View File

@ -0,0 +1,8 @@
### Magical Potion
This mod adds magical potions to the game, depending the playereffects mod.
It includes for example temporally fly and more.
Since the potions are meant for donation presents, there are no recipes.
If you like the modidea but prefer craftable stuff, take a look at
the Witchcraft or Jatpack mod for Minetest.