1 コミット

作成者 SHA1 メッセージ 日付
sys4-fr
0d8fa05588 Modifications pour le serveur nalc.
- Ajout de la dépendance du mod player_physics de MFF.
- Réindentaion du code
2018-09-02 10:36:55 +02:00
103個のファイルの変更4272行の追加3559行の削除

ファイルの表示

@@ -13,7 +13,7 @@ minetest.register_node("witchcraft:brewing_stand", {
"witchcraft_brewing_stand_side.png" "witchcraft_brewing_stand_side.png"
}, },
drawtype = "nodebox", drawtype = "nodebox",
use_texture_alpha = "blend", use_texture_alpha = true,
paramtype = "light", paramtype = "light",
drop = { drop = {
items = { items = {
@@ -36,19 +36,15 @@ minetest.register_node("witchcraft:brewing_stand", {
} }
}, },
on_rightclick = function(pos, node, clicker, item, _) on_rightclick = function(pos, node, clicker, item, _)
local wield_item = item:get_name() local wield_item = clicker:get_wielded_item():get_name()
local new_item = wield_item.."_2" local new_item = wield_item.."_2"
local player_name = clicker:get_player_name() if minetest.get_item_group(wield_item, "potion") ~= 0 then
if not player_name then return end
if minetest.get_item_group(wield_item, "potion") ~= 0 and minetest.registered_items[new_item] ~= nil then
minetest.set_node(pos, {name="witchcraft:brewing_stand_active", param2=node.param2}) minetest.set_node(pos, {name="witchcraft:brewing_stand_active", param2=node.param2})
item:take_item() item:take_item()
minetest.after(30, function() minetest.after(30, function()
minetest.set_node(pos, {name="witchcraft:brewing_stand_unready", param2=node.param2}) minetest.set_node(pos, {name="witchcraft:brewing_stand_unready", param2=node.param2})
minetest.add_item(pos, new_item) minetest.add_item(pos, new_item)
end) end)
else
minetest.chat_send_player(player_name, "Sorry, it's not a potion/not upgradable!")
end end
end, end,
}) })
@@ -63,7 +59,7 @@ minetest.register_node("witchcraft:brewing_stand_active", {
"witchcraft_brewing_stand_side.png" "witchcraft_brewing_stand_side.png"
}, },
drawtype = "nodebox", drawtype = "nodebox",
use_texture_alpha = "blend", use_texture_alpha = true,
paramtype = "light", paramtype = "light",
light_source = 1, light_source = 1,
drop = { drop = {
@@ -100,7 +96,7 @@ minetest.register_node("witchcraft:brewing_stand_unready", {
}, },
inventory_image = "witchcraft_brewing_stand_inv.png", inventory_image = "witchcraft_brewing_stand_inv.png",
drawtype = "nodebox", drawtype = "nodebox",
use_texture_alpha = "blend", use_texture_alpha = true,
paramtype = "light", paramtype = "light",
light_source = 1, light_source = 1,
drop = { drop = {
@@ -124,7 +120,7 @@ minetest.register_node("witchcraft:brewing_stand_unready", {
} }
}, },
on_rightclick = function(pos, node, clicker, item, _) on_rightclick = function(pos, node, clicker, item, _)
local wield_item = item:get_name() local wield_item = clicker:get_wielded_item():get_name()
if wield_item == "default:mese_crystal_fragment" then if wield_item == "default:mese_crystal_fragment" then
minetest.set_node(pos, {name="witchcraft:brewing_stand", param2=node.param2}) minetest.set_node(pos, {name="witchcraft:brewing_stand", param2=node.param2})
item:take_item() item:take_item()
@@ -165,4 +161,4 @@ minetest.register_craft({
{'group:stick', 'default:diamond', 'group:stick'}, {'group:stick', 'default:diamond', 'group:stick'},
{'', 'default:obsidian_shard', ''}, {'', 'default:obsidian_shard', ''},
} }
}) })

12
depends.txt ノーマルファイル
ファイルの表示

@@ -0,0 +1,12 @@
default
vessels
tnt
fire
player_physics
playereffects
farming?
lightning?
pmobs?
hud_hunger?
moreplants?
horror?

7292
init.lua

ファイル差分が大きすぎるため省略します 差分を読み込み

ファイルの表示

@@ -1,3 +0,0 @@
name = witchcraft
depends = default,vessels,tnt,fire,playereffects
optional_depends = player_monoids,farming,lightning,pmobs,hud_hunger,hunger_ng,moreplants,horror

バイナリ
screenshot.png

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 22 KiB

変更後

幅:  |  高さ:  |  サイズ: 95 KiB

ファイルの表示

