add settings
parent
6507344a84
commit
55594ff036
55
tools.lua
55
tools.lua
|
@ -1,4 +1,26 @@
|
||||||
--
|
-- Make settingtype for whether to use an explosion for the engraved sword shard hitting a node
|
||||||
|
setting = nil
|
||||||
|
local use_engraved_sword_shard_explosion = 1
|
||||||
|
setting = tonumber(minetest.settings:get("use_engraved_sword_shard_explosion"))
|
||||||
|
if setting then
|
||||||
|
use_engraved_sword_shard_explosion = setting
|
||||||
|
end
|
||||||
|
-- Make a setting for how big the explosion should be in nodes
|
||||||
|
setting = nil
|
||||||
|
local shard_node_explosion_size = 1
|
||||||
|
setting = tonumber(minetest.settings:get("shard_node_explosion_size"))
|
||||||
|
if setting then
|
||||||
|
shard_node_explosion_size = setting
|
||||||
|
end
|
||||||
|
-- Make a setting for the damage radius
|
||||||
|
setting = nil
|
||||||
|
local shard_node_damage_radius = 4
|
||||||
|
setting = tonumber(minetest.settings:get("shard_node_damage_radius"))
|
||||||
|
if setting then
|
||||||
|
shard_node_damage_radius = setting
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
-- Tools
|
-- Tools
|
||||||
--
|
--
|
||||||
|
|
||||||
|
@ -123,20 +145,23 @@ minetest.register_entity("obsidianmese:sword_bullet", {
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
obsidianmese.sync_fired_table(self._owner)
|
obsidianmese.sync_fired_table(self._owner)
|
||||||
|
|
||||||
-- dont damage anything if area protected or next to water
|
if use_engraved_sword_shard_explosion == 1 then
|
||||||
if minetest.find_node_near(pos, 1, {"group:water"})
|
-- dont damage anything if area protected or next to water
|
||||||
or minetest.is_protected(pos, "") then
|
if minetest.find_node_near(pos, 1, {"group:water"})
|
||||||
return
|
or minetest.is_protected(pos, "") then
|
||||||
end
|
return
|
||||||
-- this is where the shot shard can explode when it hets a node. It was commented out,
|
end
|
||||||
-- I uncommented it, but changed the explosion radius to 1, and the damage to 4. That should make it non-griefy.
|
-- this is where the shot shard can explode when it hets a node. It was commented out,
|
||||||
tnt.boom(pos, {
|
-- I uncommented it, but changed the explosion radius to 1, and the damage to 4. That should make it non-griefy.
|
||||||
radius = 1,
|
tnt.boom(pos, {
|
||||||
damage_radius = 4,
|
radius = shard_node_explosion_size,
|
||||||
ignore_protection = false,
|
damage_radius = shard_node_damage_radius,
|
||||||
ignore_on_blast = false,
|
ignore_protection = false,
|
||||||
disable_drops = false
|
ignore_on_blast = false,
|
||||||
})
|
disable_drops = false
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue