mirror of
https://bitbucket.org/kingarthursteam/cannons.git
synced 2024-07-07 08:05:17 +02:00
add support for tnt mod
This commit is contained in:
parent
fd6ecf70d9
commit
ebdbb4146a
@ -2,4 +2,5 @@ default
|
|||||||
bucket
|
bucket
|
||||||
mesecons?
|
mesecons?
|
||||||
locks?
|
locks?
|
||||||
moreores?
|
moreores?
|
||||||
|
tnt?
|
||||||
|
8
init.lua
8
init.lua
@ -1,6 +1,3 @@
|
|||||||
minetest.log("warning","This is an unstable beta version!")
|
|
||||||
|
|
||||||
|
|
||||||
cannons = {}
|
cannons = {}
|
||||||
cannons.MODPATH = minetest.get_modpath(minetest.get_current_modname())
|
cannons.MODPATH = minetest.get_modpath(minetest.get_current_modname())
|
||||||
local worldpath = minetest.get_worldpath()
|
local worldpath = minetest.get_worldpath()
|
||||||
@ -31,6 +28,11 @@ if cannons.config:get("convert_old_nodes")=="true" then
|
|||||||
dofile(cannons.MODPATH .."/convert.lua")
|
dofile(cannons.MODPATH .."/convert.lua")
|
||||||
end
|
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
|
if minetest.get_modpath("locks") ~=nil then
|
||||||
minetest.log("warning","locks mod enabled. dont execute locks.lua because this is an unstable beta version!")
|
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
|
--dofile(cannons.MODPATH .."/locks.lua")--if the locks mod is installed execute this file
|
||||||
|
27
tnt.lua
Normal file
27
tnt.lua
Normal 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");
|
Loading…
Reference in New Issue
Block a user