Fix bug - mashins eat only as much as they should
This commit is contained in:
parent
0619d3a350
commit
637d092313
|
@ -10,10 +10,10 @@ OUTPUT_SLOT_NAME={
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
local ore_duration = 4
|
local ore_duration = 2
|
||||||
local ingot_duration = 2
|
local ingot_duration = 4
|
||||||
local smel_metal_duration = 2
|
local smel_metal_duration = 4
|
||||||
local biomassa_duration =1
|
local biomassa_duration =4
|
||||||
|
|
||||||
-- key-input_name ----1)input_amount 2)recip_tire 3)output_name 4)output_amount 5)duration(use for 100) 6)seconds_chanse(0-100) 7)output_name_second 8)output_amount_second 9)Input full name
|
-- key-input_name ----1)input_amount 2)recip_tire 3)output_name 4)output_amount 5)duration(use for 100) 6)seconds_chanse(0-100) 7)output_name_second 8)output_amount_second 9)Input full name
|
||||||
-- minus 10 key
|
-- minus 10 key
|
||||||
|
@ -39,7 +39,7 @@ MACERATO_RECIPS = {
|
||||||
steel_ingot = {(1),(1),("owl_tech:steel_dust"),(1),(ingot_duration),(0),("none"),(0),("owl_tech:steel_ingot")},
|
steel_ingot = {(1),(1),("owl_tech:steel_dust"),(1),(ingot_duration),(0),("none"),(0),("owl_tech:steel_ingot")},
|
||||||
bronze_ingot = {(1),(1),("owl_tech:bronze_dust"),(1),(ingot_duration),(0),("none"),(0),("owl_tech:bronze_ingot")},
|
bronze_ingot = {(1),(1),("owl_tech:bronze_dust"),(1),(ingot_duration),(0),("none"),(0),("owl_tech:bronze_ingot")},
|
||||||
--make biomassa
|
--make biomassa
|
||||||
acacialeves = {(1),(2),("owl_tech:biomassa"),(2),(biomassa_duration),(25),("owl_tech:biomassa"),(1),("mcl_core:acacialeves")},
|
acacialeaves = {(1),(2),("owl_tech:biomassa"),(2),(biomassa_duration),(25),("owl_tech:biomassa"),(1),("mcl_core:acacialeves")},
|
||||||
birchleaves = {(1),(2),("owl_tech:biomassa"),(2),(biomassa_duration),(25),("owl_tech:biomassa"),(1),("mcl_core:birchleaves")},
|
birchleaves = {(1),(2),("owl_tech:biomassa"),(2),(biomassa_duration),(25),("owl_tech:biomassa"),(1),("mcl_core:birchleaves")},
|
||||||
darkleaves = {(1),(2),("owl_tech:biomassa"),(2),(biomassa_duration),(25),("owl_tech:biomassa"),(1),("mcl_core:darkleaves")},
|
darkleaves = {(1),(2),("owl_tech:biomassa"),(2),(biomassa_duration),(25),("owl_tech:biomassa"),(1),("mcl_core:darkleaves")},
|
||||||
jungleleaves = {(1),(2),("owl_tech:biomassa"),(2),(biomassa_duration),(25),("owl_tech:biomassa"),(1),("mcl_core:jungleleaves")},
|
jungleleaves = {(1),(2),("owl_tech:biomassa"),(2),(biomassa_duration),(25),("owl_tech:biomassa"),(1),("mcl_core:jungleleaves")},
|
||||||
|
|
|
@ -64,6 +64,8 @@ for i = 1, #table_all_machines, 1 do
|
||||||
owl_tech:add_electro(pos,table_all_machines[i][3],table_all_machines[i][4])
|
owl_tech:add_electro(pos,table_all_machines[i][3],table_all_machines[i][4])
|
||||||
owl_tech.set_mashine_tire(meta,i+1) --all steam mishine has 1 tire
|
owl_tech.set_mashine_tire(meta,i+1) --all steam mishine has 1 tire
|
||||||
owl_tech.reset_item_redines(meta)
|
owl_tech.reset_item_redines(meta)
|
||||||
|
meta:set_int("eat_in_tick",0)
|
||||||
|
meta:set_int("bonus",0)
|
||||||
set_formspect_base_electro_macerator(meta)
|
set_formspect_base_electro_macerator(meta)
|
||||||
local timer =minetest.get_node_timer(pos)
|
local timer =minetest.get_node_timer(pos)
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
|
@ -88,10 +90,9 @@ for i = 1, #table_all_machines, 1 do
|
||||||
end
|
end
|
||||||
if MACERATO_RECIPS[name]~=nil and owl_tech.get_item_redines(meta)>0 and owl_tech.get_item_redines(meta)<100 then --recipt real
|
if MACERATO_RECIPS[name]~=nil and owl_tech.get_item_redines(meta)>0 and owl_tech.get_item_redines(meta)<100 then --recipt real
|
||||||
if owl_tech.can_macaerat_recips_go_in_this_mashien(meta,name,dst_its,dst_add_its) then-- chek for all itemslot and machine tire
|
if owl_tech.can_macaerat_recips_go_in_this_mashien(meta,name,dst_its,dst_add_its) then-- chek for all itemslot and machine tire
|
||||||
local amount=owl_tech.calculate_recipe_tire_bonus(meta,MACERATO_RECIPS[name][2],MACERATO_RECIPS[name][5])
|
local steam_new =owl_tech:get_charge(meta)-meta:get_int("eat_in_tick")
|
||||||
local steam_new =owl_tech:get_charge(meta)-owl_tech:get_voltage(meta)
|
|
||||||
owl_tech:set_charge(meta,steam_new)
|
owl_tech:set_charge(meta,steam_new)
|
||||||
owl_tech.add_item_redines(meta,amount)
|
owl_tech.add_item_redines(meta,meta:get_int("bonus"))
|
||||||
end
|
end
|
||||||
elseif MACERATO_RECIPS[name]~=nil and owl_tech.get_item_redines(meta)>=100 then
|
elseif MACERATO_RECIPS[name]~=nil and owl_tech.get_item_redines(meta)>=100 then
|
||||||
if owl_tech.can_macaerat_recips_go_in_this_mashien(meta,name,dst_its,dst_add_its) then-- chek for all itemslot and machine tire
|
if owl_tech.can_macaerat_recips_go_in_this_mashien(meta,name,dst_its,dst_add_its) then-- chek for all itemslot and machine tire
|
||||||
|
@ -119,15 +120,17 @@ for i = 1, #table_all_machines, 1 do
|
||||||
inv:set_stack('dst_add', 1, dst_add_its)
|
inv:set_stack('dst_add', 1, dst_add_its)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local steam_new =owl_tech:get_charge(meta)-owl_tech:get_voltage(meta)
|
meta:set_int("eat_in_tick",0)
|
||||||
owl_tech:set_charge(meta,steam_new)
|
meta:set_int("bonus",0)
|
||||||
owl_tech.reset_item_redines(meta)
|
owl_tech.reset_item_redines(meta)
|
||||||
end
|
end
|
||||||
elseif MACERATO_RECIPS[name]~=nil and 100/MACERATO_RECIPS[name][5]*12<= owl_tech:get_charge(meta) and owl_tech.get_item_redines(meta)==0 then --begin for work
|
elseif MACERATO_RECIPS[name]~=nil and 100/MACERATO_RECIPS[name][5]*12<= owl_tech:get_charge(meta) and owl_tech.get_item_redines(meta)==0 then --begin for work
|
||||||
local amount=owl_tech.calculate_recipe_tire_bonus(meta,MACERATO_RECIPS[name][2],MACERATO_RECIPS[name][5])
|
local amount=owl_tech.calculate_recipe_tire_bonus(meta,MACERATO_RECIPS[name][2],MACERATO_RECIPS[name][5])
|
||||||
local steam_new =owl_tech:get_charge(meta)-owl_tech:get_voltage(meta)
|
meta:set_int("eat_in_tick",((100/MACERATO_RECIPS[name][5]*12)/(100/amount)))
|
||||||
|
meta:set_int("bonus",amount)
|
||||||
|
local steam_new =owl_tech:get_charge(meta)-meta:get_int("eat_in_tick")
|
||||||
owl_tech:set_charge(meta,steam_new)
|
owl_tech:set_charge(meta,steam_new)
|
||||||
owl_tech.add_item_redines(meta,amount)
|
owl_tech.add_item_redines(meta,meta:get_int("bonus"))
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
owl_tech.reset_item_redines(meta)
|
owl_tech.reset_item_redines(meta)
|
||||||
|
@ -207,8 +210,10 @@ for i = 1, #table_all_machines, 1 do
|
||||||
on_construct = function(pos)
|
on_construct = function(pos)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
owl_tech:add_electro(pos,table_all_machines[i][3],table_all_machines[i][4])
|
owl_tech:add_electro(pos,table_all_machines[i][3],table_all_machines[i][4])
|
||||||
owl_tech.set_mashine_tire(meta,i+1) --all steam mishine has 1 tire
|
owl_tech.set_mashine_tire(meta,i+1)
|
||||||
owl_tech.reset_item_redines(meta)
|
owl_tech.reset_item_redines(meta)
|
||||||
|
meta:set_int("eat_in_tick",0)
|
||||||
|
meta:set_int("bonus",0)
|
||||||
set_formspect_base_alloy_smelter(meta)
|
set_formspect_base_alloy_smelter(meta)
|
||||||
local timer =minetest.get_node_timer(pos)
|
local timer =minetest.get_node_timer(pos)
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
|
@ -238,10 +243,9 @@ for i = 1, #table_all_machines, 1 do
|
||||||
end
|
end
|
||||||
if recipt_true and owl_tech.get_item_redines(meta)>0 and owl_tech.get_item_redines(meta)<100 then --recipt real
|
if recipt_true and owl_tech.get_item_redines(meta)>0 and owl_tech.get_item_redines(meta)<100 then --recipt real
|
||||||
if owl_tech.can_smelter_recips_recips_go_in_this_mashien(meta,name,dst_its) then-- chek for all itemslot and machine tire
|
if owl_tech.can_smelter_recips_recips_go_in_this_mashien(meta,name,dst_its) then-- chek for all itemslot and machine tire
|
||||||
local amount=owl_tech.calculate_recipe_tire_bonus(meta,SMELTER_RECIPS[name][5],SMELTER_RECIPS[name][6])
|
local steam_new =owl_tech:get_charge(meta)-meta:get_int("eat_in_tick")
|
||||||
local steam_new =owl_tech:get_charge(meta)-owl_tech:get_voltage(meta)
|
|
||||||
owl_tech:set_charge(meta,steam_new)
|
owl_tech:set_charge(meta,steam_new)
|
||||||
owl_tech.add_item_redines(meta,amount)
|
owl_tech.add_item_redines(meta,meta:get_int("bonus"))
|
||||||
end
|
end
|
||||||
elseif recipt_true and owl_tech.get_item_redines(meta)>=100 then
|
elseif recipt_true and owl_tech.get_item_redines(meta)>=100 then
|
||||||
if owl_tech.can_smelter_recips_recips_go_in_this_mashien(meta,name,dst_its) then-- chek for all itemslot and machine tire
|
if owl_tech.can_smelter_recips_recips_go_in_this_mashien(meta,name,dst_its) then-- chek for all itemslot and machine tire
|
||||||
|
@ -258,15 +262,17 @@ for i = 1, #table_all_machines, 1 do
|
||||||
dst_its:add_item(item)
|
dst_its:add_item(item)
|
||||||
inv:set_stack('dst', 1, dst_its)
|
inv:set_stack('dst', 1, dst_its)
|
||||||
end
|
end
|
||||||
local steam_new =owl_tech:get_charge(meta)-owl_tech:get_voltage(meta)
|
meta:set_int("eat_in_tick",0)
|
||||||
owl_tech:set_charge(meta,steam_new)
|
meta:set_int("bonus",0)
|
||||||
owl_tech.reset_item_redines(meta)
|
owl_tech.reset_item_redines(meta)
|
||||||
end
|
end
|
||||||
elseif recipt_true and 100/SMELTER_RECIPS[name][6]*12<=owl_tech:get_charge(meta) and owl_tech.get_item_redines(meta)==0 then --begin for work
|
elseif recipt_true and 100/SMELTER_RECIPS[name][6]*12<=owl_tech:get_charge(meta) and owl_tech.get_item_redines(meta)==0 then --begin for work
|
||||||
local amount=owl_tech.calculate_recipe_tire_bonus(meta,SMELTER_RECIPS[name][2],SMELTER_RECIPS[name][5])
|
local amount=owl_tech.calculate_recipe_tire_bonus(meta,SMELTER_RECIPS[name][2],SMELTER_RECIPS[name][5])
|
||||||
local steam_new =owl_tech:get_charge(meta)-owl_tech:get_voltage(meta)
|
meta:set_int("eat_in_tick",((100/SMELTER_RECIPS[name][6]*12)/(100/amount)))
|
||||||
|
meta:set_int("bonus",amount)
|
||||||
|
local steam_new =owl_tech:get_charge(meta)-meta:get_int("eat_in_tick")
|
||||||
owl_tech:set_charge(meta,steam_new)
|
owl_tech:set_charge(meta,steam_new)
|
||||||
owl_tech.add_item_redines(meta,amount)
|
owl_tech.add_item_redines(meta,meta:get_int("bonus"))
|
||||||
end
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
|
@ -347,6 +353,8 @@ for i = 1, #table_all_machines, 1 do
|
||||||
owl_tech:add_electro(pos,table_all_machines[i][3],table_all_machines[i][4])
|
owl_tech:add_electro(pos,table_all_machines[i][3],table_all_machines[i][4])
|
||||||
owl_tech.set_mashine_tire(meta,i+1) --all steam mishine has 1 tire
|
owl_tech.set_mashine_tire(meta,i+1) --all steam mishine has 1 tire
|
||||||
owl_tech.reset_item_redines(meta)
|
owl_tech.reset_item_redines(meta)
|
||||||
|
meta:set_int("eat_in_tick",0)
|
||||||
|
meta:set_int("bonus",0)
|
||||||
set_formspect_base_sieve(meta)
|
set_formspect_base_sieve(meta)
|
||||||
local timer =minetest.get_node_timer(pos)
|
local timer =minetest.get_node_timer(pos)
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
|
@ -366,10 +374,9 @@ for i = 1, #table_all_machines, 1 do
|
||||||
local name= string.sub(input_its:get_name(), 10)
|
local name= string.sub(input_its:get_name(), 10)
|
||||||
if SIEV_RESIPS[name]~=nil and owl_tech.get_item_redines(meta)>0 and owl_tech.get_item_redines(meta)<100 then --recipt real
|
if SIEV_RESIPS[name]~=nil and owl_tech.get_item_redines(meta)>0 and owl_tech.get_item_redines(meta)<100 then --recipt real
|
||||||
if owl_tech.can_siev_recips_go_in_this_mashien(meta,name,dst_its,dst_add_its) then-- chek for all itemslot and machine tire
|
if owl_tech.can_siev_recips_go_in_this_mashien(meta,name,dst_its,dst_add_its) then-- chek for all itemslot and machine tire
|
||||||
local amount=owl_tech.calculate_recipe_tire_bonus(meta,SIEV_RESIPS[name][2],SIEV_RESIPS[name][5])
|
local steam_new =owl_tech:get_charge(meta)-meta:get_int("eat_in_tick")
|
||||||
local steam_new =owl_tech:get_charge(meta)-owl_tech:get_voltage(meta)
|
|
||||||
owl_tech:set_charge(meta,steam_new)
|
owl_tech:set_charge(meta,steam_new)
|
||||||
owl_tech.add_item_redines(meta,amount)
|
owl_tech.add_item_redines(meta,meta:get_int("bonus"))
|
||||||
end
|
end
|
||||||
elseif SIEV_RESIPS[name]~=nil and owl_tech.get_item_redines(meta)>=100 then
|
elseif SIEV_RESIPS[name]~=nil and owl_tech.get_item_redines(meta)>=100 then
|
||||||
if owl_tech.can_siev_recips_go_in_this_mashien(meta,name,dst_its,dst_add_its) then-- chek for all itemslot and machine tire
|
if owl_tech.can_siev_recips_go_in_this_mashien(meta,name,dst_its,dst_add_its) then-- chek for all itemslot and machine tire
|
||||||
|
@ -397,15 +404,17 @@ for i = 1, #table_all_machines, 1 do
|
||||||
inv:set_stack('dst_add', 1, dst_add_its)
|
inv:set_stack('dst_add', 1, dst_add_its)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local steam_new =owl_tech:get_charge(meta)-owl_tech:get_voltage(meta)
|
meta:set_int("eat_in_tick",0)
|
||||||
owl_tech:set_charge(meta,steam_new)
|
meta:set_int("bonus",0)
|
||||||
owl_tech.reset_item_redines(meta)
|
owl_tech.reset_item_redines(meta)
|
||||||
end
|
end
|
||||||
elseif SIEV_RESIPS[name]~=nil and 100/SIEV_RESIPS[name][5]*12<= owl_tech:get_charge(meta) and owl_tech.get_item_redines(meta)==0 then --begin for work
|
elseif SIEV_RESIPS[name]~=nil and 100/SIEV_RESIPS[name][5]*12<= owl_tech:get_charge(meta) and owl_tech.get_item_redines(meta)==0 then --begin for work
|
||||||
local amount=owl_tech.calculate_recipe_tire_bonus(meta,SIEV_RESIPS[name][2],SIEV_RESIPS[name][5])
|
local amount=owl_tech.calculate_recipe_tire_bonus(meta,SIEV_RESIPS[name][2],SIEV_RESIPS[name][5])
|
||||||
local steam_new =owl_tech:get_charge(meta)-owl_tech:get_voltage(meta)
|
meta:set_int("eat_in_tick",((100/SIEV_RESIPS[name][5]*12)/(100/amount)))
|
||||||
|
meta:set_int("bonus",amount)
|
||||||
|
local steam_new =owl_tech:get_charge(meta)-meta:get_int("eat_in_tick")
|
||||||
owl_tech:set_charge(meta,steam_new)
|
owl_tech:set_charge(meta,steam_new)
|
||||||
owl_tech.add_item_redines(meta,amount)
|
owl_tech.add_item_redines(meta,meta:get_int("bonus"))
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
owl_tech.reset_item_redines(meta)
|
owl_tech.reset_item_redines(meta)
|
||||||
|
@ -517,7 +526,7 @@ for i = 1, #table_all_machines, 1 do
|
||||||
local steam_new =owl_tech.get_pull_volume(meta,1)-10
|
local steam_new =owl_tech.get_pull_volume(meta,1)-10
|
||||||
owl_tech.set_pull_volume(meta,1,steam_new)
|
owl_tech.set_pull_volume(meta,1,steam_new)
|
||||||
owl_tech.reset_item_redines(meta)
|
owl_tech.reset_item_redines(meta)
|
||||||
elseif 100<= owl_tech:get_charge(meta) and owl_tech.get_item_redines(meta)==0 then --begin for work
|
elseif owl_tech:get_charge(meta)*10<= owl_tech:get_charge(meta) and owl_tech.get_item_redines(meta)==0 then --begin for work
|
||||||
local steam_new =owl_tech:get_charge(meta)-owl_tech:get_voltage(meta)
|
local steam_new =owl_tech:get_charge(meta)-owl_tech:get_voltage(meta)
|
||||||
owl_tech:set_charge(meta,steam_new)
|
owl_tech:set_charge(meta,steam_new)
|
||||||
owl_tech.add_item_redines(meta,10)
|
owl_tech.add_item_redines(meta,10)
|
||||||
|
@ -600,6 +609,8 @@ for i = 1, #table_all_machines, 1 do
|
||||||
owl_tech:add_electro(pos,table_all_machines[i][3],table_all_machines[i][4])
|
owl_tech:add_electro(pos,table_all_machines[i][3],table_all_machines[i][4])
|
||||||
owl_tech.set_mashine_tire(meta,i+1) --all steam mishine has 1 tire
|
owl_tech.set_mashine_tire(meta,i+1) --all steam mishine has 1 tire
|
||||||
owl_tech.reset_item_redines(meta)
|
owl_tech.reset_item_redines(meta)
|
||||||
|
meta:set_int("eat_in_tick",0)
|
||||||
|
meta:set_int("bonus",0)
|
||||||
set_formspect_base_forge_hammer(meta)
|
set_formspect_base_forge_hammer(meta)
|
||||||
local timer =minetest.get_node_timer(pos)
|
local timer =minetest.get_node_timer(pos)
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
|
@ -619,10 +630,9 @@ for i = 1, #table_all_machines, 1 do
|
||||||
local name= string.sub(input_its:get_name(), 10)
|
local name= string.sub(input_its:get_name(), 10)
|
||||||
if FORGE_HAMMER_RECIPS[name]~=nil and owl_tech.get_item_redines(meta)>0 and owl_tech.get_item_redines(meta)<100 then --recipt real
|
if FORGE_HAMMER_RECIPS[name]~=nil and owl_tech.get_item_redines(meta)>0 and owl_tech.get_item_redines(meta)<100 then --recipt real
|
||||||
if owl_tech.can_forge_hammer_recips_go_in_this_mashien(meta,name,dst_its,dst_add_its) then-- chek for all itemslot and machine tire
|
if owl_tech.can_forge_hammer_recips_go_in_this_mashien(meta,name,dst_its,dst_add_its) then-- chek for all itemslot and machine tire
|
||||||
local amount=owl_tech.calculate_recipe_tire_bonus(meta,FORGE_HAMMER_RECIPS[name][2],FORGE_HAMMER_RECIPS[name][5])
|
local steam_new =owl_tech:get_charge(meta)-meta:get_int("eat_in_tick")
|
||||||
local steam_new =owl_tech:get_charge(meta)-owl_tech:get_voltage(meta)
|
|
||||||
owl_tech:set_charge(meta,steam_new)
|
owl_tech:set_charge(meta,steam_new)
|
||||||
owl_tech.add_item_redines(meta,amount)
|
owl_tech.add_item_redines(meta,meta:get_int("bonus"))
|
||||||
end
|
end
|
||||||
elseif FORGE_HAMMER_RECIPS[name]~=nil and owl_tech.get_item_redines(meta)>=100 then
|
elseif FORGE_HAMMER_RECIPS[name]~=nil and owl_tech.get_item_redines(meta)>=100 then
|
||||||
if owl_tech.can_forge_hammer_recips_go_in_this_mashien(meta,name,dst_its,dst_add_its) then-- chek for all itemslot and machine tire
|
if owl_tech.can_forge_hammer_recips_go_in_this_mashien(meta,name,dst_its,dst_add_its) then-- chek for all itemslot and machine tire
|
||||||
|
@ -650,15 +660,17 @@ for i = 1, #table_all_machines, 1 do
|
||||||
inv:set_stack('dst_add', 1, dst_add_its)
|
inv:set_stack('dst_add', 1, dst_add_its)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local steam_new =owl_tech:get_charge(meta)-owl_tech:get_voltage(meta)
|
meta:set_int("eat_in_tick",0)
|
||||||
owl_tech:set_charge(meta,steam_new)
|
meta:set_int("bonus",0)
|
||||||
owl_tech.reset_item_redines(meta)
|
owl_tech.reset_item_redines(meta)
|
||||||
end
|
end
|
||||||
elseif FORGE_HAMMER_RECIPS[name]~=nil and 100/FORGE_HAMMER_RECIPS[name][5]*12<= owl_tech:get_charge(meta) and owl_tech.get_item_redines(meta)==0 then --begin for work
|
elseif FORGE_HAMMER_RECIPS[name]~=nil and 100/FORGE_HAMMER_RECIPS[name][5]*12<= owl_tech:get_charge(meta) and owl_tech.get_item_redines(meta)==0 then --begin for work
|
||||||
local amount=owl_tech.calculate_recipe_tire_bonus(meta,FORGE_HAMMER_RECIPS[name][2],FORGE_HAMMER_RECIPS[name][5])
|
local amount=owl_tech.calculate_recipe_tire_bonus(meta,FORGE_HAMMER_RECIPS[name][2],FORGE_HAMMER_RECIPS[name][5])
|
||||||
local steam_new =owl_tech:get_charge(meta)-owl_tech:get_voltage(meta)
|
meta:set_int("eat_in_tick",((100/FORGE_HAMMER_RECIPS[name][5]*12)/(100/amount)))
|
||||||
|
meta:set_int("bonus",amount)
|
||||||
|
local steam_new =owl_tech:get_charge(meta)-meta:get_int("eat_in_tick")
|
||||||
owl_tech:set_charge(meta,steam_new)
|
owl_tech:set_charge(meta,steam_new)
|
||||||
owl_tech.add_item_redines(meta,amount)
|
owl_tech.add_item_redines(meta,meta:get_int("bonus"))
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
owl_tech.reset_item_redines(meta)
|
owl_tech.reset_item_redines(meta)
|
||||||
|
|
|
@ -3,7 +3,7 @@ local name = minetest.get_current_modname()
|
||||||
local path = minetest.get_modpath(name)
|
local path = minetest.get_modpath(name)
|
||||||
|
|
||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
--get and active hatch
|
--get and set active hatch
|
||||||
function owl_tech:set_active_hatch(meta,amount)
|
function owl_tech:set_active_hatch(meta,amount)
|
||||||
meta:set_int("activ_hatch", amount)
|
meta:set_int("activ_hatch", amount)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue