| | |
| | | output = 'technic:laser_mk1', |
| | | recipe = { |
| | | {'default:diamond', 'default:steel_ingot', 'technic:red_energy_crystal'}, |
| | | {'', 'default:steel_ingot', 'technic:steel_ingot'}, |
| | | {'', 'default:steel_ingot', 'default:steel_ingot'}, |
| | | {'', '', 'default:copper_ingot'}, |
| | | } |
| | | }) |
| | |
| | | description = S("Mining Laser Mk%d"):format(m[1]), |
| | | inventory_image = "technic_mining_laser_mk"..m[1]..".png", |
| | | stack_max = 1, |
| | | wear_represents = "technic_RE_charge", |
| | | on_use = function(itemstack, user) |
| | | local meta = minetest.deserialize(itemstack:get_metadata()) |
| | | if not meta or not meta.charge then |
| | |
| | | if meta.charge >= m[4] then |
| | | meta.charge = meta.charge - m[4] |
| | | laser_shoot(user, m[2], "technic_laser_beam_mk"..m[1]..".png", "technic_laser_mk"..m[1]) |
| | | meta.charge = meta.charge - 400 |
| | | technic.set_RE_wear(itemstack, meta.charge, m[3]) |
| | | itemstack:set_metadata(minetest.serialize(meta)) |
| | | end |