- NEW constructor textures

- battery recharge display bugfix (battery 0,1 and 2)
- misspelling fix in mover.lua
master
rnd1 2017-12-22 09:08:56 +01:00
parent 023657f40b
commit fe5d85cc34
8 changed files with 9 additions and 8 deletions

View File

@ -123,7 +123,7 @@ end
minetest.register_node("basic_machines:constructor", {
description = "Constructor: used to make machines",
tiles = {"grinder.png","default_furnace_top.png", "basic_machine_side.png","basic_machine_side.png","basic_machine_side.png","basic_machine_side.png"},
tiles = {"constructor.png"},
groups = {cracky=3, mesecon_effector_on = 1},
sounds = default.node_sound_wood_defaults(),
after_place_node = function(pos, placer)

View File

@ -11,7 +11,7 @@ local machines_minstep = 1 -- minimal allowed activation timestep, if faster mac
local max_range = 10; -- machines normal range of operation
local machines_operations = 10; -- 1 coal will provide 10 mover basic operations ( moving dirt 1 block distance)
local machines_TTL = 16; -- time to live for signals, how many hops before signal dissipates
basic_machines.version = "12/21/2017a";
basic_machines.version = "12/22/2017a";
basic_machines.clockgen = 1; -- if 0 all background continuously running activity (clockgen/keypad) repeating is disabled
-- how hard it is to move blocks, default factor 1, note fuel cost is this multiplied by distance and divided by machine_operations..
@ -183,7 +183,7 @@ local get_mover_form = function(pos,player)
else -- POSITIONS
local inventory_list1,invetory_list2;
local inventory_list1,inventory_list2;
if mode_string == "inventory" then
inventory_list1 = "label[4.5,0.25;source inventory] dropdown[4.5,0.75;1.5,1;inv1;".. inv_list1 ..";" .. inv1 .."]"
inventory_list2 = "label[4.5,3.;target inventory] dropdown[4.5,3.5;1.5,1;inv2;".. inv_list2 .. ";" .. inv2 .."]"

View File

@ -179,7 +179,8 @@ minetest.register_node("basic_machines:battery", {
if energy>=1 then -- no need to recharge yet, will still work next time
local full_coef_new = math.floor(energy/capacity*3); pos.y = pos.y-1
local full_coef_new = math.floor(energy/capacity*3); if fuel_coef_new>2 then fuel_coef_new = 2 end
pos.y = pos.y-1;
if full_coef_new ~= full_coef then minetest.swap_node(pos,{name = "basic_machines:battery_".. full_coef_new}) end
return
else
@ -203,7 +204,7 @@ minetest.register_node("basic_machines:battery", {
return
end
local full_coef_new = math.floor(energy/capacity*3);
local full_coef_new = math.floor(energy/capacity*3); if fuel_coef_new>2 then fuel_coef_new = 2 end
if full_coef_new ~= full_coef then minetest.swap_node(pos,{name = "basic_machines:battery_".. full_coef_new}) end
end
@ -452,8 +453,8 @@ function basic_machines.check_power(pos, power_draw) -- mover checks power sourc
meta:set_float("energy", energy);
-- update energy display
meta:set_string("infotext", "energy: " .. math.ceil(energy*10)/10 .. " / ".. capacity);
local full_coef_new = math.floor(energy/capacity*3);
local full_coef_new = math.floor(energy/capacity*3); if fuel_coef_new>2 then fuel_coef_new = 2 end
if full_coef_new ~= full_coef then minetest.swap_node(pos,{name = "basic_machines:battery_".. full_coef_new}) end -- graphic energy level display
@ -503,9 +504,9 @@ minetest.register_craftitem("basic_machines:power_rod", {
stack_max = 25
})
-- various battery levels: 0,1,2
-- various battery levels: 0,1,2 (2 >= 66%, 1 >= 33%,0>=0%)
local batdef = minetest.registered_nodes["basic_machines:battery"];
for i = 0,2 do
batdef.tiles[3] = "basic_machine_battery_" .. i ..".png"
minetest.register_node("basic_machines:battery_"..i, batdef)
end
end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 487 B

After

Width:  |  Height:  |  Size: 1013 B