diff --git a/lists_of_all.lua b/lists_of_all.lua index 1bf00a3..db8369d 100755 --- a/lists_of_all.lua +++ b/lists_of_all.lua @@ -10,10 +10,10 @@ OUTPUT_SLOT_NAME={ } -local ore_duration = 4 -local ingot_duration = 2 -local smel_metal_duration = 2 -local biomassa_duration =1 +local ore_duration = 2 +local ingot_duration = 4 +local smel_metal_duration = 4 +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 -- 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")}, bronze_ingot = {(1),(1),("owl_tech:bronze_dust"),(1),(ingot_duration),(0),("none"),(0),("owl_tech:bronze_ingot")}, --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")}, 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")}, diff --git a/mashins/electro_machins.lua b/mashins/electro_machins.lua index fc938cf..418941d 100644 --- a/mashins/electro_machins.lua +++ b/mashins/electro_machins.lua @@ -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.set_mashine_tire(meta,i+1) --all steam mishine has 1 tire owl_tech.reset_item_redines(meta) + meta:set_int("eat_in_tick",0) + meta:set_int("bonus",0) set_formspect_base_electro_macerator(meta) local timer =minetest.get_node_timer(pos) local inv = meta:get_inventory() @@ -88,10 +90,9 @@ for i = 1, #table_all_machines, 1 do 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 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)-owl_tech:get_voltage(meta) + local steam_new =owl_tech:get_charge(meta)-meta:get_int("eat_in_tick") 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 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 @@ -119,15 +120,17 @@ for i = 1, #table_all_machines, 1 do inv:set_stack('dst_add', 1, dst_add_its) end end - local steam_new =owl_tech:get_charge(meta)-owl_tech:get_voltage(meta) - owl_tech:set_charge(meta,steam_new) + meta:set_int("eat_in_tick",0) + meta:set_int("bonus",0) owl_tech.reset_item_redines(meta) 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 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.add_item_redines(meta,amount) + owl_tech.add_item_redines(meta,meta:get_int("bonus")) end else owl_tech.reset_item_redines(meta) @@ -207,8 +210,10 @@ for i = 1, #table_all_machines, 1 do on_construct = function(pos) local meta = minetest.get_meta(pos) 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) + meta:set_int("eat_in_tick",0) + meta:set_int("bonus",0) set_formspect_base_alloy_smelter(meta) local timer =minetest.get_node_timer(pos) local inv = meta:get_inventory() @@ -238,10 +243,9 @@ for i = 1, #table_all_machines, 1 do end 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 - 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)-owl_tech:get_voltage(meta) + local steam_new =owl_tech:get_charge(meta)-meta:get_int("eat_in_tick") 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 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 @@ -258,15 +262,17 @@ for i = 1, #table_all_machines, 1 do dst_its:add_item(item) inv:set_stack('dst', 1, dst_its) end - local steam_new =owl_tech:get_charge(meta)-owl_tech:get_voltage(meta) - owl_tech:set_charge(meta,steam_new) + meta:set_int("eat_in_tick",0) + meta:set_int("bonus",0) owl_tech.reset_item_redines(meta) 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 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.add_item_redines(meta,amount) + owl_tech.add_item_redines(meta,meta:get_int("bonus")) end 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.set_mashine_tire(meta,i+1) --all steam mishine has 1 tire owl_tech.reset_item_redines(meta) + meta:set_int("eat_in_tick",0) + meta:set_int("bonus",0) set_formspect_base_sieve(meta) local timer =minetest.get_node_timer(pos) 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) 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 - 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) + local steam_new =owl_tech:get_charge(meta)-meta:get_int("eat_in_tick") 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 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 @@ -397,15 +404,17 @@ for i = 1, #table_all_machines, 1 do inv:set_stack('dst_add', 1, dst_add_its) end end - local steam_new =owl_tech:get_charge(meta)-owl_tech:get_voltage(meta) - owl_tech:set_charge(meta,steam_new) + meta:set_int("eat_in_tick",0) + meta:set_int("bonus",0) owl_tech.reset_item_redines(meta) 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 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.add_item_redines(meta,amount) + owl_tech.add_item_redines(meta,meta:get_int("bonus")) end else 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 owl_tech.set_pull_volume(meta,1,steam_new) 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) owl_tech:set_charge(meta,steam_new) 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.set_mashine_tire(meta,i+1) --all steam mishine has 1 tire owl_tech.reset_item_redines(meta) + meta:set_int("eat_in_tick",0) + meta:set_int("bonus",0) set_formspect_base_forge_hammer(meta) local timer =minetest.get_node_timer(pos) 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) 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 - 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) + local steam_new =owl_tech:get_charge(meta)-meta:get_int("eat_in_tick") 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 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 @@ -650,15 +660,17 @@ for i = 1, #table_all_machines, 1 do inv:set_stack('dst_add', 1, dst_add_its) end end - local steam_new =owl_tech:get_charge(meta)-owl_tech:get_voltage(meta) - owl_tech:set_charge(meta,steam_new) + meta:set_int("eat_in_tick",0) + meta:set_int("bonus",0) owl_tech.reset_item_redines(meta) 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 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.add_item_redines(meta,amount) + owl_tech.add_item_redines(meta,meta:get_int("bonus")) end else owl_tech.reset_item_redines(meta) diff --git a/multiblocks/multiblock_api.lua b/multiblocks/multiblock_api.lua index 13f83be..c42946a 100644 --- a/multiblocks/multiblock_api.lua +++ b/multiblocks/multiblock_api.lua @@ -3,7 +3,7 @@ local name = minetest.get_current_modname() local path = minetest.get_modpath(name) ------------------------------------------------------- ---get and active hatch +--get and set active hatch function owl_tech:set_active_hatch(meta,amount) meta:set_int("activ_hatch", amount) end