aboutsummaryrefslogtreecommitdiff
path: root/nodes
diff options
context:
space:
mode:
authorfluxionary <25628292+fluxionary@users.noreply.github.com>2023-01-25 23:25:46 -0800
committerGitHub <noreply@github.com>2023-01-26 08:25:46 +0100
commit18155b3ebedd24fba5c3cbf109063f64f882d8a6 (patch)
tree5d5d67f8108aa963bb229ee3d282f0eb5a18ca1d /nodes
parent675e1e1943598893acf3d652caca18b0193746d9 (diff)
downloadmesecons_debug-18155b3ebedd24fba5c3cbf109063f64f882d8a6.tar.gz
mesecons_debug-18155b3ebedd24fba5c3cbf109063f64f882d8a6.zip
some more updates (#9)
* add proper settings (untested) * more constants -> settings * normalize whitespace between code files * refactor globalsteps in order to simplify logic * minor refactoring * rename file * use mod_storage for persistent data; optimize context initialization * refactoring (moving files around) * rewrite penalty * add settings; document; allow changing while game is running * add command to update settings * update init after splitting commands into files * fix bugs; add debugging tools; too much for one commit... * fix whitelist conversion * add adjustable blinky plant to timer overrides * add some more mesecons nodes with repeating timers * resolve luacheck warnings * tweak hud * Update documentation; parameterize more things; refactor some logic for readability * update lag even when mesecons isn't active * update lag even when mesecons isn't active * tweak default settings * move hud so it doesn't interfere w/ areas * tweak default settings * put the HUD in a place which doesn't conflict w/ areas mod * ensure that actions have a valid position to avoid a crash * stylua * make sure we don't update the wrong HUD * spaces not tabs Co-authored-by: AliasAlreadyTaken <aliasalreadytaken@noreply.example.org3>
Diffstat (limited to 'nodes')
-rw-r--r--nodes/mesecons_lagger.lua15
-rw-r--r--nodes/penalty_controller.lua12
2 files changed, 12 insertions, 15 deletions
diff --git a/nodes/mesecons_lagger.lua b/nodes/mesecons_lagger.lua
index e4d966e..7aa53aa 100644
--- a/nodes/mesecons_lagger.lua
+++ b/nodes/mesecons_lagger.lua
@@ -1,18 +1,16 @@
-
local wait = mesecons_debug.wait
mesecon.queue:add_function("create_lag", function(_pos, duration)
wait(duration)
end)
-
minetest.register_node("mesecons_debug:mesecons_lagger", {
description = "machine for adding artificial mesecons lag",
group = {
not_in_creative_inventory = 1,
unbreakable = 1,
},
- tiles = {"default_mese_block.png^[colorize:#F00:128"},
+ tiles = { "default_mese_block.png^[colorize:#F00:128" },
on_blast = function() end,
drop = "",
@@ -20,8 +18,7 @@ minetest.register_node("mesecons_debug:mesecons_lagger", {
local meta = minetest.get_meta(pos)
meta:set_float("lag", 0.0)
meta:set_float("chance", 0.0)
- meta:set_string("formspec",
- ("field[lag;Lag (in us);%s]field[chance;Chance;%s]"):format(0.0, 0.0))
+ meta:set_string("formspec", ("field[lag;Lag (in us);%s]field[chance;Chance;%s]"):format(0.0, 0.0))
local timer = minetest.get_node_timer(pos)
timer:start(0)
@@ -38,10 +35,10 @@ minetest.register_node("mesecons_debug:mesecons_lagger", {
if fields.chance then
meta:set_float("chance", fields.chance)
end
- meta:set_string("formspec",
- ("field[lag;Lag (in us);%s]field[chance;Chance;%s]"):format(
- meta:get_float("lag"), meta:get_float("chance")))
-
+ meta:set_string(
+ "formspec",
+ ("field[lag;Lag (in us);%s]field[chance;Chance;%s]"):format(meta:get_float("lag"), meta:get_float("chance"))
+ )
end,
on_timer = function(pos, _elapsed)
diff --git a/nodes/penalty_controller.lua b/nodes/penalty_controller.lua
index 6e160c1..13f8e3e 100644
--- a/nodes/penalty_controller.lua
+++ b/nodes/penalty_controller.lua
@@ -16,7 +16,7 @@ minetest.register_node("mesecons_debug:penalty_controller", {
"jeija_microcontroller_sides.png",
"jeija_microcontroller_sides.png",
"jeija_microcontroller_sides.png",
- "jeija_microcontroller_sides.png"
+ "jeija_microcontroller_sides.png",
},
inventory_image = "penalty_controller_top.png",
@@ -33,7 +33,7 @@ minetest.register_node("mesecons_debug:penalty_controller", {
{ -8 / 16, -8 / 16, -8 / 16, 8 / 16, -7 / 16, 8 / 16 }, -- Bottom slab
{ -5 / 16, -7 / 16, -5 / 16, 5 / 16, -6 / 16, 5 / 16 }, -- Circuit board
{ -3 / 16, -6 / 16, -3 / 16, 3 / 16, -5 / 16, 3 / 16 }, -- IC
- }
+ },
},
paramtype = "light",
@@ -66,10 +66,10 @@ minetest.register_node("mesecons_debug:penalty_controller", {
micros = ctx.micros,
avg_micros = ctx.avg_micros_per_second,
penalty = ctx.penalty,
- whitelisted = ctx.whitelisted
+ whitelisted = ctx.whitelisted,
})
end
- end
- }
- }
+ end,
+ },
+ },
})