From e90b28895cc28daf1a2e4fb772bd191400cf9e62 Mon Sep 17 00:00:00 2001
From: fgrosswig <falk@grosswig.de>
Date: Mon, 06 Jan 2020 21:50:15 +0100
Subject: [PATCH] battery_box.lua: Make "srcstack" local (#525)

---
 technic/radiation.lua |   44 ++++++++++++++++++++++++++++++++++++--------
 1 files changed, 36 insertions(+), 8 deletions(-)

diff --git a/technic/radiation.lua b/technic/radiation.lua
index 79dfcb4..e4ed5c5 100644
--- a/technic/radiation.lua
+++ b/technic/radiation.lua
@@ -54,6 +54,7 @@
 	["default:lava_source"] = 17,
 	["default:mese"] = 21,
 	["default:mossycobble"] = 15,
+	["default:tinblock"] = 37,
 	["pbj_pup:pbj_pup"] = 10000,
 	["pbj_pup:pbj_pup_candies"] = 10000,
 	["gloopblocks:rainbow_block_diagonal"] = 5000,
@@ -76,6 +77,7 @@
 	["default:stone_with_gold"] = 34,
 	["default:stone_with_iron"] = 20,
 	["default:stone_with_mese"] = 17,
+	["default:stone_with_tin"] = 19,
 	["default:stonebrick"] = 17,
 	["default:water_flowing"] = 2.8,
 	["default:water_source"] = 5.6,
@@ -141,12 +143,10 @@
 	["moreblocks:wood_tile_up"] = 1.7,
 	["moreores:mineral_mithril"] = 18,
 	["moreores:mineral_silver"] = 21,
-	["moreores:mineral_tin"] = 19,
 	["moreores:mithril_block"] = 26,
 	["moreores:silver_block"] = 53,
-	["moreores:tin_block"] = 37,
 	["snow:snow_brick"] = 2.8,
-	["technic:brass_block"] = 43,
+	["basic_materials:brass_block"] = 43,
 	["technic:carbon_steel_block"] = 40,
 	["technic:cast_iron_block"] = 40,
 	["technic:chernobylite_block"] = 40,
@@ -294,6 +294,8 @@
 	end
 	if ag.radiation then
 		return 0.01 * ag.radiation
+	elseif armor_enabled then
+		return 0
 	end
 	if ag.fleshy then
 		return math.sqrt(0.01 * ag.fleshy)
@@ -309,7 +311,7 @@
 end
 
 local function dmg_object(pos, object, strength)
-	local obj_pos = vector.add(object:getpos(), calculate_object_center(object))
+	local obj_pos = vector.add(object:get_pos(), calculate_object_center(object))
 	local mul
 	if armor_enabled or entity_damage then
 		-- we need to check may the object be damaged even if armor is disabled
@@ -338,14 +340,15 @@
 	local max_dist = strength * rad_dmg_mult_sqrt
 	for _, o in pairs(minetest.get_objects_inside_radius(pos,
 			max_dist + abdomen_offset)) do
-		if entity_damage or o:is_player() then
+		if (entity_damage or o:is_player()) and o:get_hp() > 0 then
 			dmg_object(pos, o, strength)
 		end
 	end
 end
 
-if minetest.setting_getbool("enable_damage") then
+if minetest.settings:get_bool("enable_damage") then
 	minetest.register_abm({
+		label = "Radiation damage",
 		nodenames = {"group:radioactive"},
 		interval = 1,
 		chance = 1,
@@ -383,7 +386,7 @@
 	minetest.register_node("technic:corium_"..state, {
 		description = S(state == "source" and "Corium Source" or "Flowing Corium"),
 		drawtype = (state == "source" and "liquid" or "flowingliquid"),
-		[state == "source" and "tiles" or "special_tiles"] = {{
+		tiles = {{
 			name = "technic_corium_"..state.."_animated.png",
 			animation = {
 				type = "vertical_frames",
@@ -392,6 +395,28 @@
 				length = 3.0,
 			},
 		}},
+		special_tiles = {
+			{
+				name = "technic_corium_"..state.."_animated.png",
+				backface_culling = false,
+				animation = {
+					type = "vertical_frames",
+					aspect_w = 16,
+					aspect_h = 16,
+					length = 3.0,
+				},
+			},
+			{
+				name = "technic_corium_"..state.."_animated.png",
+				backface_culling = true,
+				animation = {
+					type = "vertical_frames",
+					aspect_w = 16,
+					aspect_h = 16,
+					length = 3.0,
+				},
+			},
+		},
 		paramtype = "light",
 		paramtype2 = (state == "flowing" and "flowingliquid" or nil),
 		light_source = (state == "source" and 8 or 5),
@@ -438,6 +463,7 @@
 })
 
 minetest.register_abm({
+	label = "Corium: boil-off water (sources)",
 	nodenames = {"group:water"},
 	neighbors = {"technic:corium_source"},
 	interval = 1,
@@ -448,6 +474,7 @@
 })
 
 minetest.register_abm({
+	label = "Corium: boil-off water (flowing)",
 	nodenames = {"technic:corium_flowing"},
 	neighbors = {"group:water"},
 	interval = 1,
@@ -458,6 +485,7 @@
 })
 
 minetest.register_abm({
+	label = "Corium: become chernobylite",
 	nodenames = {"technic:corium_flowing"},
 	interval = 5,
 	chance = (griefing and 10 or 1),
@@ -468,6 +496,7 @@
 
 if griefing then
 	minetest.register_abm({
+		label = "Corium: griefing",
 		nodenames = {"technic:corium_source", "technic:corium_flowing"},
 		interval = 4,
 		chance = 4,
@@ -486,4 +515,3 @@
 		end,
 	})
 end
-

--
Gitblit v1.8.0