Move to modpack and /effect command

master
minermoder27 2014-02-19 21:06:56 +13:00
parent 9ea98fb297
commit 9ea9fc2564
19 changed files with 629 additions and 609 deletions

0
modpack.txt Normal file
View File

View File

@ -46,6 +46,8 @@ potions = {
air = function(sname, name, fname, time, sdata, flags)
local def = {
on_use = function(itemstack, user, pointed_thing)
local potions_e = potions.players[user:get_player_name()]
potions_e.air = potions_e.air + (sdata.time or 0)
for i=0, (sdata.time or 0) do
minetest.after(i, function()
local br = user:get_breath()
@ -57,6 +59,10 @@ potions = {
br = math.min(11, br)
br = math.max(0, br)
user:set_breath(br)
if i==(sdata.time or 0) then
potions_e.air = potions_e.air - (sdata.time or 0)
end
end)
end
itemstack:take_item()
@ -510,3 +516,17 @@ end)
--end)
--dofile(minetest.get_modpath("potions").."/table.lua")
minetest.register_chatcommand("effect", {
params = "none",
description = "get effect info",
func = function(name, param)
minetest.chat_send_player(name, "effects:")
local potions_e = potions.players[name]
if potions_e~=nil then
for potion_name, val in pairs(potions_e) do
minetest.chat_send_player(name, potion_name .. "=" .. val)
end
end
end,
})

View File

Before

Width:  |  Height:  |  Size: 214 B

After

Width:  |  Height:  |  Size: 214 B

View File

Before

Width:  |  Height:  |  Size: 206 B

After

Width:  |  Height:  |  Size: 206 B

View File

Before

Width:  |  Height:  |  Size: 200 B

After

Width:  |  Height:  |  Size: 200 B

View File

Before

Width:  |  Height:  |  Size: 254 B

After

Width:  |  Height:  |  Size: 254 B

View File

Before

Width:  |  Height:  |  Size: 254 B

After

Width:  |  Height:  |  Size: 254 B

View File

Before

Width:  |  Height:  |  Size: 264 B

After

Width:  |  Height:  |  Size: 264 B

View File

Before

Width:  |  Height:  |  Size: 258 B

After

Width:  |  Height:  |  Size: 258 B

View File

Before

Width:  |  Height:  |  Size: 253 B

After

Width:  |  Height:  |  Size: 253 B

View File

Before

Width:  |  Height:  |  Size: 257 B

After

Width:  |  Height:  |  Size: 257 B

View File

Before

Width:  |  Height:  |  Size: 214 B

After

Width:  |  Height:  |  Size: 214 B

View File

Before

Width:  |  Height:  |  Size: 206 B

After

Width:  |  Height:  |  Size: 206 B

View File

Before

Width:  |  Height:  |  Size: 200 B

After

Width:  |  Height:  |  Size: 200 B