technic.lua 3.0 KB

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