@@ -1,17 +1,21 @@
--scrolls --scrolls
minetest.register_craftitem("witchcraft:scroll_day", { minetest.register_craftitem(
description = "Scroll of day", "witchcraft:scroll_day",
inventory_image = "witchcraft_scroll.png^witchcraft_sun_over.png", {
stack_max = 1, description = "Scroll of day",
on_use = function(item) inventory_image = "witchcraft_scroll.png^witchcraft_sun_over.png",
minetest.set_timeofday(0.5) stack_max = 1,
item:take_item() on_use = function(item)
return item minetest.set_timeofday(0.5)
end, item:take_item()
}) return item
end,
})
minetest.register_craftitem("witchcraft:scroll_night", { minetest.register_craftitem(
"witchcraft:scroll_night",
{
description = "Scroll of night", description = "Scroll of night",
inventory_image = "witchcraft_scroll.png^witchcraft_moon_over.png", inventory_image = "witchcraft_scroll.png^witchcraft_moon_over.png",
stack_max = 1, stack_max = 1,
@@ -20,230 +24,252 @@ minetest.register_craftitem("witchcraft:scroll_night", {
item:take_item() item:take_item()
return item return item
end, end,
}) })
if minetest.get_modpath("pmobs")then if minetest.get_modpath("pmobs") then
minetest.register_craftitem("witchcraft:scroll_wild", { minetest.register_craftitem(
description = "Scroll of Wild", "witchcraft:scroll_wild",
inventory_image = "witchcraft_scroll.png^witchcraft_dark_over.png", {
description = "Scroll of Wild",
inventory_image = "witchcraft_scroll.png^witchcraft_dark_over.png",
stack_max = 1,
on_use = function(item, placer)
local pos = placer:getpos();
minetest.add_entity(pos, "pmobs:dog")
item:take_item()
return item
end,
})
end
minetest.register_craftitem(
"witchcraft:scroll_fireball",
{
description = "Scroll of fireball",
inventory_image = "witchcraft_scroll.png^witchcraft_fire_over.png",
stack_max = 1, stack_max = 1,
on_use = function(item, placer) on_use = function(item, placer, pos)
local pos = placer:get_pos() local dir = placer:get_look_dir();
minetest.add_entity(pos, "pmobs:dog") local playerpos = placer:getpos();
local obj = minetest.add_entity(
{x=playerpos.x+dir.x*1.5,y=playerpos.y+1.5+dir.y,z=playerpos.z+0+dir.z},
"witchcraft:fireball")
local obj2 = minetest.add_entity(
{x=playerpos.x+dir.x*1.5,y=playerpos.y+1.5+dir.y,z=playerpos.z+0+dir.z},
"witchcraft:fireball")
local obj3 = minetest.add_entity(
{x=playerpos.x+dir.x*1.5,y=playerpos.y+1.5+dir.y,z=playerpos.z+0+dir.z},
"witchcraft:fireball")
local obj4 = minetest.add_entity(
{x=playerpos.x+dir.x*1.5,y=playerpos.y+1.5+dir.y,z=playerpos.z+0+dir.z},
"witchcraft:fireball")
obj2:setvelocity({x=dir.x*7+0.5,y=dir.y*7,z=dir.z*7+0.5})
obj3:setvelocity({x=dir.x*7-0.5,y=dir.y*7,z=dir.z*7-0.5})
obj4:setvelocity({x=dir.x*7,y=dir.y*7-0.5,z=dir.z*7})
obj:setvelocity({x=dir.x*7,y=dir.y*7+0.5,z=dir.z*7})
item:take_item() item:take_item()
return item return item
end, end,
}) })
end
minetest.register_craftitem("witchcraft:scroll_fireball", {
description = "Scroll of fireball",
inventory_image = "witchcraft_scroll.png^witchcraft_fire_over.png",
stack_max = 1,
on_use = function(item, placer, pointed_thing)
local dir = placer:get_look_dir()
local playerpos = placer:get_pos()
local entities = {}
for i=1,4 do
entities[i] = minetest.add_entity({
x=playerpos.x+dir.x*1.5,
y=playerpos.y+1.5+dir.y,
z=playerpos.z+0+dir.z
}, "witchcraft:fireball")
end
entities[2]:set_velocity({x=dir.x*7+0.5,y=dir.y*7,z=dir.z*7+0.5})
entities[3]:set_velocity({x=dir.x*7-0.5,y=dir.y*7,z=dir.z*7-0.5})
entities[4]:set_velocity({x=dir.x*7,y=dir.y*7-0.5,z=dir.z*7})
entities[1]:set_velocity({x=dir.x*7,y=dir.y*7+0.5,z=dir.z*7})
item:take_item()
return item
end,
})
if minetest.get_modpath("lightning") then if minetest.get_modpath("lightning") then
minetest.register_craftitem("witchcraft:scroll_lightning", { minetest.register_craftitem(
"witchcraft:scroll_lightning",
{
description = "Scroll of lightning", description = "Scroll of lightning",
inventory_image = "witchcraft_scroll.png^witchcraft_thunder_over.png", inventory_image = "witchcraft_scroll.png^witchcraft_thunder_over.png",
stack_max = 1, stack_max = 1,
on_use = function(item, placer, pointed_thing) on_use = function(item, placer, pos)
local playerpos = placer:get_pos() local playerpos = placer:getpos();
local dir = placer:get_look_dir() local dir = placer:get_look_dir();
lightning.strike({x=playerpos.x+dir.x*2,y=playerpos.y+0+dir.y,z=playerpos.z+dir.z*2}) lightning.strike({x=playerpos.x+dir.x*2,y=playerpos.y+0+dir.y,z=playerpos.z+dir.z*2})
item:take_item() item:take_item()
return item return item
end, end,
}) })
end end
minetest.register_craftitem("witchcraft:scroll_icicle", { minetest.register_craftitem(
"witchcraft:scroll_icicle",
{
description = "Scroll of icicle", description = "Scroll of icicle",
inventory_image = "witchcraft_scroll.png^witchcraft_ice_over.png", inventory_image = "witchcraft_scroll.png^witchcraft_ice_over.png",
stack_max = 1, stack_max = 1,
on_use = function(item, placer, pointed_thing) on_use = function(item, placer, pos)
local dir = placer:get_look_dir() local dir = placer:get_look_dir();
local playerpos = placer:get_pos() local playerpos = placer:getpos();
local vec = {x=dir.x*7,y=dir.y*7,z=dir.z*7} local vec = {x=dir.x*7,y=dir.y*7,z=dir.z*7}
local obj = minetest.add_entity({ local obj = minetest.add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+1.5+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:ice")
x=playerpos.x+dir.x*1.5, local obj2 = minetest.add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+1.5+dir.y,z=playerpos.z+1+dir.z}, "witchcraft:ice")
y=playerpos.y+1.5+dir.y, local obj3 = minetest.add_entity({x=playerpos.x+1+dir.x*1.5,y=playerpos.y+1.5+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:ice")
z=playerpos.z+0+dir.z obj:setvelocity(vec)
}, "witchcraft:ice") obj2:setvelocity(vec)
local obj2 = minetest.add_entity({ obj3:setvelocity(vec)
x=playerpos.x+dir.x*1.5,
y=playerpos.y+1.5+dir.y,
z=playerpos.z+1+dir.z
}, "witchcraft:ice")
local obj3 = minetest.add_entity({
x=playerpos.x+1+dir.x*1.5,
y=playerpos.y+1.5+dir.y,
z=playerpos.z+0+dir.z
}, "witchcraft:ice")
obj:set_velocity(vec)
obj2:set_velocity(vec)
obj3:set_velocity(vec)
item:take_item() item:take_item()
return item return item
end, end,
}) })
minetest.register_craftitem("witchcraft:scroll_nature", { minetest.register_craftitem(
"witchcraft:scroll_nature",
{
description = "Scroll of nature", description = "Scroll of nature",
inventory_image = "witchcraft_scroll.png^witchcraft_leaf_over.png", inventory_image = "witchcraft_scroll.png^witchcraft_leaf_over.png",
stack_max = 1, stack_max = 1,
on_use = function(item, placer, pointed_thing) on_use = function(item, placer, pos)
local dir = placer:get_look_dir() local dir = placer:get_look_dir();
local playerpos = placer:get_pos() local playerpos = placer:getpos();
local vec = {x=dir.x*6,y=dir.y*6,z=dir.z*6} local vec = {x=dir.x*6,y=dir.y*6,z=dir.z*6}
local obj = minetest.add_entity({ local obj = minetest.add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+1.5+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:tree")
x=playerpos.x+dir.x*1.5, obj:setvelocity(vec)
y=playerpos.y+1.5+dir.y,
z=playerpos.z+0+dir.z
}, "witchcraft:tree")
obj:set_velocity(vec)
item:take_item() item:take_item()
return item return item
end, end,
}) })
minetest.register_craftitem("witchcraft:scroll", { minetest.register_craftitem(
"witchcraft:scroll",
{
description = "Blank Scroll", description = "Blank Scroll",
inventory_image = "witchcraft_scroll.png", inventory_image = "witchcraft_scroll.png",
}) })
minetest.register_craftitem("witchcraft:scroll_recipe", { minetest.register_craftitem(
"witchcraft:scroll_recipe",
{
description = "Recipe Scroll", description = "Recipe Scroll",
inventory_image = "witchcraft_scroll.png^witchcraft_writing_over.png", inventory_image = "witchcraft_scroll.png^witchcraft_writing_over.png",
on_use = function(itemstack, user, pointed_thing) on_use = function(itemstack, user, pointed_thing)
local formspec = "size[10,9]".. local formspec = "size[10,9]"..
"background[-0.6,-0.5;11.5,10.4;witchcraft_recipes.png]" "background[-0.6,-0.5;11.5,10.4;witchcraft_recipes.png]";
minetest.show_formspec(user:get_player_name(), "witchcraft:scroll", formspec)
minetest.show_formspec(user:get_player_name(), "witchcraft:scroll", formspec);
end, end,
}) })
if minetest.get_modpath("pmobs")then if minetest.get_modpath("pmobs")then
minetest.register_craft({ minetest.register_craft(
{
output = 'witchcraft:scroll_wild', output = 'witchcraft:scroll_wild',
recipe = { recipe = {
{'mobs:meat_raw'}, {'mobs:meat_raw'},
{'witchcraft:scroll'}, {'witchcraft:scroll'},
} }
}) })
end end
minetest.register_craft({ minetest.register_craft(
{
output = 'witchcraft:scroll', output = 'witchcraft:scroll',
recipe = { recipe = {
{'default:paper', 'default:paper', ''}, {'default:paper', 'default:paper', ''},
{'default:paper', 'default:paper', ''}, {'default:paper', 'default:paper', ''},
} }
}) })
minetest.register_craft({ minetest.register_craft(
{
output = 'witchcraft:scroll_recipe', output = 'witchcraft:scroll_recipe',
recipe = { recipe = {
{'dye:black'}, {'dye:black'},
{'witchcraft:scroll'}, {'witchcraft:scroll'},
} }
}) })
minetest.register_craft({ minetest.register_craft(
{
output = 'witchcraft:scroll_icicle', output = 'witchcraft:scroll_icicle',
recipe = { recipe = {
{'default:ice'}, {'default:ice'},
{'default:diamond'}, {'default:diamond'},
{'witchcraft:scroll'}, {'witchcraft:scroll'},
} }
}) })
minetest.register_craft({ minetest.register_craft(
{
output = 'witchcraft:scroll_fireball', output = 'witchcraft:scroll_fireball',
recipe = { recipe = {
{'default:obsidian_shard'}, {'default:obsidian_shard'},
{'default:diamond'}, {'default:diamond'},
{'witchcraft:scroll'}, {'witchcraft:scroll'},
} }
}) })
minetest.register_craft({ minetest.register_craft(
{
output = 'witchcraft:scroll_nature', output = 'witchcraft:scroll_nature',
recipe = { recipe = {
{'default:leaves'}, {'default:leaves'},
{'default:diamond'}, {'default:diamond'},
{'witchcraft:scroll'}, {'witchcraft:scroll'},
} }
}) })
minetest.register_craft({ minetest.register_craft(
{
output = 'witchcraft:scroll_day', output = 'witchcraft:scroll_day',
recipe = { recipe = {
{'default:torch'}, {'default:torch'},
{'default:diamond'}, {'default:diamond'},
{'witchcraft:scroll'}, {'witchcraft:scroll'},
} }
}) })
minetest.register_craft({ minetest.register_craft(
{
output = 'witchcraft:scroll_night', output = 'witchcraft:scroll_night',
recipe = { recipe = {
{'default:coal_lump'}, {'default:coal_lump'},
{'default:diamond'}, {'default:diamond'},
{'witchcraft:scroll'}, {'witchcraft:scroll'},
} }
}) })
minetest.register_craft({
minetest.register_craft(
{
output = 'witchcraft:scroll_lightning', output = 'witchcraft:scroll_lightning',
recipe = { recipe = {
{'default:steel_ingot'}, {'default:steel_ingot'},
{'default:diamond'}, {'default:diamond'},
{'witchcraft:scroll'}, {'witchcraft:scroll'},
} }
}) })
--scroll powers --scroll powers
minetest.register_entity("witchcraft:fireball", { minetest.register_entity(
"witchcraft:fireball",
{
textures = {"tnt_boom.png"}, textures = {"tnt_boom.png"},
velocity = 0.1, velocity = 0.1,
damage = 2, damage = 2,
collisionbox = {0, 0, 0, 0, 0, 0}, collisionbox = {0, 0, 0, 0, 0, 0},
on_step = function(self, obj, pos) on_step = function(self, obj, pos)
local remove = minetest.after(2, function() local remove = minetest.after(
2,
function()
self.object:remove() self.object:remove()
end) end)
local pos = self.object:get_pos() local pos = self.object:getpos()
local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2) local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2)
for k, obj in pairs(objs) do for k, obj in pairs(objs) do
if obj:get_luaentity() then if obj:get_luaentity() ~= nil then
if obj:get_luaentity().name ~= "witchcraft:fireball" if obj:get_luaentity().name ~= "witchcraft:fireball"
and obj:get_luaentity().name ~= "__builtin:item" and obj:get_luaentity().name ~= "__builtin:item"
and obj:get_luaentity().name ~= "gauges:hp_bar" then and obj:get_luaentity().name ~= "gauges:hp_bar"
obj:punch(self.object, 1.0, { then
obj:punch(
self.object, 1.0,
{
full_punch_interval=1.0, full_punch_interval=1.0,
damage_groups={fleshy=3}, damage_groups={fleshy=3},
}, nil) }, nil)
self.object:remove() self.object:remove()
return
end end
end end
end end
@@ -253,8 +279,9 @@ minetest.register_entity("witchcraft:fireball", {
local p = {x=pos.x+dx, y=pos.y, z=pos.z+dz} local p = {x=pos.x+dx, y=pos.y, z=pos.z+dz}
local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
local n = minetest.get_node(p).name local n = minetest.get_node(p).name
if n ~= "witchcraft:fireball" and n ~="default:dirt_with_grass" then if n ~= "witchcraft:fireball" and n ~="default:dirt_with_grass"
if minetest.registered_nodes[n].groups.flammable then and n ~="default:dirt_with_dry_grass" and n ~="default:stone" then
if minetest.registered_nodes[n].groups.flammable --[[or math.random(1, 100) <= 1]] then
minetest.set_node(t, {name="fire:basic_flame"}) minetest.set_node(t, {name="fire:basic_flame"})
self.object:remove() self.object:remove()
return return
@@ -263,77 +290,124 @@ minetest.register_entity("witchcraft:fireball", {
end end
end end
end end
hit_node = function(self, pos, node)
-- local pos = self.object:getpos()
for dx=-4,4 do
for dy=-4,4 do
for dz=-4,4 do
local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
local n = minetest.get_node(pos).name
if math.random(1, 50) <= 35 then
minetest.remove_node(p)
end
if minetest.registered_nodes[n].groups.flammable or math.random(1, 100) <=5 then
minetest.set_node(t, {name="fire:basic_flame"})
end
end
end
end
end
local vec = self.object:get_velocity() local apos = self.object:getpos()
minetest.add_particlespawner({ local vec = self.object:getvelocity()
amount = 6, local part = minetest.add_particlespawner(
time = 0.3, 6, --amount
minpos = {x=pos.x-0.3, y=pos.y-0.3, z=pos.z-0.3}, 0.3, --time
maxpos = {x=pos.x+0.3, y=pos.y+0.3, z=pos.z+0.3}, {x=apos.x-0.3, y=apos.y-0.3, z=apos.z-0.3}, --minpos
minvel = {x=-0, y=-0, z=-0}, {x=apos.x+0.3, y=apos.y+0.3, z=apos.z+0.3}, --maxpos
maxvel = {x=0, y=0, z=0}, {x=-0, y=-0, z=-0}, --minvel
minacc = {x=0,y=-0.5,z=0}, {x=0, y=0, z=0}, --maxvel
maxacc = {x=-vec.x,y=-vec.y,z=-vec.z}, {x=0,y=-0.5,z=0}, --minacc
minexptime = 0.1, {x=-vec.x,y=-vec.y,z=-vec.z}, --maxacc
maxexptime = 0.3, 0.1, --minexptime
minsize = 1, 0.3, --maxexptime
maxsize = 2, 1, --minsize
collisiondetection = false, 2, --maxsize
texture = "witchcraft_flame.png" false, --collisiondetection
}) "witchcraft_flame.png" --texture
)
end, end,
}) })
minetest.register_entity("witchcraft:tree", {
minetest.register_entity(
"witchcraft:tree",
{
textures = {"witchcraft_skin.png"}, textures = {"witchcraft_skin.png"},
velocity = 1, velocity = 1,
damage = 2, damage = 2,
collisionbox = {0, 0, 0, 0, 0, 0}, collisionbox = {0, 0, 0, 0, 0, 0},
on_step = function(self, obj, pos) on_step = function(self, obj, pos)
local remove = minetest.after(2, function() local remove = minetest.after(
2,
function()
self.object:remove() self.object:remove()
end) end)
local pos = self.object:get_pos() local pos = self.object:getpos()
local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2) local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2)
for k, obj in pairs(objs) do for k, obj in pairs(objs) do
if obj:get_luaentity() then if obj:get_luaentity() ~= nil then
if obj:get_luaentity().name ~= "witchcraft:tree" if obj:get_luaentity().name ~= "witchcraft:tree"
and obj:get_luaentity().name ~= "__builtin:item" and obj:get_luaentity().name ~= "__builtin:item"
and obj:get_luaentity().name ~= "gauges:hp_bar" then and obj:get_luaentity().name ~= "gauges:hp_bar"
then
obj:remove() obj:remove()
default.grow_new_jungle_tree(pos) local treepos = self.object:getpos()
default.grow_new_jungle_tree(treepos)
self.object:remove() self.object:remove()
return
end end
end end
end end
for dx=0,1 do
local n = minetest.get_node(pos).name for dy=0,1 do
if n ~= "witchcraft:tree" and n ~="air" then for dz=0,1 do
default.grow_new_jungle_tree(pos) local p = {x=pos.x+dx, y=pos.y, z=pos.z+dz}
self.object:remove() local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
local n = minetest.get_node(p).name
if n ~= "witchcraft:tree" and n ~="air" then
local treepos = self.object:getpos()
default.grow_new_jungle_tree(treepos)
self.object:remove()
elseif n == "default:wood" or n =="default:tree" or n =="default:dirt_with_grass" or n =="default:dirt_with_dry_grass" then
self.hit_node(self, pos, node)
self.object:remove()
return
end
end
end
end end
hit_node = function(self, pos, node)
minetest.add_particlespawner({ local treepos = self.object:getpos()
amount = 6, default.grow_new_jungle_tree(treepos)
time = 0.3, end
minpos = {x=pos.x-0.3, y=pos.y-0.3, z=pos.z-0.3},
maxpos = {x=pos.x+0.3, y=pos.y+0.3, z=pos.z+0.3}, local apos = self.object:getpos()
minvel = {x=-0, y=-0, z=-0}, local part = minetest.add_particlespawner(
maxvel = {x=0, y=0, z=0}, 6, --amount
minacc = {x=0,y=-0.5,z=0}, 0.3, --time
maxacc = {x=0.5,y=0.5,z=0.5}, {x=apos.x-0.3, y=apos.y-0.3, z=apos.z-0.3}, --minpos
minexptime = 0.1, {x=apos.x+0.3, y=apos.y+0.3, z=apos.z+0.3}, --maxpos
maxexptime = 0.3, {x=-0, y=-0, z=-0}, --minvel
minsize = 1, {x=0, y=0, z=0}, --maxvel
maxsize = 2, {x=0,y=-0.5,z=0}, --minacc
collisiondetection = false, {x=0.5,y=0.5,z=0.5}, --maxacc
texture = "witchcraft_leaf_over.png" 0.1, --minexptime
}) 0.3, --maxexptime
1, --minsize
2, --maxsize
false, --collisiondetection
"witchcraft_leaf_over.png" --texture
)
end, end,
}) })
minetest.register_entity("witchcraft:ice", { minetest.register_entity(
"witchcraft:ice",
{
visual="sprite", visual="sprite",
visual_size={x=1,y=1}, visual_size={x=1,y=1},
physical=false, physical=false,
@@ -345,68 +419,62 @@ minetest.register_entity("witchcraft:ice", {
collisionbox = {0, 0, 0, 0, 0, 0}, collisionbox = {0, 0, 0, 0, 0, 0},
on_step = function(self, obj, pos) on_step = function(self, obj, pos)
local remove = minetest.after(10, function() local remove = minetest.after(10, function()
self.object:remove() self.object:remove()
end) end)
local pos = self.object:get_pos() local pos = self.object:getpos()
local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2) local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2)
for k, obj in pairs(objs) do for k, obj in pairs(objs) do
if obj:get_luaentity() ~= nil then if obj:get_luaentity() ~= nil then
if obj:get_luaentity().name ~= "witchcraft:ice" if obj:get_luaentity().name ~= "witchcraft:ice"
and obj:get_luaentity().name ~= "__builtin:item" and obj:get_luaentity().name ~= "__builtin:item"
and obj:get_luaentity().name ~= "gauges:hp_bar" then and obj:get_luaentity().name ~= "gauges:hp_bar"
obj:punch(self.object, 1.0, { then
obj:punch(
self.object, 1.0,
{
full_punch_interval=1.0, full_punch_interval=1.0,
damage_groups={fleshy=1}, damage_groups={fleshy=1},
}, nil) }, nil)
self.object:remove() self.object:remove()
return
end end
end end
end for dx=0,1 do
for dy=0,1 do
local velo = self.object:get_velocity() for dz=0,1 do
local hit = { local p = {x=pos.x+dx, y=pos.y, z=pos.z+dz}
{ p = {x=pos.x+1, y=pos.y, z=pos.z}, local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
v = {x=math.abs(velo.x)*-1, y=velo.y, z=velo.z}}, -- x local n = minetest.get_node(p).name
{ p = {x=pos.x-1, y=pos.y, z=pos.z}, if n == "default:water_source" or n =="default:river_water_source" then
v = {x=math.abs(velo.x), y=velo.y, z=velo.z}}, local pos = self.object:getpos()
{ p = {x=pos.x, y=pos.y+1, z=pos.z}, minetest.set_node(pos, {name="default:ice"})
v = {x=velo.x, y=math.abs(velo.y)*-1, z=velo.z}}, -- y self.object:remove()
{ p = {x=pos.x, y=pos.y-1, z=pos.z}, elseif n ~= "air" then
v = {x=velo.x, y=math.abs(velo.y), z=velo.z}}, local velo = self.object:getvelocity()
{ p = {x=pos.x, y=pos.y, z=pos.z+1}, self.object:setvelocity({x=velo.x*-1, y=velo.y*0, z=velo.z*1})
v = {x=velo.x, y=velo.y, z=math.abs(velo.z)*-1}}, -- z --self.object:remove()
{ p = {x=pos.x, y=pos.y, z=pos.z-1}, return
v = {x=velo.x, y=velo.y, z=math.abs(velo.z)}} end
} end
for _,h in pairs(hit) do
local n = minetest.get_node(h.p).name
if n ~= "air" and n~= "witchcraft:ice" then
if n == "default:water_source" or n =="default:river_water_source" then
minetest.set_node(h.p, {name="default:ice"})
h.v.y = 0
end end
self.object:set_velocity(h.v)
break
end end
end
minetest.add_particlespawner({ local apos = self.object:getpos()
amount = 10, local part = minetest.add_particlespawner(
time = 0.3, 10, --amount
minpos = {x=pos.x-0.3, y=pos.y-0.3, z=pos.z-0.3}, 0.3, --time
maxpos = {x=pos.x+0.3, y=pos.y+0.3, z=pos.z+0.3}, {x=apos.x-0.3, y=apos.y-0.3, z=apos.z-0.3}, --minpos
minvel = {x=-0, y=-0, z=-0}, {x=apos.x+0.3, y=apos.y+0.3, z=apos.z+0.3}, --maxpos
maxvel = {x=0, y=0, z=0}, {x=-0, y=-0, z=-0}, --minvel
minacc = {x=0,y=-0.5,z=0}, {x=0, y=0, z=0}, --maxvel
maxacc = {x=0.5,y=0.5,z=0.5}, {x=0,y=-0.5,z=0}, --minacc
minexptime = 0.1, {x=0.5,y=0.5,z=0.5}, --maxacc
maxexptime = 0.3, 0.1, --minexptime
minsize = 0.2, 0.3, --maxexptime
maxsize = 0.5, 0.2, --minsize
collisiondetection = false, 0.5, --maxsize
texture = "witchcraft_light_over.png" false, --collisiondetection
}) "witchcraft_light_over.png" --texture
)
end
end end
}) })

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 159 B

変更後

幅:  |  高さ:  |  サイズ: 175 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 163 B

変更後

幅:  |  高さ:  |  サイズ: 217 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 185 B

変更後

幅:  |  高さ:  |  サイズ: 266 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 172 B

変更後

幅:  |  高さ:  |  サイズ: 228 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 333 B

変更後

幅:  |  高さ:  |  サイズ: 493 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 297 B

変更後

幅:  |  高さ:  |  サイズ: 458 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 124 B

変更後

幅:  |  高さ:  |  サイズ: 127 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 142 B

変更後

幅:  |  高さ:  |  サイズ: 162 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 142 B

変更後

幅:  |  高さ:  |  サイズ: 167 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 434 B

変更後

幅:  |  高さ:  |  サイズ: 683 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 127 B

変更後

幅:  |  高さ:  |  サイズ: 155 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 177 B

変更後

幅:  |  高さ:  |  サイズ: 227 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 176 B

変更後

幅:  |  高さ:  |  サイズ: 258 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 159 B

変更後

幅:  |  高さ:  |  サイズ: 193 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 196 B

変更後

幅:  |  高さ:  |  サイズ: 255 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 127 B

変更後

幅:  |  高さ:  |  サイズ: 137 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 225 B

変更後

幅:  |  高さ:  |  サイズ: 401 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 202 B

変更後

幅:  |  高さ:  |  サイズ: 338 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 204 B

変更後

幅:  |  高さ:  |  サイズ: 352 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 129 B

変更後

幅:  |  高さ:  |  サイズ: 143 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 233 B

変更後

幅:  |  高さ:  |  サイズ: 277 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 178 B

変更後

幅:  |  高さ:  |  サイズ: 230 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 296 B

変更後

幅:  |  高さ:  |  サイズ: 414 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 218 B

変更後

幅:  |  高さ:  |  サイズ: 438 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 218 B

変更後

幅:  |  高さ:  |  サイズ: 1.4 KiB

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 4.9 KiB

変更後

幅:  |  高さ:  |  サイズ: 4.9 KiB

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 340 B

変更後

幅:  |  高さ:  |  サイズ: 679 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 341 B

変更後

幅:  |  高さ:  |  サイズ: 698 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 340 B

変更後

幅:  |  高さ:  |  サイズ: 665 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 83 B

変更後

幅:  |  高さ:  |  サイズ: 86 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 340 B

変更後

幅:  |  高さ:  |  サイズ: 694 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 341 B

変更後

幅:  |  高さ:  |  サイズ: 683 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 340 B

変更後

幅:  |  高さ:  |  サイズ: 667 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 548 B

変更後

幅:  |  高さ:  |  サイズ: 1017 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 561 B

変更後

幅:  |  高さ:  |  サイズ: 961 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 838 B

変更後

幅:  |  高さ:  |  サイズ: 1.1 KiB

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 544 B

変更後

幅:  |  高さ:  |  サイズ: 968 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 570 B

変更後

幅:  |  高さ:  |  サイズ: 981 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 340 B

変更後

幅:  |  高さ:  |  サイズ: 693 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 340 B

変更後

幅:  |  高さ:  |  サイズ: 698 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 340 B

変更後

幅:  |  高さ:  |  サイズ: 674 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 340 B

変更後

幅:  |  高さ:  |  サイズ: 661 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 340 B

変更後

幅:  |  高さ:  |  サイズ: 658 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 340 B

変更後

幅:  |  高さ:  |  サイズ: 657 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 340 B

変更後

幅:  |  高さ:  |  サイズ: 643 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 340 B

変更後

幅:  |  高さ:  |  サイズ: 689 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 238 B

変更後

幅:  |  高さ:  |  サイズ: 285 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 361 B

変更後

幅:  |  高さ:  |  サイズ: 664 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 251 B

変更後

幅:  |  高さ:  |  サイズ: 351 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 340 B

変更後

幅:  |  高さ:  |  サイズ: 665 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 340 B

変更後

幅:  |  高さ:  |  サイズ: 679 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 218 B

変更後

幅:  |  高さ:  |  サイズ: 388 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 218 B

変更後

幅:  |  高さ:  |  サイズ: 377 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 218 B

変更後

幅:  |  高さ:  |  サイズ: 394 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 218 B

変更後

幅:  |  高さ:  |  サイズ: 382 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 218 B

変更後

幅:  |  高さ:  |  サイズ: 385 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 218 B

変更後

幅:  |  高さ:  |  サイズ: 391 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 272 B

変更後

幅:  |  高さ:  |  サイズ: 544 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 272 B

変更後

幅:  |  高さ:  |  サイズ: 550 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 295 B

変更後

幅:  |  高さ:  |  サイズ: 424 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 271 B

変更後

幅:  |  高さ:  |  サイズ: 546 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 272 B

変更後

幅:  |  高さ:  |  サイズ: 552 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 218 B

変更後

幅:  |  高さ:  |  サイズ: 392 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 218 B

変更後

幅:  |  高さ:  |  サイズ: 391 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 218 B

変更後

幅:  |  高さ:  |  サイズ: 373 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 218 B

変更後

幅:  |  高さ:  |  サイズ: 395 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 218 B

変更後

幅:  |  高さ:  |  サイズ: 395 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 218 B

変更後

幅:  |  高さ:  |  サイズ: 387 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 218 B

変更後

幅:  |  高さ:  |  サイズ: 375 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 218 B

変更後

幅:  |  高さ:  |  サイズ: 378 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 289 B

変更後

幅:  |  高さ:  |  サイズ: 419 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 218 B

変更後

幅:  |  高さ:  |  サイズ: 393 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 218 B

変更後

幅:  |  高さ:  |  サイズ: 398 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 300 KiB

変更後

幅:  |  高さ:  |  サイズ: 465 KiB

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 200 KiB

変更後

幅:  |  高さ:  |  サイズ: 216 KiB

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 374 B

変更後

幅:  |  高さ:  |  サイズ: 409 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 177 B

変更後

幅:  |  高さ:  |  サイズ: 242 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 154 B

変更後

幅:  |  高さ:  |  サイズ: 176 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 814 B

変更後

幅:  |  高さ:  |  サイズ: 1.2 KiB

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 339 B

変更後

幅:  |  高さ:  |  サイズ: 421 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 333 B

変更後

幅:  |  高さ:  |  サイズ: 428 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 339 B

変更後

幅:  |  高さ:  |  サイズ: 422 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 339 B

変更後

幅:  |  高さ:  |  サイズ: 423 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 345 B

変更後

幅:  |  高さ:  |  サイズ: 423 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 336 B

変更後

幅:  |  高さ:  |  サイズ: 425 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 315 B

変更後

幅:  |  高さ:  |  サイズ: 385 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 337 B

変更後

幅:  |  高さ:  |  サイズ: 403 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 316 B

変更後

幅:  |  高さ:  |  サイズ: 393 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 340 B

変更後

幅:  |  高さ:  |  サイズ: 406 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 337 B

変更後

幅:  |  高さ:  |  サイズ: 390 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 336 B

変更後

幅:  |  高さ:  |  サイズ: 425 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 318 B

変更後

幅:  |  高さ:  |  サイズ: 388 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 271 B

変更後

幅:  |  高さ:  |  サイズ: 307 B

バイナリファイルは表示されません。

変更前

幅:  |  高さ:  |  サイズ: 119 B

変更後

幅:  |  高さ:  |  サイズ: 122 B

変更されたファイルが多すぎるため、一部のファイルは表示されません さらに表示