| | |
| | | mode=mode+1 |
| | | if mode>=5 then mode=1 end |
| | | minetest.chat_send_player(player_name, S("Mining Drill Mk%d Mode %d"):format(2, mode)..": "..mining_drill_mode_text[mode][1]) |
| | | item["name"]="technic:mining_drill_mk2_"..mode |
| | | itemstack:set_name("technic:mining_drill_mk2_"..mode); |
| | | meta["mode"]=mode |
| | | itemstack:set_metadata(minetest.serialize(meta)) |
| | | return itemstack |
| | |
| | | mode=mode+1 |
| | | if mode>=6 then mode=1 end |
| | | minetest.chat_send_player(player_name, S("Mining Drill Mk%d Mode %d"):format(3, mode)..": "..mining_drill_mode_text[mode][1]) |
| | | item["name"]="technic:mining_drill_mk3_"..mode |
| | | itemstack:set_name("technic:mining_drill_mk3_"..mode); |
| | | meta["mode"]=mode |
| | | itemstack:set_metadata(minetest.serialize(meta)) |
| | | return itemstack |
| | |
| | | end |
| | | local charge_to_take = cost_to_use(2, meta.mode) |
| | | if meta.charge >= charge_to_take then |
| | | local pos = minetest.get_pointed_thing_position(pointed_thing, above) |
| | | local pos = minetest.get_pointed_thing_position(pointed_thing, false) |
| | | drill_dig_it(pos, user, meta.mode) |
| | | if not technic.creative_mode then |
| | | meta.charge = meta.charge - charge_to_take |
| | |
| | | end |
| | | local charge_to_take = cost_to_use(3, meta.mode) |
| | | if meta.charge >= charge_to_take then |
| | | local pos = minetest.get_pointed_thing_position(pointed_thing, above) |
| | | local pos = minetest.get_pointed_thing_position(pointed_thing, false) |
| | | drill_dig_it(pos, user, meta.mode) |
| | | if not technic.creative_mode then |
| | | meta.charge = meta.charge - charge_to_take |
| | |
| | | end |
| | | local charge_to_take = cost_to_use(1, 1) |
| | | if meta.charge >= charge_to_take then |
| | | local pos = minetest.get_pointed_thing_position(pointed_thing, above) |
| | | local pos = minetest.get_pointed_thing_position(pointed_thing, false) |
| | | drill_dig_it(pos, user, 1) |
| | | if not technic.creative_mode then |
| | | meta.charge = meta.charge - charge_to_take |