add support for tnt mod

master
adrido 2015-06-13 15:34:59 +02:00
parent fd6ecf70d9
commit ebdbb4146a
3 changed files with 34 additions and 4 deletions

View File

@ -2,4 +2,5 @@ default
bucket
mesecons?
locks?
moreores?
moreores?
tnt?

View File

@ -1,6 +1,3 @@
minetest.log("warning","This is an unstable beta version!")
cannons = {}
cannons.MODPATH = minetest.get_modpath(minetest.get_current_modname())
local worldpath = minetest.get_worldpath()
@ -31,6 +28,11 @@ if cannons.config:get("convert_old_nodes")=="true" then
dofile(cannons.MODPATH .."/convert.lua")
end
if minetest.get_modpath("tnt") ~=nil then
minetest.log("info","TNT mod is aviable. registering some TNT stuff")
dofile(cannons.MODPATH .."/tnt.lua")
end
if minetest.get_modpath("locks") ~=nil then
minetest.log("warning","locks mod enabled. dont execute locks.lua because this is an unstable beta version!")
--dofile(cannons.MODPATH .."/locks.lua")--if the locks mod is installed execute this file

27
tnt.lua Normal file
View File

@ -0,0 +1,27 @@
cannons.register_muni("tnt:tnt",{
physical = false,
timer=0,
textures = {"tnt_top.png", "tnt_bottom.png", "tnt_side.png", "tnt_side.png", "tnt_side.png", "tnt_side.png"},
lastpos={},
damage=15,
visual = "cube",
visual_size = {x=0.5, y=0.5},
range=1,
gravity=10,
velocity=20,
collisionbox = {-0.25,-0.25,-0.25, 0.25,0.25,0.25},
on_player_hit = function(self,pos,player)
minetest.registered_nodes["tnt:tnt_burning"].on_timer(pos);
self.object:remove()
end,
on_mob_hit = function(self,pos,mob)
minetest.registered_nodes["tnt:tnt_burning"].on_timer(pos);
self.object:remove()
end,
on_node_hit = function(self,pos,node)
minetest.registered_nodes["tnt:tnt_burning"].on_timer(pos);
self.object:remove()
end,
})
cannons.register_gunpowder("tnt:gunpowder");