Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
32e3f8928b | |||
c515b58ca1 | |||
8bf04f444e | |||
dd3a7d13c7 | |||
fef074b9ed |
@ -2,8 +2,8 @@ default
|
|||||||
vessels
|
vessels
|
||||||
tnt
|
tnt
|
||||||
fire
|
fire
|
||||||
player_physics
|
|
||||||
playereffects
|
playereffects
|
||||||
|
player_monoids?
|
||||||
farming?
|
farming?
|
||||||
lightning?
|
lightning?
|
||||||
pmobs?
|
pmobs?
|
||||||
|
BIN
screenshot.png
Before Width: | Height: | Size: 95 KiB After Width: | Height: | Size: 22 KiB |
202
scrolls.lua
@ -1,8 +1,7 @@
|
|||||||
--scrolls
|
--scrolls
|
||||||
|
|
||||||
minetest.register_craftitem(
|
|
||||||
"witchcraft:scroll_day",
|
minetest.register_craftitem("witchcraft:scroll_day", {
|
||||||
{
|
|
||||||
description = "Scroll of day",
|
description = "Scroll of day",
|
||||||
inventory_image = "witchcraft_scroll.png^witchcraft_sun_over.png",
|
inventory_image = "witchcraft_scroll.png^witchcraft_sun_over.png",
|
||||||
stack_max = 1,
|
stack_max = 1,
|
||||||
@ -11,11 +10,9 @@ minetest.register_craftitem(
|
|||||||
item:take_item()
|
item:take_item()
|
||||||
return item
|
return item
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craftitem(
|
minetest.register_craftitem("witchcraft:scroll_night", {
|
||||||
"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,
|
||||||
@ -24,45 +21,33 @@ minetest.register_craftitem(
|
|||||||
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(
|
minetest.register_craftitem("witchcraft:scroll_wild", {
|
||||||
"witchcraft:scroll_wild",
|
|
||||||
{
|
|
||||||
description = "Scroll of Wild",
|
description = "Scroll of Wild",
|
||||||
inventory_image = "witchcraft_scroll.png^witchcraft_dark_over.png",
|
inventory_image = "witchcraft_scroll.png^witchcraft_dark_over.png",
|
||||||
stack_max = 1,
|
stack_max = 1,
|
||||||
on_use = function(item, placer)
|
on_use = function(item, placer)
|
||||||
local pos = placer:getpos();
|
local pos = placer:getpos();
|
||||||
minetest.add_entity(pos, "pmobs:dog")
|
minetest.env:add_entity(pos, "pmobs:dog")
|
||||||
item:take_item()
|
item:take_item()
|
||||||
return item
|
return item
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_craftitem(
|
minetest.register_craftitem("witchcraft:scroll_fireball", {
|
||||||
"witchcraft:scroll_fireball",
|
|
||||||
{
|
|
||||||
description = "Scroll of fireball",
|
description = "Scroll of fireball",
|
||||||
inventory_image = "witchcraft_scroll.png^witchcraft_fire_over.png",
|
inventory_image = "witchcraft_scroll.png^witchcraft_fire_over.png",
|
||||||
stack_max = 1,
|
stack_max = 1,
|
||||||
on_use = function(item, placer, pos)
|
on_use = function(item, placer, pos)
|
||||||
local dir = placer:get_look_dir();
|
local dir = placer:get_look_dir();
|
||||||
local playerpos = placer:getpos();
|
local playerpos = placer:getpos();
|
||||||
local obj = minetest.add_entity(
|
local obj = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+1.5+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:fireball")
|
||||||
{x=playerpos.x+dir.x*1.5,y=playerpos.y+1.5+dir.y,z=playerpos.z+0+dir.z},
|
local obj2 = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+1.5+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:fireball")
|
||||||
"witchcraft:fireball")
|
local obj3 = minetest.env: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(
|
local obj4 = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+1.5+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:fireball")
|
||||||
{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})
|
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})
|
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})
|
obj4:setvelocity({x=dir.x*7,y=dir.y*7-0.5,z=dir.z*7})
|
||||||
@ -70,12 +55,10 @@ minetest.register_craftitem(
|
|||||||
item:take_item()
|
item:take_item()
|
||||||
return item
|
return item
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
if minetest.get_modpath("lightning") then
|
if minetest.get_modpath("lightning") then
|
||||||
minetest.register_craftitem(
|
minetest.register_craftitem("witchcraft:scroll_lightning", {
|
||||||
"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,
|
||||||
@ -86,12 +69,10 @@ if minetest.get_modpath("lightning") then
|
|||||||
item:take_item()
|
item:take_item()
|
||||||
return item
|
return item
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_craftitem(
|
minetest.register_craftitem("witchcraft:scroll_icicle", {
|
||||||
"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,
|
||||||
@ -99,9 +80,9 @@ minetest.register_craftitem(
|
|||||||
local dir = placer:get_look_dir();
|
local dir = placer:get_look_dir();
|
||||||
local playerpos = placer:getpos();
|
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({x=playerpos.x+dir.x*1.5,y=playerpos.y+1.5+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:ice")
|
local obj = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+1.5+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:ice")
|
||||||
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")
|
local obj2 = minetest.env:add_entity({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")
|
local obj3 = minetest.env: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:setvelocity(vec)
|
obj:setvelocity(vec)
|
||||||
obj2:setvelocity(vec)
|
obj2:setvelocity(vec)
|
||||||
obj3:setvelocity(vec)
|
obj3:setvelocity(vec)
|
||||||
@ -109,11 +90,10 @@ minetest.register_craftitem(
|
|||||||
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,
|
||||||
@ -121,151 +101,132 @@ minetest.register_craftitem(
|
|||||||
local dir = placer:get_look_dir();
|
local dir = placer:get_look_dir();
|
||||||
local playerpos = placer:getpos();
|
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({x=playerpos.x+dir.x*1.5,y=playerpos.y+1.5+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:tree")
|
local obj = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+1.5+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:tree")
|
||||||
obj:setvelocity(vec)
|
obj:setvelocity(vec)
|
||||||
|
|
||||||
item:take_item()
|
item:take_item()
|
||||||
return item
|
return item
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craftitem(
|
minetest.register_craftitem("witchcraft:scroll", {
|
||||||
"witchcraft:scroll",
|
|
||||||
{
|
|
||||||
description = "Blank Scroll",
|
description = "Blank Scroll",
|
||||||
inventory_image = "witchcraft_scroll.png",
|
inventory_image = "witchcraft_scroll.png",
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craftitem(
|
minetest.register_craftitem("witchcraft:scroll_recipe", {
|
||||||
"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(
|
minetest.register_entity("witchcraft:fireball", {
|
||||||
"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(
|
local remove = minetest.after(2, function()
|
||||||
2,
|
|
||||||
function()
|
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
end)
|
end)
|
||||||
local pos = self.object:getpos()
|
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:fireball"
|
if obj:get_luaentity().name ~= "witchcraft:fireball" and obj:get_luaentity().name ~= "__builtin:item" and obj:get_luaentity().name ~= "gauges:hp_bar" then
|
||||||
and obj:get_luaentity().name ~= "__builtin:item"
|
obj:punch(self.object, 1.0, {
|
||||||
and obj:get_luaentity().name ~= "gauges:hp_bar"
|
|
||||||
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)
|
||||||
@ -278,11 +239,10 @@ minetest.register_entity(
|
|||||||
for dz=0,1 do
|
for dz=0,1 do
|
||||||
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.env:get_node(p).name
|
||||||
if n ~= "witchcraft:fireball" and n ~="default:dirt_with_grass"
|
if n ~= "witchcraft:fireball" and n ~="default:dirt_with_grass" and n ~="default:dirt_with_dry_grass" and n ~="default:stone" and n ~= "gauges:hp_bar" 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
|
if minetest.registered_nodes[n].groups.flammable --[[or math.random(1, 100) <= 1]] then
|
||||||
minetest.set_node(t, {name="fire:basic_flame"})
|
minetest.env:set_node(t, {name="fire:basic_flame"})
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@ -291,18 +251,18 @@ minetest.register_entity(
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
hit_node = function(self, pos, node)
|
hit_node = function(self, pos, node)
|
||||||
-- local pos = self.object:getpos()
|
-- local pos = self.object:getpos()
|
||||||
for dx=-4,4 do
|
for dx=-4,4 do
|
||||||
for dy=-4,4 do
|
for dy=-4,4 do
|
||||||
for dz=-4,4 do
|
for dz=-4,4 do
|
||||||
local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
|
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 t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
|
||||||
local n = minetest.get_node(pos).name
|
local n = minetest.env:get_node(pos).name
|
||||||
if math.random(1, 50) <= 35 then
|
if math.random(1, 50) <= 35 then
|
||||||
minetest.remove_node(p)
|
minetest.env:remove_node(p)
|
||||||
end
|
end
|
||||||
if minetest.registered_nodes[n].groups.flammable or math.random(1, 100) <=5 then
|
if minetest.registered_nodes[n].groups.flammable or math.random(1, 100) <=5 then
|
||||||
minetest.set_node(t, {name="fire:basic_flame"})
|
minetest.env:set_node(t, {name="fire:basic_flame"})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -329,31 +289,24 @@ minetest.register_entity(
|
|||||||
)
|
)
|
||||||
|
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
minetest.register_entity(
|
minetest.register_entity("witchcraft:tree", {
|
||||||
"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(
|
local remove = minetest.after(2, function()
|
||||||
2,
|
|
||||||
function()
|
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
end)
|
end)
|
||||||
local pos = self.object:getpos()
|
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:tree"
|
if obj:get_luaentity().name ~= "witchcraft:tree" and obj:get_luaentity().name ~= "__builtin:item" and obj:get_luaentity().name ~= "gauges:hp_bar" then
|
||||||
and obj:get_luaentity().name ~= "__builtin:item"
|
|
||||||
and obj:get_luaentity().name ~= "gauges:hp_bar"
|
|
||||||
then
|
|
||||||
obj:remove()
|
obj:remove()
|
||||||
local treepos = self.object:getpos()
|
local treepos = self.object:getpos()
|
||||||
default.grow_new_jungle_tree(treepos)
|
default.grow_new_jungle_tree(treepos)
|
||||||
@ -366,8 +319,8 @@ minetest.register_entity(
|
|||||||
for dz=0,1 do
|
for dz=0,1 do
|
||||||
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.env:get_node(p).name
|
||||||
if n ~= "witchcraft:tree" and n ~="air" then
|
if n ~= "witchcraft:tree" and n ~="air" and n ~= "gauges:hp_bar" then
|
||||||
local treepos = self.object:getpos()
|
local treepos = self.object:getpos()
|
||||||
default.grow_new_jungle_tree(treepos)
|
default.grow_new_jungle_tree(treepos)
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
@ -403,11 +356,9 @@ minetest.register_entity(
|
|||||||
)
|
)
|
||||||
|
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_entity(
|
minetest.register_entity("witchcraft:ice", {
|
||||||
"witchcraft:ice",
|
|
||||||
{
|
|
||||||
visual="sprite",
|
visual="sprite",
|
||||||
visual_size={x=1,y=1},
|
visual_size={x=1,y=1},
|
||||||
physical=false,
|
physical=false,
|
||||||
@ -425,13 +376,8 @@ minetest.register_entity(
|
|||||||
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 ~= "gauges:hp_bar" then
|
||||||
and obj:get_luaentity().name ~= "__builtin:item"
|
obj:punch(self.object, 1.0, {
|
||||||
and obj:get_luaentity().name ~= "gauges:hp_bar"
|
|
||||||
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)
|
||||||
@ -443,12 +389,12 @@ minetest.register_entity(
|
|||||||
for dz=0,1 do
|
for dz=0,1 do
|
||||||
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.env:get_node(p).name
|
||||||
if n == "default:water_source" or n =="default:river_water_source" then
|
if n == "default:water_source" or n =="default:river_water_source" then
|
||||||
local pos = self.object:getpos()
|
local pos = self.object:getpos()
|
||||||
minetest.set_node(pos, {name="default:ice"})
|
minetest.set_node(pos, {name="default:ice"})
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
elseif n ~= "air" then
|
elseif n ~= "air" and n ~= "gauges:hp_bar" then
|
||||||
local velo = self.object:getvelocity()
|
local velo = self.object:getvelocity()
|
||||||
self.object:setvelocity({x=velo.x*-1, y=velo.y*0, z=velo.z*1})
|
self.object:setvelocity({x=velo.x*-1, y=velo.y*0, z=velo.z*1})
|
||||||
--self.object:remove()
|
--self.object:remove()
|
||||||
|
Before Width: | Height: | Size: 388 B After Width: | Height: | Size: 349 B |
Before Width: | Height: | Size: 377 B After Width: | Height: | Size: 356 B |
Before Width: | Height: | Size: 394 B After Width: | Height: | Size: 350 B |
Before Width: | Height: | Size: 382 B After Width: | Height: | Size: 354 B |
Before Width: | Height: | Size: 385 B After Width: | Height: | Size: 355 B |
Before Width: | Height: | Size: 391 B After Width: | Height: | Size: 351 B |
Before Width: | Height: | Size: 544 B After Width: | Height: | Size: 374 B |
Before Width: | Height: | Size: 550 B After Width: | Height: | Size: 378 B |
Before Width: | Height: | Size: 424 B After Width: | Height: | Size: 365 B |
Before Width: | Height: | Size: 546 B After Width: | Height: | Size: 375 B |
Before Width: | Height: | Size: 552 B After Width: | Height: | Size: 377 B |
Before Width: | Height: | Size: 392 B After Width: | Height: | Size: 349 B |
Before Width: | Height: | Size: 391 B After Width: | Height: | Size: 351 B |
Before Width: | Height: | Size: 373 B After Width: | Height: | Size: 342 B |
Before Width: | Height: | Size: 395 B After Width: | Height: | Size: 350 B |
Before Width: | Height: | Size: 395 B After Width: | Height: | Size: 349 B |
Before Width: | Height: | Size: 387 B After Width: | Height: | Size: 349 B |
Before Width: | Height: | Size: 375 B After Width: | Height: | Size: 345 B |
Before Width: | Height: | Size: 378 B After Width: | Height: | Size: 354 B |
Before Width: | Height: | Size: 419 B After Width: | Height: | Size: 359 B |
Before Width: | Height: | Size: 393 B After Width: | Height: | Size: 352 B |
Before Width: | Height: | Size: 398 B After Width: | Height: | Size: 347 B |