1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-12-25 18:20:36 +01:00

Merge branch '3d_armor_stats' of https://github.com/crabman77/minetest-minetestforfun-server into crabman77-3d_armor_stats

This commit is contained in:
sys4-fr 2017-04-10 01:19:00 +02:00
commit 10b2a8bd70
2 changed files with 79 additions and 86 deletions

View File

@ -642,8 +642,8 @@ for _, row in ipairs(witchcraft.pot_new) do --change 'pot_new' to 'pot' for the
local wield_item = clicker:get_wielded_item():get_name()
if wield_item == "vessels:glass_bottle" and clicker:get_wielded_item():get_count() == 3 then
item:replace("witchcraft:potion_"..color)
minetest.env:add_item({x=pos.x, y=pos.y+1.5, z=pos.z}, "witchcraft:potion_"..color)
minetest.env:add_item({x=pos.x, y=pos.y+1.5, z=pos.z}, "witchcraft:potion_"..color)
minetest.add_item({x=pos.x, y=pos.y+1.5, z=pos.z}, "witchcraft:potion_"..color)
minetest.add_item({x=pos.x, y=pos.y+1.5, z=pos.z}, "witchcraft:potion_"..color)
minetest.set_node(pos, {name="witchcraft:pot", param2=node.param2})
elseif wield_item == "vessels:glass_bottle" and clicker:get_wielded_item():get_count() ~= 3 then
item:replace("witchcraft:potion_"..color)
@ -937,7 +937,7 @@ minetest.register_entity("witchcraft:tnt_splash", {
for dz=0,1 do
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 n = minetest.env:get_node(p).name
local n = minetest.get_node(p).name
if n ~= "witchcraft:tnt_splash" and n ~="default:obsidian" and n ~= "air" then
local pos = self.object:getpos()
minetest.sound_play("default_break_glass.1", {
@ -959,7 +959,7 @@ minetest.register_entity("witchcraft:tnt_splash", {
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.env:get_node(pos).name
local n = minetest.get_node(pos).name
if math.random(1, 50) <= 35 then
tnt.boom(n, {damage_radius=5,radius=3,ignore_protection=false})
end
@ -967,7 +967,7 @@ minetest.register_entity("witchcraft:tnt_splash", {
if not ignore_protection and minetest.is_protected(npos, "") then
return
end
minetest.env:set_node(t, {name="fire:basic_flame"})
minetest.set_node(t, {name="fire:basic_flame"})
end
end
end
@ -1006,12 +1006,12 @@ minetest.register_entity("witchcraft:fire_splash", {
for dz=0,1 do
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 n = minetest.env:get_node(p).name
local n = minetest.get_node(p).name
if n ~= "witchcraft:fire_splash" and n ~= "air" then
if not ignore_protection and minetest.is_protected(npos, "") then
return
end
minetest.env:set_node(t, {name="fire:basic_flame"})
minetest.set_node(t, {name="fire:basic_flame"})
minetest.sound_play("default_break_glass.1", {
pos = self.object:getpos(),
max_hear_distance = 20,
@ -1032,12 +1032,12 @@ minetest.register_entity("witchcraft:fire_splash", {
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.env:get_node(pos).name
local n = minetest.get_node(pos).name
if math.random(1, 50) <= 1 then
minetest.env:remove_node(p)
minetest.remove_node(p)
end
if minetest.registered_nodes[n].groups.flammable or math.random(1, 100) <=5 then
minetest.env:set_node(t, {name="fire:basic_flame"})
minetest.set_node(t, {name="fire:basic_flame"})
end
end
end
@ -1093,7 +1093,7 @@ minetest.register_entity("witchcraft:death_splash", {
for dz=0,1 do
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 n = minetest.env:get_node(p).name
local n = minetest.get_node(p).name
if n ~= "witchcraft:death_splash" and n ~= "air" then
self.object:remove()
elseif n =="default:dirt_with_grass" or n =="default:dirt_with_dry_grass" then
@ -1159,10 +1159,8 @@ minetest.register_entity("witchcraft:heal_splash", {
for dz=0,1 do
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 n = minetest.env:get_node(p).name
local n = minetest.get_node(p).name
if n ~= "witchcraft:heal_splash" and n ~= "air" then
self.object:remove()
elseif n =="default:dirt_with_grass" or n =="default:dirt_with_dry_grass" then
minetest.sound_play("default_break_glass", {
pos = self.object:getpos(),
max_hear_distance = 20,
@ -1218,7 +1216,7 @@ minetest.register_entity("witchcraft:slow_splash", {
for dz=0,1 do
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 n = minetest.env:get_node(p).name
local n = minetest.get_node(p).name
if n ~= "witchcraft:slow_splash" and n ~= "air" then
self.object:remove()
elseif n =="default:dirt_with_grass" or n =="default:dirt_with_dry_grass" then
@ -1277,7 +1275,7 @@ minetest.register_entity("witchcraft:fast_splash", {
for dz=0,1 do
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 n = minetest.env:get_node(p).name
local n = minetest.get_node(p).name
if n ~= "witchcraft:fast_splash" and n ~= "air" then
self.object:remove()
elseif n =="default:dirt_with_grass" or n =="default:dirt_with_dry_grass" then
@ -1336,7 +1334,7 @@ minetest.register_entity("witchcraft:antigrav_splash", {
for dz=0,1 do
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 n = minetest.env:get_node(p).name
local n = minetest.get_node(p).name
if n ~= "air" then
minetest.sound_play("default_break_glass", {
pos = self.object:getpos(),
@ -1393,7 +1391,7 @@ minetest.register_entity("witchcraft:jump_splash", {
for dz=0,1 do
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 n = minetest.env:get_node(p).name
local n = minetest.get_node(p).name
if n ~= "air" then
minetest.sound_play("default_break_glass", {
pos = self.object:getpos(),
@ -1450,10 +1448,8 @@ minetest.register_entity("witchcraft:murky_splash", {
for dz=0,1 do
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 n = minetest.env:get_node(p).name
local n = minetest.get_node(p).name
if n ~= "witchcraft:murky_splash" and n ~= "air" then
self.object:remove()
elseif n =="default:dirt_with_grass" or n =="default:dirt_with_dry_grass" then
minetest.sound_play("default_break_glass", {
pos = self.object:getpos(),
max_hear_distance = 20,
@ -1536,12 +1532,12 @@ minetest.register_entity("witchcraft:smoke_splash", {
playereffects.register_effect_type("potion_speed_lv1", "High speed", nil, {"speed"},
function(player)
--player:set_physics_override(2,nil,nil)
player_physics.add(player, "speed", "potion_speed_lv1", 1)
player_physics.set_stats(player, "potion_speed_lv1", {speed=1})
end,
function(effect, player)
--player:set_physics_override(1,nil,nil)
player_physics.remove(player, "speed", "potion_speed_lv1")
player_physics.remove(player, "potion_speed_lv1")
end,
false
)
@ -1549,12 +1545,12 @@ playereffects.register_effect_type("potion_speed_lv1", "High speed", nil, {"spee
playereffects.register_effect_type("potion_speed_lv2", "High speed", nil, {"speed"},
function(player)
--player:set_physics_override(2.5,nil,nil)
player_physics.add(player, "speed", "potion_speed_lv2", 1.5)
player_physics.set_stats(player, "potion_speed_lv2", {speed=1.5})
end,
function(effect, player)
--player:set_physics_override(1,nil,nil)
player_physics.remove(player, "speed", "potion_speed_lv2")
player_physics.remove(player, "potion_speed_lv2")
end,
false
)
@ -1562,14 +1558,12 @@ playereffects.register_effect_type("potion_speed_lv2", "High speed", nil, {"spee
playereffects.register_effect_type("potion_jump_lvx", "High Jump", nil, {"jump"},
function(player)
--player:set_physics_override(nil,1.5,0.8)
player_physics.add(player, "jump", "potion_jump_lvx", 0.5)
player_physics.add(player, "gravity", "potion_jump_lvx", -0.2)
player_physics.set_stats(player, "potion_jump_lvx", {jump=0.5, gravity=-0.2})
end,
function(effect, player)
--player:set_physics_override(nil,1,1)
player_physics.remove(player, "jump", "potion_jump_lvx")
player_physics.remove(player, "gravity", "potion_jump_lvx")
player_physics.remove(player, "potion_jump_lvx")
end,
false
)
@ -1577,12 +1571,12 @@ playereffects.register_effect_type("potion_jump_lvx", "High Jump", nil, {"jump"}
playereffects.register_effect_type("potion_antigrav_lvx", "Light weight", nil, {"gravity"},
function(player)
--player:set_physics_override(nil,nil,0.1)
player_physics.add(player, "gravity", "potion_antigrav_lvx", -0.9)
player_physics.set_stats(player, "potion_antigrav_lvx", {gravity=-0.9})
end,
function(effect, player)
--player:set_physics_override(nil,nil,1)
player_physics.remove(player, "gravity", "potion_antigrav_lvx")
player_physics.remove(player, "potion_antigrav_lvx")
end,
false
)
@ -1590,12 +1584,12 @@ playereffects.register_effect_type("potion_antigrav_lvx", "Light weight", nil, {
playereffects.register_effect_type("potion_slow_lv1", "Low speed", nil, {"speed"},
function(player)
--player:set_physics_override(0.5,nil,nil)
player_physics.add(player, "speed", "potion_slow_lv1", -0.5)
player_physics.set_stats(player, "potion_slow_lv1", {speed=-0.5})
end,
function(effect, player)
--player:set_physics_override(1,nil,nil)
player_physics.remove(player, "speed", "potion_slow_lv1")
player_physics.remove(player, "potion_slow_lv1")
end,
false
)
@ -1603,12 +1597,12 @@ playereffects.register_effect_type("potion_slow_lv1", "Low speed", nil, {"speed"
playereffects.register_effect_type("potion_slow_lv2", "Low speed", nil, {"speed"},
function(player)
--player:set_physics_override(0.4,nil,nil)
player_physics.add(player, "speed", "potion_slow_lv2", -0.6)
player_physics.set_stats(player, "potion_slow_lv2", {speed=-0.6})
end,
function(effect, player)
--player:set_physics_override(1,nil,nil)
player_physics.remove(player, "speed", "potion_slow_lv2")
player_physics.remove(player, "potion_slow_lv2")
end,
false
)
@ -1616,12 +1610,12 @@ playereffects.register_effect_type("potion_slow_lv2", "Low speed", nil, {"speed"
playereffects.register_effect_type("potion_swim_lv1", "Fast Swim", nil, {"swim"},
function(player)
--player:set_physics_override(3,nil,nil)
player_physics.add(player, "speed", "potion_swim_lv1", 2)
player_physics.set_stats(player, "potion_swim_lv1", {speed=2})
end,
function(effect, player)
--player:set_physics_override(1,nil,nil)
player_physics.remove(player, "speed", "potion_swim_lv1")
player_physics.remove(player, "potion_swim_lv1")
end,
false
)
@ -1629,8 +1623,7 @@ playereffects.register_effect_type("potion_swim_lv1", "Fast Swim", nil, {"swim"}
playereffects.register_effect_type("potion_swim_lv2", "Dive", nil, {"swim"},
function(player)
--player:set_physics_override(3,nil,4)
player_physics.add(player, "speed", "potion_swim_lv2", 2)
player_physics.add(player, "gravity", "potion_swim_lv2", 3)
player_physics.set_stats(player, "potion_swim_lv2", {speed=2, gravity=3})
end,
function(effect, player)
@ -1686,7 +1679,7 @@ minetest.register_node("witchcraft:splash_orange", {
local playerpos = placer:getpos();
local vec = {x=dir.x*6,y=dir.y*3.5,z=dir.z*6}
local acc = {x=0,y=-9.8,z=0}
local obj = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+2+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:fire_splash")
local obj = minetest.add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+2+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:fire_splash")
obj:setvelocity(vec)
obj:setacceleration(acc)
item:take_item()
@ -1715,7 +1708,7 @@ minetest.register_node("witchcraft:splash_purple", {
local playerpos = placer:getpos();
local vec = {x=dir.x*9,y=dir.y*3.5,z=dir.z*9}
local acc = {x=0,y=-9.8,z=0}
local obj = minetest.env:add_entity({x=playerpos.x+dir.x,y=playerpos.y+2+dir.y,z=playerpos.z+dir.z}, "witchcraft:smoke_splash")
local obj = minetest.add_entity({x=playerpos.x+dir.x,y=playerpos.y+2+dir.y,z=playerpos.z+dir.z}, "witchcraft:smoke_splash")
obj:setvelocity(vec)
obj:setacceleration(acc)
item:take_item()
@ -1744,7 +1737,7 @@ minetest.register_node("witchcraft:splash_red", {
local playerpos = placer:getpos();
local vec = {x=dir.x*9,y=dir.y*3.5,z=dir.z*9}
local acc = {x=0,y=-9,z=0}
local obj = minetest.env:add_entity({x=playerpos.x+dir.x*2,y=playerpos.y+2+dir.y,z=playerpos.z+dir.z*2}, "witchcraft:heal_splash")
local obj = minetest.add_entity({x=playerpos.x+dir.x*2,y=playerpos.y+2+dir.y,z=playerpos.z+dir.z*2}, "witchcraft:heal_splash")
obj:setvelocity(vec)
obj:setacceleration(acc)
item:take_item()
@ -1773,7 +1766,7 @@ minetest.register_node("witchcraft:splash_green", {
local playerpos = placer:getpos();
local vec = {x=dir.x*9,y=dir.y*3.5,z=dir.z*9}
local acc = {x=0,y=-9,z=0}
local obj = minetest.env:add_entity({x=playerpos.x+dir.x*2,y=playerpos.y+2+dir.y,z=playerpos.z+dir.z*2}, "witchcraft:jump_splash")
local obj = minetest.add_entity({x=playerpos.x+dir.x*2,y=playerpos.y+2+dir.y,z=playerpos.z+dir.z*2}, "witchcraft:jump_splash")
obj:setvelocity(vec)
obj:setacceleration(acc)
item:take_item()
@ -1802,7 +1795,7 @@ minetest.register_node("witchcraft:splash_cyan", {
local playerpos = placer:getpos();
local vec = {x=dir.x*9,y=dir.y*3.5,z=dir.z*9}
local acc = {x=0,y=-9,z=0}
local obj = minetest.env:add_entity({x=playerpos.x+dir.x*2,y=playerpos.y+2+dir.y,z=playerpos.z+dir.z*2}, "witchcraft:antigrav_splash")
local obj = minetest.add_entity({x=playerpos.x+dir.x*2,y=playerpos.y+2+dir.y,z=playerpos.z+dir.z*2}, "witchcraft:antigrav_splash")
obj:setvelocity(vec)
obj:setacceleration(acc)
item:take_item()
@ -1831,7 +1824,7 @@ minetest.register_node("witchcraft:splash_redbrown", {
local playerpos = placer:getpos();
local vec = {x=dir.x*9,y=dir.y*3.5,z=dir.z*9}
local acc = {x=0,y=-9,z=0}
local obj = minetest.env:add_entity({x=playerpos.x+dir.x*2,y=playerpos.y+2+dir.y,z=playerpos.z+dir.z*2}, "witchcraft:slow_splash")
local obj = minetest.add_entity({x=playerpos.x+dir.x*2,y=playerpos.y+2+dir.y,z=playerpos.z+dir.z*2}, "witchcraft:slow_splash")
obj:setvelocity(vec)
obj:setacceleration(acc)
item:take_item()
@ -1860,7 +1853,7 @@ minetest.register_node("witchcraft:splash_magenta", {
local playerpos = placer:getpos();
local vec = {x=dir.x*13,y=dir.y*2.5,z=dir.z*13}
local acc = {x=0,y=-9,z=0}
local obj = minetest.env:add_entity({x=playerpos.x+dir.x*2,y=playerpos.y+2+dir.y,z=playerpos.z+dir.z*2}, "witchcraft:fast_splash")
local obj = minetest.add_entity({x=playerpos.x+dir.x*2,y=playerpos.y+2+dir.y,z=playerpos.z+dir.z*2}, "witchcraft:fast_splash")
obj:setvelocity(vec)
obj:setacceleration(acc)
item:take_item()
@ -1889,7 +1882,7 @@ minetest.register_node("witchcraft:splash_brown", {
local playerpos = placer:getpos();
local vec = {x=dir.x*9,y=dir.y*3.5,z=dir.z*9}
local acc = {x=0,y=-9,z=0}
local obj = minetest.env:add_entity({x=playerpos.x+dir.x*2,y=playerpos.y+2+dir.y,z=playerpos.z+dir.z*2}, "witchcraft:murky_splash")
local obj = minetest.add_entity({x=playerpos.x+dir.x*2,y=playerpos.y+2+dir.y,z=playerpos.z+dir.z*2}, "witchcraft:murky_splash")
obj:setvelocity(vec)
obj:setacceleration(acc)
item:take_item()
@ -1918,7 +1911,7 @@ minetest.register_node("witchcraft:splash_grey", {
local playerpos = placer:getpos();
local vec = {x=dir.x*9,y=dir.y*3.5,z=dir.z*9}
local acc = {x=0,y=-9,z=0}
local obj = minetest.env:add_entity({x=playerpos.x+dir.x*2,y=playerpos.y+2+dir.y,z=playerpos.z+dir.z*2}, "witchcraft:death_splash")
local obj = minetest.add_entity({x=playerpos.x+dir.x*2,y=playerpos.y+2+dir.y,z=playerpos.z+dir.z*2}, "witchcraft:death_splash")
obj:setvelocity(vec)
obj:setacceleration(acc)
item:take_item()
@ -1949,7 +1942,7 @@ minetest.register_node("witchcraft:splash_ggreen", {
local playerpos = placer:getpos();
local vec = {x=dir.x*6,y=dir.y*3.5,z=dir.z*6}
local acc = {x=0,y=-9.8,z=0}
local obj = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+2+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:shadow_splash")
local obj = minetest.add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+2+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:shadow_splash")
obj:setvelocity(vec)
obj:setacceleration(acc)
item:take_item()
@ -1978,7 +1971,7 @@ minetest.register_node("witchcraft:splash_yellwgrn", {
local playerpos = placer:getpos();
local vec = {x=dir.x*7,y=dir.y*3.5,z=dir.z*7}
local acc = {x=0,y=-9.8,z=0}
local obj = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+2+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:tnt_splash")
local obj = minetest.add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+2+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:tnt_splash")
obj:setvelocity(vec)
obj:setacceleration(acc)
item:take_item()
@ -2325,9 +2318,9 @@ minetest.register_entity("witchcraft:fire", {
for dz=0,1 do
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 n = minetest.env:get_node(p).name
local n = minetest.get_node(p).name
if n ~= "witchcraft:fire" and n ~= "air" and n ~="default:dirt_with_grass" and n ~="default:dirt_with_dry_grass" and n ~="default:stone" then
minetest.env:set_node(t, {name="fire:basic_flame"})
minetest.set_node(t, {name="fire:basic_flame"})
elseif n =="default:dirt_with_grass" or n =="default:dirt_with_dry_grass" then
self.object:remove()
return
@ -2342,12 +2335,12 @@ minetest.register_entity("witchcraft:fire", {
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.env:get_node(pos).name
local n = minetest.get_node(pos).name
if math.random(1, 50) <= 35 then
minetest.env:remove_node(p)
minetest.remove_node(p)
end
if minetest.registered_nodes[n].groups.flammable or math.random(1, 100) <=5 then
minetest.env:set_node(t, {name="fire:basic_flame"})
minetest.set_node(t, {name="fire:basic_flame"})
end
end
end
@ -2396,7 +2389,7 @@ minetest.register_node("witchcraft:potion_orange", {
local dir = placer:get_look_dir();
local playerpos = placer:getpos();
local vec = {x=dir.x*2,y=dir.y*2.5,z=dir.z*2}
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:fire")
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:fire")
obj:setvelocity(vec)
local part = minetest.add_particlespawner(
10, --amount
@ -2440,7 +2433,7 @@ minetest.register_node("witchcraft:potion_orange_2", {
local dir = placer:get_look_dir();
local playerpos = placer:getpos();
local vec = {x=dir.x*3,y=dir.y*3.5,z=dir.z*3}
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:fire")
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:fire")
obj:setvelocity(vec)
local part = minetest.add_particlespawner(
10, --amount
@ -2485,7 +2478,7 @@ minetest.register_node("witchcraft:splash_orange", {
local playerpos = placer:getpos();
local vec = {x=dir.x*6,y=dir.y*3.5,z=dir.z*6}
local acc = {x=0,y=-9.8,z=0}
local obj = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+2+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:fire_splash")
local obj = minetest.add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+2+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:fire_splash")
obj:setvelocity(vec)
obj:setacceleration(acc)
item:take_item()
@ -2514,7 +2507,7 @@ minetest.register_node("witchcraft:splash_yellwgrn", {
local playerpos = placer:getpos();
local vec = {x=dir.x*7,y=dir.y*3.5,z=dir.z*7}
local acc = {x=0,y=-9.8,z=0}
local obj = minetest.env:add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+2+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:tnt_splash")
local obj = minetest.add_entity({x=playerpos.x+dir.x*1.5,y=playerpos.y+2+dir.y,z=playerpos.z+0+dir.z}, "witchcraft:tnt_splash")
obj:setvelocity(vec)
obj:setacceleration(acc)
item:take_item()
@ -3054,11 +3047,11 @@ if minetest.get_modpath("experience") then
false, --collisiondetection
"orb.png" --texture
)
minetest.env:add_entity(pos, "experience:orb")
minetest.env:add_entity(pos, "experience:orb")
minetest.env:add_entity(pos, "experience:orb")
minetest.env:add_entity(pos, "experience:orb")
minetest.env:add_entity(pos, "experience:orb")
minetest.add_entity(pos, "experience:orb")
minetest.add_entity(pos, "experience:orb")
minetest.add_entity(pos, "experience:orb")
minetest.add_entity(pos, "experience:orb")
minetest.add_entity(pos, "experience:orb")
item:replace("vessels:glass_bottle")
return item
@ -3875,15 +3868,15 @@ minetest.register_node("witchcraft:portal", {
on_construct = function(pos, node, _)
minetest.after(1, function()
if minetest.get_modpath("horror") then
minetest.env:add_entity(pos, "horror:werewolf")
minetest.add_entity(pos, "horror:werewolf")
elseif minetest.get_modpath("dmobs") then
minetest.env:add_entity(pos, "dmobs:owl")
minetest.add_entity(pos, "dmobs:owl")
elseif minetest.get_modpath("mobs_animal") then
minetest.env:add_entity(pos, "mobs_animal:kitten")
minetest.add_entity(pos, "mobs_animal:kitten")
elseif minetest.get_modpath("mobs_monster") then
minetest.env:add_entity(pos, "mobs_monster:oerkki")
minetest.add_entity(pos, "mobs_monster:oerkki")
elseif minetest.get_modpath("pmobs") then
minetest.env:add_entity(pos, "pmobs:wolf")
minetest.add_entity(pos, "pmobs:wolf")
end
minetest.remove_node(pos)
end)

View File

@ -30,7 +30,7 @@ minetest.register_craftitem("witchcraft:scroll_wild", {
stack_max = 1,
on_use = function(item, placer)
local pos = placer:getpos();
minetest.env:add_entity(pos, "pmobs:dog")
minetest.add_entity(pos, "pmobs:dog")
item:take_item()
return item
end,
@ -44,10 +44,10 @@ minetest.register_craftitem("witchcraft:scroll_fireball", {
on_use = function(item, placer, pos)
local dir = placer:get_look_dir();
local playerpos = placer:getpos();
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")
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")
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 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")
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})
@ -80,9 +80,9 @@ minetest.register_craftitem("witchcraft:scroll_icicle", {
local dir = placer:get_look_dir();
local playerpos = placer:getpos();
local vec = {x=dir.x*7,y=dir.y*7,z=dir.z*7}
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.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.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")
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 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 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:setvelocity(vec)
obj2:setvelocity(vec)
obj3:setvelocity(vec)
@ -101,7 +101,7 @@ minetest.register_craftitem("witchcraft:scroll_nature", {
local dir = placer:get_look_dir();
local playerpos = placer:getpos();
local vec = {x=dir.x*6,y=dir.y*6,z=dir.z*6}
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")
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")
obj:setvelocity(vec)
item:take_item()
@ -239,10 +239,10 @@ minetest.register_entity("witchcraft:fireball", {
for dz=0,1 do
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 n = minetest.env:get_node(p).name
local n = minetest.get_node(p).name
if n ~= "witchcraft:fireball" and n ~="default:dirt_with_grass" 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.env:set_node(t, {name="fire:basic_flame"})
minetest.set_node(t, {name="fire:basic_flame"})
self.object:remove()
return
end
@ -257,12 +257,12 @@ minetest.register_entity("witchcraft:fireball", {
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.env:get_node(pos).name
local n = minetest.get_node(pos).name
if math.random(1, 50) <= 35 then
minetest.env:remove_node(p)
minetest.remove_node(p)
end
if minetest.registered_nodes[n].groups.flammable or math.random(1, 100) <=5 then
minetest.env:set_node(t, {name="fire:basic_flame"})
minetest.set_node(t, {name="fire:basic_flame"})
end
end
end
@ -319,7 +319,7 @@ minetest.register_entity("witchcraft:tree", {
for dz=0,1 do
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 n = minetest.env:get_node(p).name
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)
@ -389,7 +389,7 @@ minetest.register_entity("witchcraft:ice", {
for dz=0,1 do
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 n = minetest.env:get_node(p).name
local n = minetest.get_node(p).name
if n == "default:water_source" or n =="default:river_water_source" then
local pos = self.object:getpos()
minetest.set_node(pos, {name="default:ice"})