Zefram
2014-08-13 38e85e9775b132b0ce504d8d795632668eb47852
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     }
ee0765 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     }
ee0765 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     }
ee0765 70 }) 
82cba9 71
R 72
be2f30 73 minetest.register_craftitem("technic:fine_copper_wire", {
S 74     description = S("Fine Copper Wire"),
82cba9 75     inventory_image = "technic_fine_copper_wire.png",
R 76 })
77
3f717c 78 minetest.register_craftitem("technic:fine_gold_wire", {
Z 79     description = S("Fine Gold Wire"),
80     inventory_image = "technic_fine_gold_wire.png",
81 })
82
83 minetest.register_craftitem("technic:fine_silver_wire", {
84     description = S("Fine Silver Wire"),
85     inventory_image = "technic_fine_silver_wire.png",
86 })
87
be2f30 88 minetest.register_craftitem("technic:copper_coil", {
S 89     description = S("Copper Coil"),
82cba9 90     inventory_image = "technic_copper_coil.png",
R 91 })
92
be2f30 93 minetest.register_craftitem("technic:motor", {
S 94     description = S("Electric Motor"),
82cba9 95     inventory_image = "technic_motor.png",
R 96 })
97
be2f30 98 minetest.register_craftitem("technic:lv_transformer", {
S 99     description = S("Low Voltage Transformer"),
ee0765 100     inventory_image = "technic_lv_transformer.png",
82cba9 101 })
R 102
be2f30 103 minetest.register_craftitem("technic:lv_transformer", {
S 104     description = S("Low Voltage Transformer"),
8e03d7 105     inventory_image = "technic_lv_transformer.png",
R 106 })
be2f30 107 minetest.register_craftitem("technic:mv_transformer", {
S 108     description = S("Medium Voltage Transformer"),
82cba9 109     inventory_image = "technic_mv_transformer.png",
R 110 })
111
8e03d7 112 minetest.register_craftitem( "technic:hv_transformer", {
be2f30 113     description = S("High Voltage Transformer"),
8e03d7 114     inventory_image = "technic_hv_transformer.png",
R 115 })
116
3b5e6c 117 minetest.register_craftitem( "technic:control_logic_unit", {
be2f30 118     description = S("Control Logic Unit"),
3b5e6c 119     inventory_image = "technic_control_logic_unit.png",
R 120 })
121
58ae29 122 minetest.register_craftitem("technic:mixed_metal_ingot", {
be2f30 123     description = S("Mixed Metal Ingot"),
58ae29 124     inventory_image = "technic_mixed_metal_ingot.png",
R 125 })
126
127 minetest.register_craftitem("technic:composite_plate", {
be2f30 128     description = S("Composite Plate"),
58ae29 129     inventory_image = "technic_composite_plate.png",
R 130 })
131
132 minetest.register_craftitem("technic:copper_plate", {
be2f30 133     description = S("Copper Plate"),
58ae29 134     inventory_image = "technic_copper_plate.png",
R 135 })
136
137 minetest.register_craftitem("technic:carbon_plate", {
be2f30 138     description = S("Carbon Plate"),
58ae29 139     inventory_image = "technic_carbon_plate.png",
R 140 })
141
142 minetest.register_craftitem("technic:graphite", {
be2f30 143     description = S("Graphite"),
58ae29 144     inventory_image = "technic_graphite.png",
R 145 })
146
147 minetest.register_craftitem("technic:carbon_cloth", {
be2f30 148     description = S("Carbon Cloth"),
58ae29 149     inventory_image = "technic_carbon_cloth.png",
R 150 })
151
430b31 152 minetest.register_node("technic:machine_casing", {
Z 153     description = S("Machine Casing"),
154     groups = {cracky=2},
155     sunlight_propagates = true,
156     paramtype = "light",
157     drawtype = "allfaces",
158     tiles = {"technic_machine_casing.png"},
159     sounds = default.node_sound_stone_defaults(),
160 })
b0faa7 161
Z 162 for p = 0, 35 do
163     local nici = (p ~= 0 and p ~= 7 and p ~= 35) and 1 or nil
164     local psuffix = p == 7 and "" or p
165     local ingot = "technic:uranium"..psuffix.."_ingot"
166     local block = "technic:uranium"..psuffix.."_block"
167     local ov = p == 7 and minetest.override_item or nil;
168     (ov or minetest.register_craftitem)(ingot, {
169         description = string.format(S("%.1f%%-Fissile Uranium Ingot"), p/10),
170         inventory_image = "technic_uranium_ingot.png",
171         groups = {uranium_ingot=1, not_in_creative_inventory=nici},
172     });
a2d1fe 173     -- Note on radioactivity of blocks:
Z 174     -- Source: <http://www.wise-uranium.org/rup.html>
175     -- The baseline radioactivity of an isotope is not especially
176     -- correlated with whether it's fissile (i.e., suitable as
177     -- reactor fuel).  Natural uranium consists mainly of fissile
178     -- U-235 and non-fissile U-238, and both U-235 and U-238 are
179     -- significantly radioactive.  U-235's massic activity is
180     -- about 80.0 MBq/kg, and U-238's is about 12.4 MBq/kg, which
181     -- superficially suggests that 3.5%-fissile uranium should have
182     -- only 1.19 times the activity of fully-depleted uranium.
183     -- But a third isotope affects the result hugely: U-234 has
184     -- massic activity of 231 GBq/kg.  Natural uranium has massic
185     -- composition of 99.2837% U-238, 0.711% U-235, and 0.0053% U-234,
186     -- so its activity comes roughly 49% each from U-234 and U-238
187     -- and only 2% from U-235.  During enrichment via centrifuge,
188     -- the U-234 fraction is concentrated along with the U-235, with
189     -- the U-234:U-235 ratio remaining close to its original value.
190     -- (Actually the U-234 gets separated from U-238 slightly more
191     -- than the U-235 is, so the U-234:U-235 ratio is slightly
192     -- higher in enriched uranium.)  A typical massic composition
193     -- for 3.5%-fissile uranium is 96.47116% U-238, 3.5% U-235, and
194     -- 0.02884% U-234.  This gives 3.5%-fissile uranium about 6.55
195     -- times the activity of fully-depleted uranium.  The values we
196     -- compute here for the "radioactive" group value are based on
197     -- linear interpolation of activity along that scale, rooted at
198     -- a natural (0.7%-fissile) uranium block having the activity of
199     -- 9 uranium ore blocks (due to 9 ingots per block).  The group
200     -- value is proportional to the square root of the activity,
201     -- and uranium ore has radioactive=1.  This yields radioactive=2
202     -- for a fully-depleted uranium block and radioactive=5 for a
203     -- 3.5%-fissile uranium block.
b0faa7 204     (ov or minetest.register_node)(block, {
Z 205         description = string.format(S("%.1f%%-Fissile Uranium Block"), p/10),
206         tiles = {"technic_uranium_block.png"},
207         is_ground_content = true,
a2d1fe 208         groups = {uranium_block=1, not_in_creative_inventory=nici, cracky=1, level=2, radioactive=math.floor(math.sqrt((1+5.55*p/35) * 9 / (1+5.55*7/35)) + 0.5)},
b0faa7 209         sounds = default.node_sound_stone_defaults(),
Z 210     });
211     if not ov then
212         minetest.register_craft({
213             output = block,
214             recipe = {
215                 {ingot, ingot, ingot},
216                 {ingot, ingot, ingot},
217                 {ingot, ingot, ingot},
218             },
219         })
220         minetest.register_craft({
221             output = ingot.." 9",
222             recipe = {{block}},
223         })
224     end
225 end