technic.lua 2.9 KB

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