From 366fc3bc6503a03100ddb50d473385e0cb7376fa Mon Sep 17 00:00:00 2001 From: Zefram Date: Wed, 23 Jul 2014 20:04:18 +0100 Subject: [PATCH] Better reactor meltdown Reactor `explosion' now replaces the reactor core with a corium source node. Corium is a new liquid, which flows a bit like lava, but has the additional feature of destroying nodes to which it is adjacent. It also randomly turns into a solid form, chernobylite, which makes an attractive building block. It thus gradually melts its way through the reactor shielding layers; a meltdown gets worse over time if not cleaned up promptly. The mechanism for an active reactor core to damage nearby players is generalised into a "radioactive" node group. Corium and chernobylite are radioactive, to varying degrees. Players receive a varying amount of damage from a radioactive node, depending on proximity. Staying outside a reactor cube is sufficient to be safe from the active core, but not sufficient to be safe from a melted core. --- technic/README.md | 11 +- technic/depends.txt | 1 + technic/machines/HV/nuclear_reactor.lua | 148 +++++++++++++++--- technic/textures/technic_bucket_corium.png | Bin 0 -> 256 bytes .../textures/technic_chernobylite_block.png | Bin 0 -> 666 bytes .../technic_corium_flowing_animated.png | Bin 0 -> 3278 bytes .../technic_corium_source_animated.png | Bin 0 -> 2954 bytes 7 files changed, 136 insertions(+), 24 deletions(-) create mode 100644 technic/textures/technic_bucket_corium.png create mode 100644 technic/textures/technic_chernobylite_block.png create mode 100644 technic/textures/technic_corium_flowing_animated.png create mode 100644 technic/textures/technic_corium_source_animated.png 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: 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.png new file mode 100644 index 0000000000000000000000000000000000000000..82da7ca56b31211cbf3ee6502ef96c408decb4c6 GIT binary patch literal 256 zcmV+b0ssDqP)*(8UnH2#*?XVuTQ%0hXz9dIUnR&SMy&jVE#d`RQAIM2Ta7*d0000K5@iET7)E&o`+6JAD6YjH^Gs6cg zAd@u_tBkpo@$BC^KE=3t zR7<5u*Vp+?sPjCa1S6tS{rOEBgvC|8Q?*1qW`4#X0MJ5VK!%{;K8t(rHcdG0xbDbS zEgZJ2B~AyjTzMWd0C3o-rkT-^Q^0=JSCaiZ!syyew9MQqoFMfKCmiQ-&@(-eLAURPI9QqDj2WlmP00kV}-RIrqs(Oh2e|Xa|SWW@{6#xJL07*qoM6N<$f+BH7 AasU7T literal 0 HcmV?d00001 diff --git a/technic/textures/technic_corium_flowing_animated.png b/technic/textures/technic_corium_flowing_animated.png new file mode 100644 index 0000000000000000000000000000000000000000..1d29f166bbb3311d4c2a9686aa45912ff6e79564 GIT binary patch literal 3278 zcmV;<3^DVGP)=PdC;(D_^q9TK-yvXpx5165~TT)E}S}V#gHG2^RZ>WnZ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IB6sOdN zZzug*AWYZSMT4YGP|Tr|M;A~4LDT10BdHJQSy6mrGqWQMUu5?mQPt_J6S=j*dt`e` z;=(8JJPI|WHF_lXRGRntv|T}pHjxbBRoKcpFrsp*@VRCr0a~G?LnYABv4_p2|YM$ItXr?oO)Nl!}8`A@hAky(EKr%PT`|ok+EK+w9 zvtbNlGyT_)S4`T`1v`DzLO0PWNGKZ6>b7GgnEnM?++wu7m>yyCeQXLaV{HolSC-=9=I^6$WT7GYgjcz8EvCiZ4GU}$Y)zw{5 ze61z7m_lbYOoL4c%@9?7mMbzGeH}_LPcB9E-DHHrVVfQ^M>86C;=BoKo>;(MBH7`j z)WGOZVHCz-hU_@T`qX$K|N1b688jZGV;4)m;K~P_v+3<3374LSMTkNM3LM|h!4!on z5JyrVVX^r;Xm0Ya5rLpU_Q9sB0HweL7ue8)#vijB|R@Q27d1zQUC|P`Lw@ zJ5ad;l?_xj(Enuvl{-**1C=*WxdWB2aOEppxdW9uP`LyB|L;Km1=U;zr3=4d?*IS* M07*qoM6N<$f+vy@9smFU literal 0 HcmV?d00001 diff --git a/technic/textures/technic_corium_source_animated.png b/technic/textures/technic_corium_source_animated.png new file mode 100644 index 0000000000000000000000000000000000000000..6c3ee56012c003a6409e1713ff6cbb8cd35b5eae GIT binary patch literal 2954 zcmV;53w88~P)@(tSVTpJ9fqA@8;04w+volOoOAmZI{ppM^E&V632gS|MxQPF zM0??9x4!A-R&z_n?N9c%_Y4Mo{^xFTG;#?sW#Y>lO-n~z;qzMt?QOTC#f*}=jGlE} zM?3dY!)bbbZj!Rt6UT&q=Pq_iLKuMOkhRhEBI&z4^ZP3INqKwU6tNcib6(SOtz{-k3)9ok>e zR-rr`Tc)k8f@YDAFCwet>>R-FFWYeam2!zhkLxW;z+V5EAWzkp6
    rNM3EOTPVlt$d;_zPLK-XjyVHEV}g| zHH>B+5oz(K%S}s_oe7`WnzwGF?F&th>oZQS9XPq`(0LDMe6Lfa?ZoeLo0hHj=L4=SW+srOEIW{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