fix mergeconflicts
This commit is contained in:
commit
960a9de9d8
188 changed files with 5137 additions and 1518 deletions
|
@ -1,37 +1,41 @@
|
|||
Minetest Game mod: tnt
|
||||
======================
|
||||
by PilzAdam and ShadowNinja
|
||||
See license.txt for license information.
|
||||
|
||||
Introduction:
|
||||
Authors of source code
|
||||
----------------------
|
||||
PilzAdam (MIT)
|
||||
ShadowNinja (MIT)
|
||||
sofar (sofar@foo-projects.org) (MIT)
|
||||
Various Minetest developers and contributors (MIT)
|
||||
|
||||
Authors of media (textures)
|
||||
---------------------------
|
||||
BlockMen (CC BY-SA 3.0):
|
||||
All textures not mentioned below.
|
||||
|
||||
ShadowNinja (CC BY-SA 3.0):
|
||||
tnt_smoke.png
|
||||
|
||||
Wuzzy (CC BY-SA 3.0):
|
||||
All gunpowder textures except tnt_gunpowder_inventory.png.
|
||||
|
||||
sofar (sofar@foo-projects.org) (CC BY-SA 3.0):
|
||||
tnt_blast.png
|
||||
|
||||
Introduction
|
||||
------------
|
||||
This mod adds TNT to Minetest. TNT is a tool to help the player
|
||||
in mining.
|
||||
|
||||
How to use the mod:
|
||||
Craft gunpowder by placing coal and gravel in the crafting area. The
|
||||
gunpowder can be used to craft TNT or as fuze for TNT. To craft TNT
|
||||
surround gunpowder with 4 wood in a + shape.
|
||||
Craft gunpowder by placing coal and gravel in the crafting area.
|
||||
The gunpowder can be used to craft TNT or as fuse for TNT.
|
||||
To craft TNT surround gunpowder with 4 wood in a + shape.
|
||||
|
||||
There are different ways to blow up TNT:
|
||||
1. Hit it with a torch.
|
||||
2. Hit a gunpowder fuze that leads to a TNT block with a torch.
|
||||
3. Activate it with mesecons (fastest way)
|
||||
Be aware of the damage radius of 7 blocks!
|
||||
2. Hit a gunpowder fuse that leads to a TNT block with a torch or flint-and-steel.
|
||||
3. Activate it with mesecons (fastest way).
|
||||
|
||||
License:
|
||||
WTFPL (see below)
|
||||
|
||||
See also:
|
||||
http://minetest.net/
|
||||
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
Version 2, December 2004
|
||||
|
||||
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim or modified
|
||||
copies of this license document, and changing it is allowed as long
|
||||
as the name is changed.
|
||||
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. You just DO WHAT THE FUCK YOU WANT TO.
|
||||
Be aware of the damage radius of 6 blocks!
|
||||
|
|
|
@ -94,7 +94,7 @@ local function destroy(drops, npos, cid, c_air, c_fire, on_blast_queue, ignore_p
|
|||
return c_fire
|
||||
else
|
||||
local node_drops = minetest.get_node_drops(def.name, "")
|
||||
for _, item in ipairs(node_drops) do
|
||||
for _, item in pairs(node_drops) do
|
||||
add_drop(drops, item)
|
||||
end
|
||||
return c_air
|
||||
|
@ -176,7 +176,7 @@ local function entity_physics(pos, radius, drops)
|
|||
}, nil)
|
||||
end
|
||||
end
|
||||
for _, item in ipairs(entity_drops) do
|
||||
for _, item in pairs(entity_drops) do
|
||||
add_drop(drops, item)
|
||||
end
|
||||
end
|
||||
|
@ -243,8 +243,8 @@ local function add_effects(pos, radius, drops)
|
|||
})
|
||||
end
|
||||
|
||||
function tnt.burn(pos)
|
||||
local name = minetest.get_node(pos).name
|
||||
function tnt.burn(pos, nodename)
|
||||
local name = nodename or minetest.get_node(pos).name
|
||||
local group = minetest.get_item_group(name, "tnt")
|
||||
if group > 0 then
|
||||
minetest.sound_play("tnt_ignite", {pos = pos})
|
||||
|
@ -327,25 +327,26 @@ local function tnt_explode(pos, radius, ignore_protection, ignore_on_blast)
|
|||
vm:update_map()
|
||||
vm:update_liquids()
|
||||
|
||||
-- call nodeupdate for everything within 1.5x blast radius
|
||||
-- call check_single_for_falling for everything within 1.5x blast radius
|
||||
for y = -radius * 1.5, radius * 1.5 do
|
||||
for z = -radius * 1.5, radius * 1.5 do
|
||||
for x = -radius * 1.5, radius * 1.5 do
|
||||
for y = -radius * 1.5, radius * 1.5 do
|
||||
local s = vector.add(pos, {x = x, y = y, z = z})
|
||||
local r = vector.distance(pos, s)
|
||||
local rad = {x = x, y = y, z = z}
|
||||
local s = vector.add(pos, rad)
|
||||
local r = vector.length(rad)
|
||||
if r / radius < 1.4 then
|
||||
nodeupdate(s)
|
||||
minetest.check_single_for_falling(s)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
for _, queued_data in ipairs(on_blast_queue) do
|
||||
for _, queued_data in pairs(on_blast_queue) do
|
||||
local dist = math.max(1, vector.distance(queued_data.pos, pos))
|
||||
local intensity = (radius * radius) / (dist * dist)
|
||||
local node_drops = queued_data.on_blast(queued_data.pos, intensity)
|
||||
if node_drops then
|
||||
for _, item in ipairs(node_drops) do
|
||||
for _, item in pairs(node_drops) do
|
||||
add_drop(drops, item)
|
||||
end
|
||||
end
|
||||
|
@ -398,18 +399,26 @@ minetest.register_node("tnt:gunpowder", {
|
|||
type = "fixed",
|
||||
fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
|
||||
},
|
||||
groups = {dig_immediate = 2, attached_node = 1, connect_to_raillike = minetest.raillike_group("gunpowder")},
|
||||
groups = {dig_immediate = 2, attached_node = 1, flammable = 5,
|
||||
connect_to_raillike = minetest.raillike_group("gunpowder")},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
|
||||
on_punch = function(pos, node, puncher)
|
||||
if puncher:get_wielded_item():get_name() == "default:torch" then
|
||||
if(minetest.check_player_privs(puncher:get_player_name(), {trusted_player=true})) then
|
||||
tnt.burn(pos)
|
||||
--tnt.burn(pos)
|
||||
minetest.set_node(pos, {name = "tnt:gunpowder_burning"})
|
||||
end
|
||||
end
|
||||
end,
|
||||
on_blast = function(pos, intensity)
|
||||
tnt.burn(pos)
|
||||
minetest.set_node(pos, {name = "tnt:gunpowder_burning"})
|
||||
end,
|
||||
on_burn = function(pos)
|
||||
minetest.set_node(pos, {name = "tnt:gunpowder_burning"})
|
||||
end,
|
||||
on_ignite = function(pos, igniter)
|
||||
minetest.set_node(pos, {name = "tnt:gunpowder_burning"})
|
||||
end,
|
||||
})
|
||||
|
||||
|
@ -508,7 +517,9 @@ minetest.register_craft({
|
|||
neighbors = {"fire:basic_flame", "default:lava_source", "default:lava_flowing"},
|
||||
interval = 4,
|
||||
chance = 1,
|
||||
action = tnt.burn,
|
||||
action = function(pos, node)
|
||||
tnt.burn(pos, node.name)
|
||||
end,
|
||||
})
|
||||
|
||||
function tnt.register_tnt(def)
|
||||
|
@ -526,32 +537,38 @@ function tnt.register_tnt(def)
|
|||
local tnt_burning = def.tiles.burning or def.name .. "_top_burning_animated.png"
|
||||
if not def.damage_radius then def.damage_radius = def.radius * 2 end
|
||||
|
||||
minetest.register_node(":" .. name, {
|
||||
description = def.description,
|
||||
tiles = {tnt_top, tnt_bottom, tnt_side},
|
||||
is_ground_content = false,
|
||||
groups = {dig_immediate = 2, mesecon = 2, tnt = 1},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
on_punch = function(pos, node, puncher)
|
||||
if puncher:get_wielded_item():get_name() == "default:torch" then
|
||||
if(minetest.check_player_privs(puncher:get_player_name(), {trusted_player=true})) then
|
||||
minetest.set_node(pos, {name = name .. "_burning"})
|
||||
end
|
||||
end
|
||||
end,
|
||||
on_blast = function(pos, intensity)
|
||||
minetest.after(0.1, function()
|
||||
tnt.boom(pos, def)
|
||||
end)
|
||||
end,
|
||||
--mesecons = {effector =
|
||||
-- {action_on =
|
||||
-- function(pos)
|
||||
-- tnt.boom(pos, def)
|
||||
-- end
|
||||
-- }
|
||||
--},
|
||||
})
|
||||
if enable_tnt then
|
||||
minetest.register_node(":" .. name, {
|
||||
description = def.description,
|
||||
tiles = {tnt_top, tnt_bottom, tnt_side},
|
||||
is_ground_content = false,
|
||||
groups = {dig_immediate = 2, mesecon = 2, tnt = 1, flammable = 5},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
on_punch = function(pos, node, puncher)
|
||||
if puncher:get_wielded_item():get_name() == "default:torch" then
|
||||
minetest.set_node(pos, {name = name .. "_burning"})
|
||||
end
|
||||
end,
|
||||
on_blast = function(pos, intensity)
|
||||
minetest.after(0.1, function()
|
||||
tnt.boom(pos, def)
|
||||
end)
|
||||
end,
|
||||
mesecons = {effector =
|
||||
{action_on =
|
||||
function(pos)
|
||||
tnt.boom(pos, def)
|
||||
end
|
||||
}
|
||||
},
|
||||
on_burn = function(pos)
|
||||
minetest.set_node(pos, {name = name .. "_burning"})
|
||||
end,
|
||||
on_ignite = function(pos, igniter)
|
||||
minetest.set_node(pos, {name = name .. "_burning"})
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
minetest.register_node(":" .. name .. "_burning", {
|
||||
tiles = {
|
||||
|
@ -578,7 +595,7 @@ function tnt.register_tnt(def)
|
|||
on_construct = function(pos)
|
||||
minetest.sound_play("tnt_ignite", {pos = pos})
|
||||
minetest.get_node_timer(pos):start(6)
|
||||
nodeupdate(pos)
|
||||
minetest.check_for_falling(pos)
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
|
65
mods/tnt/license.txt
Normal file
65
mods/tnt/license.txt
Normal file
|
@ -0,0 +1,65 @@
|
|||
License of source code
|
||||
----------------------
|
||||
|
||||
The MIT License (MIT)
|
||||
Copyright (C) 2014-2016 PilzAdam
|
||||
Copyright (C) 2014-2016 ShadowNinja
|
||||
Copyright (C) 2016 sofar (sofar@foo-projects.org)
|
||||
Copyright (C) 2014-2016 Various Minetest developers and contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
software and associated documentation files (the "Software"), to deal in the Software
|
||||
without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
publish, distribute, sublicense, and/or sell copies of the Software, and to permit
|
||||
persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or
|
||||
substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
|
||||
For more details:
|
||||
https://opensource.org/licenses/MIT
|
||||
|
||||
|
||||
Licenses of media (textures)
|
||||
----------------------------
|
||||
|
||||
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
|
||||
Copyright (C) 2014-2016 BlockMen
|
||||
Copyright (C) 2014-2016 ShadowNinja
|
||||
Copyright (C) 2015-2016 Wuzzy
|
||||
Copyright (C) 2016 sofar (sofar@foo-projects.org)
|
||||
|
||||
You are free to:
|
||||
Share — copy and redistribute the material in any medium or format.
|
||||
Adapt — remix, transform, and build upon the material for any purpose, even commercially.
|
||||
The licensor cannot revoke these freedoms as long as you follow the license terms.
|
||||
|
||||
Under the following terms:
|
||||
|
||||
Attribution — You must give appropriate credit, provide a link to the license, and
|
||||
indicate if changes were made. You may do so in any reasonable manner, but not in any way
|
||||
that suggests the licensor endorses you or your use.
|
||||
|
||||
ShareAlike — If you remix, transform, or build upon the material, you must distribute
|
||||
your contributions under the same license as the original.
|
||||
|
||||
No additional restrictions — You may not apply legal terms or technological measures that
|
||||
legally restrict others from doing anything the license permits.
|
||||
|
||||
Notices:
|
||||
|
||||
You do not have to comply with the license for elements of the material in the public
|
||||
domain or where your use is permitted by an applicable exception or limitation.
|
||||
No warranties are given. The license may not give you all of the permissions necessary
|
||||
for your intended use. For example, other rights such as publicity, privacy, or moral
|
||||
rights may limit how you use the material.
|
||||
|
||||
For more details:
|
||||
http://creativecommons.org/licenses/by-sa/3.0/
|
Loading…
Add table
Add a link
Reference in a new issue