Christopher Head
2019-01-26 4f78a69ffc714886c9d6e812f78d543bb33fe674
commit | author | age
be2f30 1
S 2 local S = technic.getter
3
4 minetest.register_craftitem("technic:silicon_wafer", {
5     description = S("Silicon Wafer"),
82cba9 6     inventory_image = "technic_silicon_wafer.png",
R 7 })
8
9 minetest.register_craftitem( "technic:doped_silicon_wafer", {
be2f30 10     description = S("Doped Silicon Wafer"),
82cba9 11     inventory_image = "technic_doped_silicon_wafer.png",
R 12 })
13
ee0765 14 minetest.register_craftitem("technic:uranium_fuel", {
be2f30 15     description = S("Uranium Fuel"),
ee0765 16     inventory_image = "technic_uranium_fuel.png",
4411ba 17 })
R 18
82cba9 19 minetest.register_craftitem( "technic:diamond_drill_head", {
be2f30 20     description = S("Diamond Drill Head"),
82cba9 21     inventory_image = "technic_diamond_drill_head.png",
R 22 })
23
ee0765 24 minetest.register_tool("technic:blue_energy_crystal", {
be2f30 25     description = S("Blue Energy Crystal"),
ee0765 26     inventory_image = minetest.inventorycube(
S 27         "technic_diamond_block_blue.png",
28         "technic_diamond_block_blue.png",
29         "technic_diamond_block_blue.png"),
99fd5d 30     wear_represents = "technic_RE_charge",
00d7c9 31     on_refill = technic.refill_RE_charge,
ee0765 32     tool_capabilities = {
S 33         max_drop_level = 0,
34         groupcaps = {
35             fleshy = {times={}, uses=10000, maxlevel=0}
36         }
82cba9 37     }
4f78a6 38 })
82cba9 39
ee0765 40 minetest.register_tool("technic:green_energy_crystal", {
be2f30 41     description = S("Green Energy Crystal"),
ee0765 42     inventory_image = minetest.inventorycube(
S 43         "technic_diamond_block_green.png",
44         "technic_diamond_block_green.png",
45         "technic_diamond_block_green.png"),
99fd5d 46     wear_represents = "technic_RE_charge",
00d7c9 47     on_refill = technic.refill_RE_charge,
ee0765 48     tool_capabilities = {
S 49         max_drop_level = 0,
50         groupcaps = {
51             fleshy = {times={}, uses=10000, maxlevel=0}
52         }
82cba9 53     }
4f78a6 54 })
82cba9 55
ee0765 56 minetest.register_tool("technic:red_energy_crystal", {
be2f30 57     description = S("Red Energy Crystal"),
ee0765 58     inventory_image = minetest.inventorycube(
S 59         "technic_diamond_block_red.png",
60         "technic_diamond_block_red.png",
61         "technic_diamond_block_red.png"),
99fd5d 62     wear_represents = "technic_RE_charge",
00d7c9 63     on_refill = technic.refill_RE_charge,
ee0765 64     tool_capabilities = {
S 65         max_drop_level = 0,
66         groupcaps = {
67             fleshy = {times={}, uses=10000, maxlevel=0}
68         }
82cba9 69     }
4f78a6 70 })
82cba9 71
be2f30 72 minetest.register_craftitem("technic:copper_coil", {
S 73     description = S("Copper Coil"),
82cba9 74     inventory_image = "technic_copper_coil.png",
R 75 })
76
be2f30 77 minetest.register_craftitem("technic:lv_transformer", {
S 78     description = S("Low Voltage Transformer"),
ee0765 79     inventory_image = "technic_lv_transformer.png",
82cba9 80 })
R 81
be2f30 82 minetest.register_craftitem("technic:mv_transformer", {
S 83     description = S("Medium Voltage Transformer"),
82cba9 84     inventory_image = "technic_mv_transformer.png",
R 85 })
86
8e03d7 87 minetest.register_craftitem( "technic:hv_transformer", {
be2f30 88     description = S("High Voltage Transformer"),
8e03d7 89     inventory_image = "technic_hv_transformer.png",
R 90 })
91
3b5e6c 92 minetest.register_craftitem( "technic:control_logic_unit", {
be2f30 93     description = S("Control Logic Unit"),
3b5e6c 94     inventory_image = "technic_control_logic_unit.png",
R 95 })
96
58ae29 97 minetest.register_craftitem("technic:mixed_metal_ingot", {
be2f30 98     description = S("Mixed Metal Ingot"),
58ae29 99     inventory_image = "technic_mixed_metal_ingot.png",
R 100 })
101
102 minetest.register_craftitem("technic:composite_plate", {
be2f30 103     description = S("Composite Plate"),
58ae29 104     inventory_image = "technic_composite_plate.png",
R 105 })
106
107 minetest.register_craftitem("technic:copper_plate", {
be2f30 108     description = S("Copper Plate"),
58ae29 109     inventory_image = "technic_copper_plate.png",
R 110 })
111
112 minetest.register_craftitem("technic:carbon_plate", {
be2f30 113     description = S("Carbon Plate"),
58ae29 114     inventory_image = "technic_carbon_plate.png",
R 115 })
116
117 minetest.register_craftitem("technic:graphite", {
be2f30 118     description = S("Graphite"),
58ae29 119     inventory_image = "technic_graphite.png",
R 120 })
121
122 minetest.register_craftitem("technic:carbon_cloth", {
be2f30 123     description = S("Carbon Cloth"),
58ae29 124     inventory_image = "technic_carbon_cloth.png",
R 125 })
126
430b31 127 minetest.register_node("technic:machine_casing", {
Z 128     description = S("Machine Casing"),
129     groups = {cracky=2},
130     sunlight_propagates = true,
131     paramtype = "light",
132     drawtype = "allfaces",
133     tiles = {"technic_machine_casing.png"},
134     sounds = default.node_sound_stone_defaults(),
135 })
b0faa7 136
Z 137 for p = 0, 35 do
138     local nici = (p ~= 0 and p ~= 7 and p ~= 35) and 1 or nil
139     local psuffix = p == 7 and "" or p
140     local ingot = "technic:uranium"..psuffix.."_ingot"
141     local block = "technic:uranium"..psuffix.."_block"
142     local ov = p == 7 and minetest.override_item or nil;
143     (ov or minetest.register_craftitem)(ingot, {
144         description = string.format(S("%.1f%%-Fissile Uranium Ingot"), p/10),
145         inventory_image = "technic_uranium_ingot.png",
146         groups = {uranium_ingot=1, not_in_creative_inventory=nici},
147     });
a2d1fe 148     -- Note on radioactivity of blocks:
Z 149     -- Source: <http://www.wise-uranium.org/rup.html>
150     -- The baseline radioactivity of an isotope is not especially
151     -- correlated with whether it's fissile (i.e., suitable as
152     -- reactor fuel).  Natural uranium consists mainly of fissile
153     -- U-235 and non-fissile U-238, and both U-235 and U-238 are
154     -- significantly radioactive.  U-235's massic activity is
155     -- about 80.0 MBq/kg, and U-238's is about 12.4 MBq/kg, which
156     -- superficially suggests that 3.5%-fissile uranium should have
157     -- only 1.19 times the activity of fully-depleted uranium.
158     -- But a third isotope affects the result hugely: U-234 has
159     -- massic activity of 231 GBq/kg.  Natural uranium has massic
160     -- composition of 99.2837% U-238, 0.711% U-235, and 0.0053% U-234,
161     -- so its activity comes roughly 49% each from U-234 and U-238
162     -- and only 2% from U-235.  During enrichment via centrifuge,
163     -- the U-234 fraction is concentrated along with the U-235, with
164     -- the U-234:U-235 ratio remaining close to its original value.
165     -- (Actually the U-234 gets separated from U-238 slightly more
166     -- than the U-235 is, so the U-234:U-235 ratio is slightly
167     -- higher in enriched uranium.)  A typical massic composition
168     -- for 3.5%-fissile uranium is 96.47116% U-238, 3.5% U-235, and
169     -- 0.02884% U-234.  This gives 3.5%-fissile uranium about 6.55
170     -- times the activity of fully-depleted uranium.  The values we
171     -- compute here for the "radioactive" group value are based on
172     -- linear interpolation of activity along that scale, rooted at
173     -- a natural (0.7%-fissile) uranium block having the activity of
174     -- 9 uranium ore blocks (due to 9 ingots per block).  The group
7a9d2f 175     -- value is proportional to the square root of the activity, and
26de2f 176     -- uranium ore has radioactive=1.  This yields radioactive=1.0
S 177     -- for a fully-depleted uranium block and radioactive=2.6 for
7a9d2f 178     -- a 3.5%-fissile uranium block.
26de2f 179     local radioactivity = math.floor(math.sqrt((1+5.55*p/35) * 18 / (1+5.55*7/35)) + 0.5);
b0faa7 180     (ov or minetest.register_node)(block, {
Z 181         description = string.format(S("%.1f%%-Fissile Uranium Block"), p/10),
182         tiles = {"technic_uranium_block.png"},
183         is_ground_content = true,
26de2f 184         groups = {uranium_block=1, not_in_creative_inventory=nici,
S 185             cracky=1, level=2, radioactive=radioactivity},
b0faa7 186         sounds = default.node_sound_stone_defaults(),
Z 187     });
188     if not ov then
189         minetest.register_craft({
190             output = block,
191             recipe = {
192                 {ingot, ingot, ingot},
193                 {ingot, ingot, ingot},
194                 {ingot, ingot, ingot},
195             },
196         })
197         minetest.register_craft({
198             output = ingot.." 9",
199             recipe = {{block}},
200         })
201     end
202 end
26de2f 203