add e.r.p.

This commit is contained in:
HybridDog 2013-08-16 22:25:27 +02:00
parent 5f79639ca7
commit e354cf2c8a
7 changed files with 99 additions and 9 deletions

View File

@ -258,6 +258,40 @@ minetest.register_abm({
end,
})
local function rm_lqud(pos, node)
minetest.env:remove_node(pos)
for i = -1,1,2 do
if minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z+i}).name == node then
rm_lqud({x=pos.x, y=pos.y, z=pos.z+i}, node)
end
if minetest.env:get_node({x=pos.x+i, y=pos.y, z=pos.z}).name == node then
rm_lqud({x=pos.x+i, y=pos.y, z=pos.z}, node)
end
if minetest.env:get_node({x=pos.x, y=pos.y+i, z=pos.z}).name == node then
rm_lqud({x=pos.x, y=pos.y+i, z=pos.z}, node)
end
end
end
minetest.register_node("extrablocks:seakiller", {
description = "Sponge",
drawtype = "normal",
tiles = {"default_mese_block.png^default_glass.png"},
paramtype = 'light',
sunlight_propagates = true,
walkable = true,
pointable = true,
diggable = true,
buildable_to = false,
groups = {snappy=2, flammable=1},
on_construct = function(pos)
local t1 = os.clock()
for _, nam in ipairs({"default:water_flowing", "default:water_source", "default:lava_source", "default:lava_flowing"}) do
rm_lqud(pos, nam)
end
print(string.format("[extrablocks] ("..pos.x..", "..pos.y..", "..pos.z..") liquids removed after: %.2fs", os.clock() - t1))
end
})
local function moitem(name, desc)
@ -331,14 +365,16 @@ minetest.register_ore({
})
local path = minetest.get_modpath("extrablocks")
extrablocks = {}
dofile(minetest.get_modpath("extrablocks").."/settings.lua")
if extrablocks.enable_moss then
dofile(minetest.get_modpath("extrablocks").."/natur.lua")
dofile(path.."/settings.lua")
if extrablocks_enable_moss then
dofile(path.."/natur.lua")
end
if extrablocks.allow_crafting then
dofile(minetest.get_modpath("extrablocks").."/crafting.lua")
if extrablocks_allow_crafting then
dofile(path.."/crafting.lua")
end
if extrablocks_movement_stuff then
dofile(path.."/mvmt.lua")
end
print("[extrablocks] loaded")

53
mvmt.lua Normal file
View File

@ -0,0 +1,53 @@
local function lit_rocket(pos)
minetest.add_particlespawner(
3, --amount
0.1, --time
{x=pos.x-0.2, y=pos.y-0.2, z=pos.z-0.2}, --minpos
{x=pos.x+0.2, y=pos.y+0.2, z=pos.z+0.2}, --maxpos
{x=-0, y=-0, z=-0}, --minvel
{x=0, y=0, z=0}, --maxvel
{x=-0.5,y=5,z=-0.5}, --minacc
{x=0.5,y=5,z=0.5}, --maxacc
0.1, --minexptime
1, --maxexptime
2, --minsize
8, --maxsize
false, --collisiondetection
"smoke_puff.png" --texture
)
minetest.sound_play("extrablocks_rbp_lit", {pos = pos, gain = 0.2, max_hear_distance = 3})
end
--http://www.freesound.org/people/roubignolle/sounds/36352/
local function off_rocket(pos)
minetest.sound_play("extrablocks_rbp_off", {pos = pos, gain = 0.2, max_hear_distance = 3})
end
local function acc(p)
if p:get_player_control()["sneak"] then
return 0.1
end
return -1
end
minetest.register_craftitem("extrablocks:rocket_bag", {
description = "Experimental Rocket Bag",
inventory_image = "extrablocks_rbp.png",
metadata = "off",
on_use = function(itemstack, user)
local p = user
local item = itemstack:to_table();
if item["metadata"]=="off" then
local accel = acc(p)
p:set_physics_override(nil,nil,accel)
item["metadata"] = "on"
lit_rocket(pos)
else
p:set_physics_override(nil,nil,1)
item["metadata"] = "off"
off_rocket(pos)
end
itemstack:replace(item)
return itemstack
end,
})

View File

Before

Width:  |  Height:  |  Size: 415 B

After

Width:  |  Height:  |  Size: 415 B

View File

@ -1,4 +1,5 @@
--This file contains configuration options for the extrablocks mod.
extrablocks.allow_crafting = true
extrablocks.enable_moss = true
extrablocks_allow_crafting = true
extrablocks_enable_moss = true
extrablocks_movement_stuff = true

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB