diff options
author | Maciej Kasatkin <mk@realbadangel.pl> | 2012-10-23 01:32:29 +0200 |
---|---|---|
committer | Maciej Kasatkin <mk@realbadangel.pl> | 2012-10-23 01:32:29 +0200 |
commit | d503d3d7578c430cafc9e4dbb999faf685063a38 (patch) | |
tree | 021a9821b432f431ae4567c13d953ad5045c7a69 /battery_box.lua | |
parent | 81943958a6f928db41148a2bdba9fc0d5fbfb0a4 (diff) |
Added Chainsaw
Diffstat (limited to 'battery_box.lua')
-rw-r--r-- | battery_box.lua | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/battery_box.lua b/battery_box.lua index 93f07ee..ed0b2f8 100644 --- a/battery_box.lua +++ b/battery_box.lua @@ -10,6 +10,7 @@ registered_power_tools_count=registered_power_tools_count+1 end register_power_tool ("technic:mining_drill",60000) +register_power_tool ("technic:chainsaw",40000) register_power_tool ("technic:laser_mk1",40000) register_power_tool ("technic:battery",10000) register_power_tool ("technic:sonic_screwdriver",15000) @@ -156,7 +157,7 @@ minetest.register_abm({ chance = 1, action = function(pos, node, active_object_count, active_object_count_wider) local meta = minetest.env:get_meta(pos) - charge= meta:get_float("battery_charge") + charge= meta:get_int("battery_charge") max_charge= 60000 local i=math.ceil((charge/max_charge)*8) if i>8 then i=8 end @@ -191,7 +192,7 @@ minetest.register_abm({ src_item["wear"]=tostring(load1) inv:set_stack("src", 1, src_item) end - meta:set_float("battery_charge",charge) + meta:set_int("battery_charge",charge) end end @@ -216,7 +217,7 @@ minetest.register_abm({ end - meta:set_float("battery_charge",charge) + meta:set_int("battery_charge",charge) meta:set_string("infotext", "Battery box: "..charge.."/"..max_charge); local load = math.floor(charge/60000 * 100) |