Fix some stuff in antigravity, rename anticrystal to antimese and add antifloc texture (@paramat)

master
Zeg9 2013-04-23 14:45:21 +02:00
parent 0fc5cc3521
commit bb77230e4e
7 changed files with 46 additions and 28 deletions

View File

@ -1,10 +1,6 @@
local antigravities = {}
local same_pos = function(p1,p2)
return p1.x == p2.x and p1.y == p2.y and p1.z == p2.z
end
local is_antigravity = function(pos)
for _, i in ipairs(antigravities) do
if i.x == pos.x
@ -23,6 +19,15 @@ minetest.register_node("ruby:antigravity",{
groups = {anti=1,level=2},
sounds = default.node_sound_stone_defaults(),
on_construct = function(pos)
-- Registers antigravity in abm, so no need to do it here
end,
on_destruct = function(pos)
for i, a in ipairs(antigravities) do
if a.x == pos.x and a.y == pos.y and a.z == pos.z then
print("Removing..."..i)
table.remove(antigravities,i)
end
end
end,
})
@ -55,15 +60,15 @@ minetest.register_abm({
maxpos.x = pos.x + .5
maxpos.y = pos.y
maxpos.z = pos.z + .5
minetest.add_particlespawner(100,5,
minetest.add_particlespawner(100,10,
minpos, maxpos,
{x=0,y=20,z=0}, {x=0,y=20,z=0},
{x=0,y=0,z=0}, {x=0,y=0,z=0},
1, 1,
10, 10,
.1, 1,
false, "ruby_particle_mese.png")
if not is_antigravity(pos) then
if not is_antigravity({x=pos.x, y=pos.y+1, z=pos.z}) then
table.insert(antigravities,pos)
end
end,
@ -73,7 +78,7 @@ minetest.register_craft({
output = 'ruby:antigravity',
recipe = {
{'default:mese_crystal','default:mese_crystal','default:mese_crystal'},
{'default:mese_crystal','ruby:anticrystalblock','default:mese_crystal'},
{'default:mese_crystal','ruby:antimeseblock','default:mese_crystal'},
{'default:mese_crystal','default:mese_crystal','default:mese_crystal'},
}
})

View File

@ -1,24 +1,26 @@
minetest.register_craftitem("ruby:anticrystal", {
description = "Anticrystal",
inventory_image = "ruby_anticrystal.png",
-- ITEMS --
minetest.register_craftitem("ruby:antimese", {
description = "Antimese Crystal",
inventory_image = "ruby_antimese.png",
})
minetest.register_node("ruby:anticrystalblock", {
description = "Anticrystal Block",
tiles = {"ruby_anticrystal_block.png"},
minetest.register_node("ruby:antimeseblock", {
description = "Antimese Block",
tiles = {"ruby_antimese_block.png"},
is_ground_content = true,
groups = {anti=1,level=2},
sounds = default.node_sound_stone_defaults(),
})
local APS = 0.25 -- Anticrystal Pickaxe Speed
local APU = 100 -- Anticrystal Pickaxe Uses
local APS = 0.25 -- Antimese Pickaxe Speed
local APU = 100 -- Antimese Pickaxe Uses
minetest.register_tool("ruby:pick_anticrystal", {
description = "Anticrystal Pickaxe",
inventory_image = "ruby_tool_anticrystalpick.png",
minetest.register_tool("ruby:pick_antimese", {
description = "Antimese Pickaxe",
inventory_image = "ruby_tool_antimesepick.png",
tool_capabilities = {
full_punch_interval = 0.7,
max_drop_level=3,
@ -33,25 +35,29 @@ minetest.register_tool("ruby:pick_anticrystal", {
},
})
-- CRAFTING --
minetest.register_craft({
output = 'ruby:pick_anticrystal',
output = 'ruby:pick_antimese',
recipe = {
{'ruby:anticrystal', 'ruby:anticrystal', 'ruby:anticrystal'},
{'ruby:antimese', 'ruby:antimese', 'ruby:antimese'},
{'', 'default:stick', ''},
{'', 'default:stick', ''},
}
})
minetest.register_craft({
output = 'ruby:anticrystalblock',
output = 'ruby:antimeseblock',
recipe = {
{'ruby:anticrystal', 'ruby:anticrystal', 'ruby:anticrystal'},
{'ruby:anticrystal', 'ruby:anticrystal', 'ruby:anticrystal'},
{'ruby:anticrystal', 'ruby:anticrystal', 'ruby:anticrystal'},
{'ruby:antimese', 'ruby:antimese', 'ruby:antimese'},
{'ruby:antimese', 'ruby:antimese', 'ruby:antimese'},
{'ruby:antimese', 'ruby:antimese', 'ruby:antimese'},
}
})
-- Ruby block + Mese block --> Anticrystal
-- ABM --
-- Ruby block + Mese block --> Antimese
minetest.register_abm({
nodenames={"default:mese"},
neighbors={"ruby:rubyblock"},
@ -78,7 +84,7 @@ minetest.register_abm({
for z = pos.z-r, pos.z+r, 1 do
local cpos = {x=x,y=y,z=z}
if minetest.env:get_node(cpos).name == "ruby:rubyblock" then
local e = minetest.env:add_item(cpos,{name="ruby:anticrystal"})
local e = minetest.env:add_item(cpos,{name="ruby:antimese"})
e:setvelocity({x=0,y=10,z=0})
end
-- The commented part allows to randomly destroy nodes around
@ -92,3 +98,10 @@ minetest.register_abm({
end
end,
})
-- ALIASES --
-- This is for compatibility with older versions of the mod, where antimese was anticrystal
minetest.register_alias("ruby:anticrystal","ruby:antimese")
minetest.register_alias("ruby:anticrystalblock","ruby:antimeseblock")
minetest.register_alias("ruby:pick_anticrystal", "ruby:pick_antimese")

View File

@ -3,7 +3,7 @@
-- Remove the modules you do not want to load
local MODULES = {
"ruby",
"anticrystal",
"antimese",
"antigravity",
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 560 B

View File

Before

Width:  |  Height:  |  Size: 454 B

After

Width:  |  Height:  |  Size: 454 B

View File

Before

Width:  |  Height:  |  Size: 339 B

After

Width:  |  Height:  |  Size: 339 B

View File

Before

Width:  |  Height:  |  Size: 277 B

After

Width:  |  Height:  |  Size: 277 B