diff options
| -rw-r--r-- | technic/README.md | 11 | ||||
| -rw-r--r-- | technic/depends.txt | 1 | ||||
| -rw-r--r-- | technic/machines/HV/nuclear_reactor.lua | 148 | ||||
| -rw-r--r-- | technic/textures/technic_bucket_corium.png | bin | 0 -> 256 bytes | |||
| -rw-r--r-- | technic/textures/technic_chernobylite_block.png | bin | 0 -> 666 bytes | |||
| -rw-r--r-- | technic/textures/technic_corium_flowing_animated.png | bin | 0 -> 3278 bytes | |||
| -rw-r--r-- | technic/textures/technic_corium_source_animated.png | bin | 0 -> 2954 bytes | 
7 files changed, 136 insertions, 24 deletions
| diff --git a/technic/README.md b/technic/README.md index 3e6d36c..c2da4ff 100644 --- a/technic/README.md +++ b/technic/README.md @@ -10,6 +10,15 @@ Technic chests code is licensed under the GNU LGPLv2+.  Texture licenses: +BlockMen modified by Zefram (CC BY-SA 3.0): +  * technic_chernobylite_block.png +  * technic_corium_flowing_animated.png +  * technic_corium_source_animated.png + +celeron55 and Perttu Ahola modified by Zefram (CC BY-SA 3.0): +  * technic_bucket_corium.png +  RealBadAngel: (WTFPL) -  * Everything. +  * Everything else. +CC BY-SA 3.0: <http://creativecommons.org/licenses/by-sa/3.0/> diff --git a/technic/depends.txt b/technic/depends.txt index 521391b..eec4a14 100644 --- a/technic/depends.txt +++ b/technic/depends.txt @@ -1,5 +1,6 @@  default  pipeworks +bucket?  mesecons_mvps?  intllib?  unified_inventory? diff --git a/technic/machines/HV/nuclear_reactor.lua b/technic/machines/HV/nuclear_reactor.lua index 337bccf..80cf24d 100644 --- a/technic/machines/HV/nuclear_reactor.lua +++ b/technic/machines/HV/nuclear_reactor.lua @@ -123,27 +123,7 @@ end  local explode_reactor = function(pos)  	print("A reactor exploded at "..minetest.pos_to_string(pos)) -	for x = -1, 1 do -	for y = -1, 1 do -	for z = -1, 1 do -		local erase_pos = { x = pos.x + x, y = pos.y + y, z = pos.z + z } -		local node = minetest.get_node(erase_pos) -		if node.name == "default:water_source" or node.name == "default:water_flowing" then -			minetest.set_node(erase_pos, {name = "air"}) -		end -	end -	end -	end -	minetest.set_node(pos, {name = "default:lava_source"}) -end - -local function damage_nearby_players(pos) -	local objs = minetest.get_objects_inside_radius(pos, 4) -	for _, o in pairs(objs) do -		if o:is_player() then -			o:set_hp(math.max(o:get_hp() - 2, 0)) -		end -	end +	minetest.set_node(pos, {name="technic:corium_source"})  end  local run = function(pos, node) @@ -182,7 +162,6 @@ local run = function(pos, node)  		meta:set_string("infotext", S("%s Idle"):format(machine_name))  		technic.swap_node(pos, "technic:hv_nuclear_reactor_core")  	elseif burn_time > 0 then -		damage_nearby_players(pos)  		if not check_reactor_structure(pos) then  			explode_reactor(pos)  		end @@ -232,7 +211,7 @@ minetest.register_node("technic:hv_nuclear_reactor_core_active", {  	tiles = {"technic_hv_nuclear_reactor_core.png", "technic_hv_nuclear_reactor_core.png",  	         "technic_hv_nuclear_reactor_core.png", "technic_hv_nuclear_reactor_core.png",  		 "technic_hv_nuclear_reactor_core.png", "technic_hv_nuclear_reactor_core.png"}, -	groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1, not_in_creative_inventory=1}, +	groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1, radioactive=2, not_in_creative_inventory=1},  	legacy_facedir_simple = true,  	sounds = default.node_sound_wood_defaults(),  	drop="technic:hv_nuclear_reactor_core", @@ -276,3 +255,126 @@ minetest.register_node("technic:hv_nuclear_reactor_core_active", {  technic.register_machine("HV", "technic:hv_nuclear_reactor_core",        technic.producer)  technic.register_machine("HV", "technic:hv_nuclear_reactor_core_active", technic.producer) +-- radioactive materials that can result from destroying a reactor + +minetest.register_abm({ +	nodenames = {"group:radioactive"}, +	interval = 1, +	chance = 1, +	action = function (pos, node) +		for r = 1, minetest.registered_nodes[node.name].groups.radioactive do +			for _, o in ipairs(minetest.get_objects_inside_radius(pos, r*2)) do +				if o:is_player() then +					o:set_hp(math.max(o:get_hp() - 1, 0)) +				end +			end +		end +	end, +}) + +for _, state in ipairs({ "flowing", "source" }) do +	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"] = {{ +			name = "technic_corium_"..state.."_animated.png", +			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 4 or 3), +		walkable = false, +		pointable = false, +		diggable = false, +		buildable_to = true, +		drop = "", +		drowning = 1, +		liquidtype = state, +		liquid_alternative_flowing = "technic:corium_flowing", +		liquid_alternative_source = "technic:corium_source", +		liquid_viscosity = LAVA_VISC, +		liquid_renewable = false, +		damage_per_second = 6, +		post_effect_color = { a=192, r=80, g=160, b=80 }, +		groups = { +			liquid = 2, +			hot = 3, +			igniter = 1, +			radioactive = (state == "source" and 3 or 2), +			not_in_creative_inventory = (state == "flowing" and 1 or nil), +		}, +	}) +end + +if bucket and bucket.register_liquid then +	bucket.register_liquid( +		"technic:corium_source", +		"technic:corium_flowing", +		"technic:bucket_corium", +		"technic_bucket_corium.png", +		"Corium Bucket" +	) +end + +minetest.register_node("technic:chernobylite_block", { +        description = S("Chernobylite Block"), +	tiles = { "technic_chernobylite_block.png" }, +	is_ground_content = true, +	groups = { cracky=1, radioactive=1, level=2 }, +	sounds = default.node_sound_stone_defaults(), +	light_source = 2, + +}) + +minetest.register_abm({ +	nodenames = {"group:water"}, +	neighbors = {"technic:corium_source"}, +	interval = 1, +	chance = 1, +	action = function (pos, node) +		minetest.remove_node(pos) +	end, +}) + +minetest.register_abm({ +	nodenames = {"technic:corium_flowing"}, +	neighbors = {"group:water"}, +	interval = 1, +	chance = 1, +	action = function (pos, node) +		minetest.set_node(pos, {name="technic:chernobylite_block"}) +	end, +}) + +minetest.register_abm({ +	nodenames = {"technic:corium_flowing"}, +	interval = 5, +	chance = 10, +	action = function (pos, node) +		minetest.set_node(pos, {name="technic:chernobylite_block"}) +	end, +}) + +minetest.register_abm({ +	nodenames = { "technic:corium_source", "technic:corium_flowing" }, +	interval = 4, +	chance = 4, +	action = function (pos, node) +		for _, offset in ipairs({ +			vector.new(1,0,0), +			vector.new(-1,0,0), +			vector.new(0,0,1), +			vector.new(0,0,-1), +			vector.new(0,-1,0), +		}) do +			if math.random(8) == 1 then +				minetest.dig_node(vector.add(pos, offset)) +			end +		end +	end, +}) diff --git a/technic/textures/technic_bucket_corium.png b/technic/textures/technic_bucket_corium.pngBinary files differ new file mode 100644 index 0000000..82da7ca --- /dev/null +++ b/technic/textures/technic_bucket_corium.png diff --git a/technic/textures/technic_chernobylite_block.png b/technic/textures/technic_chernobylite_block.pngBinary files differ new file mode 100644 index 0000000..a837c66 --- /dev/null +++ b/technic/textures/technic_chernobylite_block.png diff --git a/technic/textures/technic_corium_flowing_animated.png b/technic/textures/technic_corium_flowing_animated.pngBinary files differ new file mode 100644 index 0000000..1d29f16 --- /dev/null +++ b/technic/textures/technic_corium_flowing_animated.png diff --git a/technic/textures/technic_corium_source_animated.png b/technic/textures/technic_corium_source_animated.pngBinary files differ new file mode 100644 index 0000000..6c3ee56 --- /dev/null +++ b/technic/textures/technic_corium_source_animated.png | 
