technic.lua 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. -- Balancing table.
  2. tech = {
  3. -- Solar energy is scaled by altitude.
  4. solar_panel={power=10, buffer=100},
  5. solar_lv={power=30, buffer=500},
  6. solar_mv={power=50, buffer=1000},
  7. solar_hv={power=100, buffer=6000},
  8. windy={power=60, buffer=1000},
  9. tidal={power=50, buffer=1000},
  10. breeder={power=10000, time=10, totaltime=60*60*24*10, buffer=30000},
  11. reactor={power=10000, time=5, totaltime=60*60*24*7, buffer=60000},
  12. converter={power=1000, buffer=50000},
  13. leecher={power=800, buffer=60000},
  14. charger={power=100, buffer=5000},
  15. workshop={power=160, buffer=5000, repair=70},
  16. distributer_lv={power=50, buffer=1000},
  17. distributer_mv={power=100, buffer=5000},
  18. distributer_hv={power=1000, buffer=10000},
  19. -- Buffer size is scaled by number of battery units in the array.
  20. battery_lv={buffer=10000},
  21. battery_mv={buffer=50000},
  22. battery_hv={buffer=120000},
  23. -- Power is scaled by number of lava/water nodes adjacent to machine.
  24. geothermal={power=3, buffer=500},
  25. hydroturbine={power=1, buffer=300},
  26. -- Time determines how many seconds to produce power.
  27. -- Mesepower is how much power to produce if fuel is mese.
  28. generator_lv={power=100, mesepower=450, time=3, buffer=5000},
  29. generator_mv={power=200, mesepower=500, time=2, buffer=10000},
  30. generator_hv={power=300, mesepower=550, time=1, buffer=20000},
  31. -- Tool machines. Timecut multiplies the machine clock; higher is longer.
  32. centrifuge_mv={demand=300, buffer=6000, timecut=1.0},
  33. gemcutter_lv={demand=100, buffer=1000, timecut=1.0},
  34. alloyer_mv={demand=300, buffer=6000, timecut=0.8},
  35. compressor_lv={demand=100, buffer=1000, timecut=2.0},
  36. compressor_mv={demand=300, buffer=6000, timecut=1.0},
  37. furnace_lv={demand=100, buffer=1000, timecut=2.0},
  38. furnace_mv={demand=300, buffer=6000, timecut=1.0},
  39. furnace_hv={demand=600, buffer=10000, timecut=0.5},
  40. extractor_lv={demand=100, buffer=1000, timecut=2.0},
  41. extractor_mv={demand=300, buffer=6000, timecut=1.0},
  42. grinder_lv={demand=200, buffer=2000, timecut=2.0},
  43. grinder_mv={demand=300, buffer=6000, timecut=0.6},
  44. }
  45. minetest.register_chatcommand("recharge", {
  46. params = "",
  47. description = "Recharges the machine tool held in hand.",
  48. privs = {server=true},
  49. func = function(name, param)
  50. local player = minetest.get_player_by_name(name)
  51. if player and player:is_player() then
  52. local tool = player:get_wielded_item()
  53. local def = minetest.registered_items[tool:get_name()]
  54. if def and def.wear_represents and def.wear_represents == "eu_charge" then
  55. -- The wear format says that 1 means fully charged.
  56. -- 0 would mean 'never yet charged'.
  57. -- The value increases toward 65534 as charge is drained,
  58. -- but should never go past that.
  59. -- A value greater than 1 means some energy has been drained.
  60. tool:set_wear(1)
  61. player:set_wielded_item(tool)
  62. if map.is_mapping_kit(tool:get_name()) then
  63. map.update_inventory_info(name)
  64. end
  65. else
  66. minetest.chat_send_player(name, "# Server: Wielded item is not rechargeable.")
  67. end
  68. end
  69. return true
  70. end,
  71. })