diff --git a/blocks/add_item.lua b/blocks/add_item.lua index 8e8a8dc..d87ea8c 100644 --- a/blocks/add_item.lua +++ b/blocks/add_item.lua @@ -38,14 +38,7 @@ end minetest.register_node("epic:additem", { description = "Epic add item block: Adds an item at the defined position", - tiles = { - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png^epic_add_item.png", - }, + tiles = epic.create_texture("action", "epic_add_item.png"), paramtype2 = "facedir", groups = {cracky=3,oddly_breakable_by_hand=3,epic=1}, on_rotate = epic.on_rotate, diff --git a/blocks/branch.lua b/blocks/branch.lua index e07aa60..78ab765 100644 --- a/blocks/branch.lua +++ b/blocks/branch.lua @@ -60,14 +60,7 @@ end minetest.register_node("epic:branch", { description = "Epic branch block: selects the first successful conditional block", - tiles = { - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png^epic_branch.png", - }, + tiles = epic.create_texture("branch", "epic_branch.png"), paramtype2 = "facedir", groups = {cracky=3,oddly_breakable_by_hand=3,epic=1}, on_rotate = epic.on_rotate, diff --git a/blocks/call.lua b/blocks/call.lua index 3912ed5..991b6e6 100644 --- a/blocks/call.lua +++ b/blocks/call.lua @@ -13,14 +13,7 @@ end minetest.register_node("epic:call", { description = "Epic Call block: executes another function", - tiles = { - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png^epic_call.png", - }, + tiles = epic.create_texture("action", "epic_call.png"), paramtype2 = "facedir", groups = {cracky=3,oddly_breakable_by_hand=3,epic=1}, on_rotate = epic.on_rotate, diff --git a/blocks/check_empty_armor.lua b/blocks/check_empty_armor.lua index ec8f66c..04d0506 100644 --- a/blocks/check_empty_armor.lua +++ b/blocks/check_empty_armor.lua @@ -1,14 +1,7 @@ minetest.register_node("epic:check_empty_armor", { description = "Epic check empty armor block: checks if the armor-inventory is empty", - tiles = { - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png^epic_briefcase.png", - }, + tiles = epic.create_texture("condition", "epic_briefcase.png"), paramtype2 = "facedir", groups = {cracky=3,oddly_breakable_by_hand=3,epic=1}, on_rotate = epic.on_rotate, diff --git a/blocks/check_empty_inventory.lua b/blocks/check_empty_inventory.lua index 5495e9c..535ad60 100644 --- a/blocks/check_empty_inventory.lua +++ b/blocks/check_empty_inventory.lua @@ -1,14 +1,7 @@ minetest.register_node("epic:check_empty_inv", { description = "Epic check empty inventory block: checks if the craft- and main-inventories are empty", - tiles = { - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png^epic_briefcase.png", - }, + tiles = epic.create_texture("condition", "epic_briefcase.png"), paramtype2 = "facedir", groups = {cracky=3,oddly_breakable_by_hand=3,epic=1}, on_rotate = epic.on_rotate, diff --git a/blocks/command.lua b/blocks/command.lua index 4f80f3b..987dfdc 100644 --- a/blocks/command.lua +++ b/blocks/command.lua @@ -33,14 +33,7 @@ end minetest.register_node("epic:command", { description = "Epic command block: executes a chat-command", - tiles = { - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png^epic_command.png", - }, + tiles = epic.create_texture("action", "epic_command.png"), paramtype2 = "facedir", groups = {cracky=3,oddly_breakable_by_hand=3,epic=1}, on_rotate = epic.on_rotate, diff --git a/blocks/deduct_inventory.lua b/blocks/deduct_inventory.lua index 5f78f9a..f8022dc 100644 --- a/blocks/deduct_inventory.lua +++ b/blocks/deduct_inventory.lua @@ -13,14 +13,7 @@ end minetest.register_node("epic:deduct_inv", { description = "Epic deduct from inventory block: removes items from the inventory", - tiles = { - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png^epic_briefcase.png", - }, + tiles = epic.create_texture("action", "epic_briefcase.png"), paramtype2 = "facedir", groups = {cracky=3,oddly_breakable_by_hand=3,epic=1}, on_rotate = epic.on_rotate, diff --git a/blocks/delay.lua b/blocks/delay.lua index efb8bc5..5cddf1c 100644 --- a/blocks/delay.lua +++ b/blocks/delay.lua @@ -13,14 +13,7 @@ end minetest.register_node("epic:delay", { description = "Epic delay block: delays the execution of the next block", - tiles = { - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png^epic_pause.png", - }, + tiles = epic.create_texture("condition", "epic_pause.png"), paramtype2 = "facedir", groups = {cracky=3,oddly_breakable_by_hand=3,epic=1}, on_rotate = epic.on_rotate, diff --git a/blocks/dialogue.lua b/blocks/dialogue.lua index ae79aa7..23e9085 100644 --- a/blocks/dialogue.lua +++ b/blocks/dialogue.lua @@ -68,14 +68,7 @@ end) minetest.register_node("epic:dialogue", { description = "Epic dialogue block: show one or more questions in a formspec", - tiles = { - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png^epic_bubble.png", - }, + tiles = epic.create_texture("condition", "epic_bubble.png"), paramtype2 = "facedir", groups = {cracky=3,oddly_breakable_by_hand=3,epic=1}, on_rotate = epic.on_rotate, diff --git a/blocks/digiline_emit.lua b/blocks/digiline_emit.lua index f7a2d04..a172323 100644 --- a/blocks/digiline_emit.lua +++ b/blocks/digiline_emit.lua @@ -1,14 +1,7 @@ minetest.register_node("epic:digiline_emit", { description = "Epic digiline emit block: emits the playername as digilines message", - tiles = { - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png^digiline_std_inv.png", - }, + tiles = epic.create_texture("action", "digiline_std_inv.png"), paramtype2 = "facedir", groups = {cracky=3,oddly_breakable_by_hand=3,epic=1}, on_rotate = epic.on_rotate, @@ -17,10 +10,10 @@ minetest.register_node("epic:digiline_emit", { receptor = {}, }, - epic = { - on_enter = function(pos, _, player, ctx) + epic = { + on_enter = function(pos, _, player, ctx) digilines.receptor_send(pos, digilines.rules.default, "epic", player:get_player_name()) ctx.next() - end - } + end + } }) diff --git a/blocks/epic.lua b/blocks/epic.lua index e1f6a6c..8168a3d 100644 --- a/blocks/epic.lua +++ b/blocks/epic.lua @@ -2,8 +2,8 @@ minetest.register_node("epic:epic", { description = "Epic: Configurable starter block for quests", groups = {cracky=3,oddly_breakable_by_hand=3}, - tiles = { - "epic_node_bg.png^epic_epic.png" + tiles = { + "epic_node_bg.png^epic_epic.png" }, after_place_node = function(pos, placer) @@ -27,7 +27,7 @@ minetest.register_node("epic:epic", { -- allow mesecons triggering mesecons = { effector = { - action_on = function (pos) + action_on = function (pos) for _, player in ipairs(minetest.get_connected_players()) do local ppos = player:get_pos() diff --git a/blocks/fill_chest.lua b/blocks/fill_chest.lua index d20280f..0c11f64 100644 --- a/blocks/fill_chest.lua +++ b/blocks/fill_chest.lua @@ -39,14 +39,7 @@ end minetest.register_node("epic:fill_chest", { description = "Epic fill chest block: fills a chest with the defined contents", - tiles = { - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png^epic_add_item.png", - }, + tiles = epic.create_texture("action", "epic_add_item.png"), paramtype2 = "facedir", groups = {cracky=3,oddly_breakable_by_hand=3,epic=1}, on_rotate = epic.on_rotate, diff --git a/blocks/filter_inventory.lua b/blocks/filter_inventory.lua index e578c42..9ca225c 100644 --- a/blocks/filter_inventory.lua +++ b/blocks/filter_inventory.lua @@ -22,14 +22,7 @@ end minetest.register_node("epic:filter_inv", { description = "Epic filter inventory block: filters the inventory from the given items", - tiles = { - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png^epic_briefcase.png", - }, + tiles = epic.create_texture("action", "epic_briefcase.png"), paramtype2 = "facedir", groups = {cracky=3,oddly_breakable_by_hand=3,epic=1}, on_rotate = epic.on_rotate, diff --git a/blocks/function.lua b/blocks/function.lua index dee8ef6..5ff6c18 100644 --- a/blocks/function.lua +++ b/blocks/function.lua @@ -6,14 +6,7 @@ end minetest.register_node("epic:function", { description = "Epic function block: start-block for further epic blocks", - tiles = { - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png^epic_go.png", - }, + tiles = epic.create_texture("function", "epic_go.png"), paramtype2 = "facedir", groups = {cracky=3,oddly_breakable_by_hand=3,epic=1}, on_rotate = epic.on_rotate, diff --git a/blocks/kill_count.lua b/blocks/kill_count.lua index 5ae293e..41a7637 100644 --- a/blocks/kill_count.lua +++ b/blocks/kill_count.lua @@ -21,14 +21,7 @@ end minetest.register_node("epic:kill_count", { description = "Epic kill count block: enables the kill counter on the hud and " .. "continues if the count matches the configured value", - tiles = { - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png^epic_mob.png", - }, + tiles = epic.create_texture("condition", "epic_mob.png"), paramtype2 = "facedir", groups = {cracky=3,oddly_breakable_by_hand=3,epic=1}, on_rotate = epic.on_rotate, diff --git a/blocks/lightning.lua b/blocks/lightning.lua index 2abd1f6..1aee632 100644 --- a/blocks/lightning.lua +++ b/blocks/lightning.lua @@ -28,14 +28,7 @@ end minetest.register_node("epic:lightning", { description = "Epic Lightning block: strikes lightning at the defined position", - tiles = { - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png^epic_lightning.png", - }, + tiles = epic.create_texture("action", "epic_lightning.png"), paramtype2 = "facedir", groups = {cracky=3,oddly_breakable_by_hand=3,epic=1}, on_rotate = epic.on_rotate, diff --git a/blocks/load.lua b/blocks/load.lua index 5891123..5028b36 100644 --- a/blocks/load.lua +++ b/blocks/load.lua @@ -2,23 +2,16 @@ minetest.register_node("epic:load", { description = "Epic load block: loads a previously saved game", - tiles = { - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png^epic_load.png", - }, + tiles = epic.create_texture("load", "epic_load.png"), paramtype2 = "facedir", groups = {cracky=3,oddly_breakable_by_hand=3,epic=1}, on_rotate = epic.on_rotate, on_construct = function(pos) - local meta = minetest.get_meta(pos) + local meta = minetest.get_meta(pos) meta:set_string("infotext", "Load game") meta:set_string("topic", "My maze") - end, + end, on_rightclick = function(pos, _, player) local playername = player:get_player_name() diff --git a/blocks/lock.lua b/blocks/lock.lua index 54674b1..978a204 100644 --- a/blocks/lock.lua +++ b/blocks/lock.lua @@ -1,14 +1,7 @@ minetest.register_node("epic:lock", { description = "Epic lock block: locks the current execution-path (mutual exclusive execution)", - tiles = { - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png^epic_lock.png", - }, + tiles = epic.create_texture("condition", "epic_lock.png"), paramtype2 = "facedir", groups = {cracky=3,oddly_breakable_by_hand=3,epic=1}, on_rotate = epic.on_rotate, diff --git a/blocks/loop_sound.lua b/blocks/loop_sound.lua index 61cf29a..8ed1229 100644 --- a/blocks/loop_sound.lua +++ b/blocks/loop_sound.lua @@ -34,14 +34,7 @@ end minetest.register_node("epic:loop_sound", { description = "Epic loop sound block: loops a sound for the player", - tiles = { - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png^epic_music.png", - }, + tiles = epic.create_texture("action", "epic_music.png"), paramtype2 = "facedir", groups = {cracky=3,oddly_breakable_by_hand=3,epic=1}, on_rotate = epic.on_rotate, diff --git a/blocks/mesecon_check.lua b/blocks/mesecon_check.lua index 86e3bbc..0dd8e77 100644 --- a/blocks/mesecon_check.lua +++ b/blocks/mesecon_check.lua @@ -16,14 +16,7 @@ end minetest.register_node("epic:mesecon_check", { description = "Epic mesecon check block: checks if the target mesecons-block is on", - tiles = { - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png^epic_mese_crystal.png^epic_question_mark.png", - }, + tiles = epic.create_texture("condition", "epic_mese_crystal.png^epic_question_mark.png"), paramtype2 = "facedir", groups = {cracky=3,oddly_breakable_by_hand=3,epic=1}, on_rotate = epic.on_rotate, diff --git a/blocks/mesecon_emit.lua b/blocks/mesecon_emit.lua index dbac7ee..7a25315 100644 --- a/blocks/mesecon_emit.lua +++ b/blocks/mesecon_emit.lua @@ -13,14 +13,7 @@ end minetest.register_node("epic:mesecon_emit", { description = "Epic mesecon emit block: emits a mesecons signal for 1 second", - tiles = { - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png^epic_mese_crystal.png", - }, + tiles = epic.create_texture("action", "epic_mese_crystal.png"), paramtype2 = "facedir", groups = {cracky=3,oddly_breakable_by_hand=3,epic=1}, on_rotate = epic.on_rotate, diff --git a/blocks/message.lua b/blocks/message.lua index 36be240..b1c5c30 100644 --- a/blocks/message.lua +++ b/blocks/message.lua @@ -13,14 +13,7 @@ end minetest.register_node("epic:message", { description = "Epic message block: displays a chat message to the player", - tiles = { - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png^epic_bubble.png", - }, + tiles = epic.create_texture("action", "epic_bubble.png"), paramtype2 = "facedir", groups = {cracky=3,oddly_breakable_by_hand=3,epic=1}, on_rotate = epic.on_rotate, diff --git a/blocks/nop.lua b/blocks/nop.lua index a5c9baf..2bf3dee 100644 --- a/blocks/nop.lua +++ b/blocks/nop.lua @@ -1,14 +1,7 @@ minetest.register_node("epic:nop", { description = "Epic no-op block: placeholder-node, does nothing", - tiles = { - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png^epic_nop.png", - }, + tiles = epic.create_texture("action", "epic_nop.png"), paramtype2 = "facedir", groups = {cracky=3,oddly_breakable_by_hand=3,epic=1}, on_rotate = epic.on_rotate, diff --git a/blocks/on_abort.lua b/blocks/on_abort.lua index b9be2f0..fc4d834 100644 --- a/blocks/on_abort.lua +++ b/blocks/on_abort.lua @@ -16,14 +16,7 @@ end minetest.register_node("epic:on_abort", { description = "Epic on_abort callback block: stores an abort-function to execute in the abort case", - tiles = { - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png^epic_exit.png", - }, + tiles = epic.create_texture("callback", "epic_exit.png"), paramtype2 = "facedir", groups = {cracky=3,oddly_breakable_by_hand=3,epic=1}, on_rotate = epic.on_rotate, diff --git a/blocks/on_exit.lua b/blocks/on_exit.lua index 8f682a6..749dd8a 100644 --- a/blocks/on_exit.lua +++ b/blocks/on_exit.lua @@ -16,14 +16,7 @@ end minetest.register_node("epic:on_exit", { description = "Epic on_exit callback block: stores an exit-function to execute in the exit case", - tiles = { - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png^epic_exit.png", - }, + tiles = epic.create_texture("callback", "epic_exit.png"), paramtype2 = "facedir", groups = {cracky=3,oddly_breakable_by_hand=3,epic=1}, on_rotate = epic.on_rotate, diff --git a/blocks/play_sound.lua b/blocks/play_sound.lua index e1aa1d0..ff70bbd 100644 --- a/blocks/play_sound.lua +++ b/blocks/play_sound.lua @@ -37,14 +37,7 @@ end minetest.register_node("epic:play_sound", { description = "Epic play sound block: plays a sound for the player", - tiles = { - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png^epic_sound.png", - }, + tiles = epic.create_texture("action", "epic_sound.png"), paramtype2 = "facedir", groups = {cracky=3,oddly_breakable_by_hand=3,epic=1}, on_rotate = epic.on_rotate, diff --git a/blocks/random.lua b/blocks/random.lua index 743dfe8..0cdf5a0 100644 --- a/blocks/random.lua +++ b/blocks/random.lua @@ -13,14 +13,7 @@ end minetest.register_node("epic:random", { description = "Epic random block: succeeds randomly (for randomized branches in quests)", - tiles = { - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png^epic_question_mark.png", - }, + tiles = epic.create_texture("condition", "epic_question_mark.png"), paramtype2 = "facedir", groups = {cracky=3,oddly_breakable_by_hand=3,epic=1}, on_rotate = epic.on_rotate, diff --git a/blocks/remove_item.lua b/blocks/remove_item.lua index cffc533..590d8b2 100644 --- a/blocks/remove_item.lua +++ b/blocks/remove_item.lua @@ -35,14 +35,7 @@ end minetest.register_node("epic:removeitem", { description = "Epic remove item block: removes objects within the given radius", - tiles = { - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png^epic_remove.png", - }, + tiles = epic.create_texture("action", "epic_remove.png"), paramtype2 = "facedir", groups = {cracky=3,oddly_breakable_by_hand=3,epic=1}, on_rotate = epic.on_rotate, diff --git a/blocks/review.lua b/blocks/review.lua index f3115a8..1bea67b 100644 --- a/blocks/review.lua +++ b/blocks/review.lua @@ -96,14 +96,7 @@ local form_visited = {} -- review block minetest.register_node("epic:review", { description = "Epic review block: lets the player rate the quest", - tiles = { - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png^epic_star.png", - }, + tiles = epic.create_texture("condition", "epic_star.png"), paramtype2 = "facedir", groups = {cracky=3,oddly_breakable_by_hand=3,epic=1}, on_rotate = epic.on_rotate, diff --git a/blocks/save.lua b/blocks/save.lua index 362aee0..1306856 100644 --- a/blocks/save.lua +++ b/blocks/save.lua @@ -23,14 +23,7 @@ end minetest.register_node("epic:save", { description = "Epic save block: stores a savegame for the player, the target can be an epic-block " .. "to continue the quest at that point", - tiles = { - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png^epic_save.png", - }, + tiles = epic.create_texture("action", "epic_save.png"), paramtype2 = "facedir", groups = {cracky=3,oddly_breakable_by_hand=3,epic=1}, on_rotate = epic.on_rotate, diff --git a/blocks/send_mapblock.lua b/blocks/send_mapblock.lua index fc04580..eb1cc43 100644 --- a/blocks/send_mapblock.lua +++ b/blocks/send_mapblock.lua @@ -13,25 +13,18 @@ end minetest.register_node("epic:send_mapblock", { description = "Epic send_mapblock block: sends the target mapblock to the client", - tiles = { - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png^epic_anchor.png", - }, + tiles = epic.create_texture("action", "epic_anchor.png"), paramtype2 = "facedir", groups = {cracky=3,oddly_breakable_by_hand=3,epic=1}, on_rotate = epic.on_rotate, on_construct = function(pos) - local meta = minetest.get_meta(pos) + local meta = minetest.get_meta(pos) meta:set_string("pos", minetest.pos_to_string({x=0, y=0, z=0})) - update_formspec(meta, pos) - end, + update_formspec(meta, pos) + end, - on_receive_fields = function(pos, _, fields, sender) + on_receive_fields = function(pos, _, fields, sender) if not sender or minetest.is_protected(pos, sender:get_player_name()) then -- not allowed return diff --git a/blocks/set_clouds.lua b/blocks/set_clouds.lua index 44b5a4f..173f5f1 100644 --- a/blocks/set_clouds.lua +++ b/blocks/set_clouds.lua @@ -21,14 +21,7 @@ end minetest.register_node("epic:setclouds", { description = "Epic set clouds block: sets the clouds with the defined properties", - tiles = { - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png^epic_sky.png", - }, + tiles = epic.create_texture("action", "epic_sky.png"), paramtype2 = "facedir", groups = {cracky=3,oddly_breakable_by_hand=3,epic=1}, on_rotate = epic.on_rotate, diff --git a/blocks/set_day_night.lua b/blocks/set_day_night.lua index 24fadfd..b14cc7a 100644 --- a/blocks/set_day_night.lua +++ b/blocks/set_day_night.lua @@ -13,14 +13,7 @@ end minetest.register_node("epic:daynightratio", { description = "Epic day night ratio block: sets the day-night-ratio for the player", - tiles = { - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png^epic_sky.png", - }, + tiles = epic.create_texture("action", "epic_sky.png"), paramtype2 = "facedir", groups = {cracky=3,oddly_breakable_by_hand=3,epic=1}, on_rotate = epic.on_rotate, diff --git a/blocks/set_gravity.lua b/blocks/set_gravity.lua index c335ee2..9ae17ac 100644 --- a/blocks/set_gravity.lua +++ b/blocks/set_gravity.lua @@ -16,14 +16,7 @@ end minetest.register_node("epic:set_gravity", { description = "Epic set gravity block: sets the gravity for the player", - tiles = { - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png^epic_gravity.png", - }, + tiles = epic.create_texture("action", "epic_gravity.png"), paramtype2 = "facedir", groups = {cracky=3,oddly_breakable_by_hand=3,epic=1}, on_rotate = epic.on_rotate, diff --git a/blocks/set_node.lua b/blocks/set_node.lua index 7cd5d3e..e74cbec 100644 --- a/blocks/set_node.lua +++ b/blocks/set_node.lua @@ -38,14 +38,7 @@ end minetest.register_node("epic:setnode", { description = "Epic set node block: sets a single node at the defined position", - tiles = { - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png^epic_add_node.png", - }, + tiles = epic.create_texture("action", "epic_add_node.png"), paramtype2 = "facedir", groups = {cracky=3,oddly_breakable_by_hand=3,epic=1}, on_rotate = epic.on_rotate, diff --git a/blocks/set_param2.lua b/blocks/set_param2.lua index 0efd121..7db7ee7 100644 --- a/blocks/set_param2.lua +++ b/blocks/set_param2.lua @@ -28,14 +28,7 @@ end minetest.register_node("epic:set_param2", { description = "Epic set param2 block: Sets the param2 value on doors or other blocks", - tiles = { - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png^epic_filter.png", - }, + tiles = epic.create_texture("action", "epic_filter.png"), paramtype2 = "facedir", groups = {cracky=3,oddly_breakable_by_hand=3,epic=1}, on_rotate = epic.on_rotate, diff --git a/blocks/settimeout.lua b/blocks/settimeout.lua index 1ee282d..77deeef 100644 --- a/blocks/settimeout.lua +++ b/blocks/settimeout.lua @@ -13,14 +13,7 @@ end minetest.register_node("epic:settimeout", { description = "Epic set timeout block: configures the current quest timeout", - tiles = { - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png^epic_clock.png", - }, + tiles = epic.create_texture("action", "epic_clock.png"), paramtype2 = "facedir", groups = {cracky=3,oddly_breakable_by_hand=3,epic=1}, on_rotate = epic.on_rotate, diff --git a/blocks/spawn_mob.lua b/blocks/spawn_mob.lua index 3d9228f..0c122ab 100644 --- a/blocks/spawn_mob.lua +++ b/blocks/spawn_mob.lua @@ -75,14 +75,7 @@ end minetest.register_node("epic:spawn_mob", { description = "Epic Spawn mob block: spawns a mob at the given position", - tiles = { - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png^epic_mob.png", - }, + tiles = epic.create_texture("action", "epic_mob.png"), paramtype2 = "facedir", groups = {cracky=3,oddly_breakable_by_hand=3,epic=1}, on_rotate = epic.on_rotate, diff --git a/blocks/stash_inventory.lua b/blocks/stash_inventory.lua index f427d51..7e42ce9 100644 --- a/blocks/stash_inventory.lua +++ b/blocks/stash_inventory.lua @@ -13,14 +13,7 @@ end minetest.register_node("epic:stash_inv", { description = "Epic stash inventory block: moves the player inventory temporarily away from the player", - tiles = { - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png^epic_briefcase.png", - }, + tiles = epic.create_texture("action", "epic_briefcase.png"), paramtype2 = "facedir", groups = {cracky=3,oddly_breakable_by_hand=3,epic=1}, on_rotate = epic.on_rotate, diff --git a/blocks/stats.lua b/blocks/stats.lua index 3a2adc6..7f2082f 100644 --- a/blocks/stats.lua +++ b/blocks/stats.lua @@ -12,14 +12,7 @@ end minetest.register_node("epic:stats", { description = "Epic stats block: keeps track of the visited players", - tiles = { - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png^epic_stats.png", - }, + tiles = epic.create_texture("action", "epic_stats.png"), paramtype2 = "facedir", groups = {cracky=3,oddly_breakable_by_hand=3,epic=1}, on_rotate = epic.on_rotate, diff --git a/blocks/teleport.lua b/blocks/teleport.lua index 411d38c..877f5dc 100644 --- a/blocks/teleport.lua +++ b/blocks/teleport.lua @@ -16,14 +16,7 @@ end minetest.register_node("epic:teleport", { description = "Epic Teleport block: teleports the player to the given coordinates", - tiles = { - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png^epic_teleport.png", - }, + tiles = epic.create_texture("action", "epic_teleport.png"), paramtype2 = "facedir", groups = {cracky=3,oddly_breakable_by_hand=3,epic=1}, on_rotate = epic.on_rotate, diff --git a/blocks/teleport_relative.lua b/blocks/teleport_relative.lua index 20ffae3..3a5c2cb 100644 --- a/blocks/teleport_relative.lua +++ b/blocks/teleport_relative.lua @@ -27,14 +27,7 @@ end minetest.register_node("epic:teleport_relative", { description = "Epic Teleport relative block: teleports the player to the target coordinates " .. "with respect to the source-coordinates (smooth teleport)", - tiles = { - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png^epic_teleport.png", - }, + tiles = epic.create_texture("action", "epic_teleport.png"), paramtype2 = "facedir", groups = {cracky=3,oddly_breakable_by_hand=3,epic=1}, on_rotate = epic.on_rotate, diff --git a/blocks/unlock.lua b/blocks/unlock.lua index bc4d130..c4cac82 100644 --- a/blocks/unlock.lua +++ b/blocks/unlock.lua @@ -22,14 +22,7 @@ end minetest.register_node("epic:unlock", { description = "Epic unlock block: unlocks a previously locked path (mutex)", - tiles = { - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png^epic_unlock.png", - }, + tiles = epic.create_texture("action", "epic_unlock.png"), paramtype2 = "facedir", groups = {cracky=3,oddly_breakable_by_hand=3,epic=1}, on_rotate = epic.on_rotate, diff --git a/blocks/unstash_inventory.lua b/blocks/unstash_inventory.lua index cddd7aa..b191f6b 100644 --- a/blocks/unstash_inventory.lua +++ b/blocks/unstash_inventory.lua @@ -2,14 +2,7 @@ minetest.register_node("epic:unstash_inv", { description = "Epic unstash inventory block: moves the player inventory to the player again", - tiles = { - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png^epic_briefcase.png", - }, + tiles = epic.create_texture("action", "epic_briefcase.png"), paramtype2 = "facedir", groups = {cracky=3,oddly_breakable_by_hand=3,epic=1}, on_rotate = epic.on_rotate, diff --git a/blocks/waypoint.lua b/blocks/waypoint.lua index 780e62b..d6ce3ff 100644 --- a/blocks/waypoint.lua +++ b/blocks/waypoint.lua @@ -24,14 +24,7 @@ end minetest.register_node("epic:waypoint", { description = "Epic waypoint block: checks if the player is inside the defined radius", - tiles = { - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png^epic_waypoint.png", - }, + tiles = epic.create_texture("condition", "epic_waypoint.png"), paramtype2 = "facedir", groups = {cracky=3,oddly_breakable_by_hand=3,epic=1}, on_rotate = epic.on_rotate, diff --git a/blocks/waypoint_inverse.lua b/blocks/waypoint_inverse.lua index a4eff5f..1bec0a9 100644 --- a/blocks/waypoint_inverse.lua +++ b/blocks/waypoint_inverse.lua @@ -24,14 +24,7 @@ end minetest.register_node("epic:waypoint_inverse", { description = "Epic inverse waypoint block: checks if the player is outside of the defined radius", - tiles = { - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png", - "epic_node_bg.png^epic_waypoint.png", - }, + tiles = epic.create_texture("condition", "epic_waypoint.png"), paramtype2 = "facedir", groups = {cracky=3,oddly_breakable_by_hand=3,epic=1}, on_rotate = epic.on_rotate, diff --git a/common.lua b/common.lua index dde9536..cf70c9e 100644 --- a/common.lua +++ b/common.lua @@ -1,4 +1,23 @@ +function epic.create_texture(type, overlay) + local texture = "epic_node_bg.png" + + if type == "action" then + texture = "epic_node_action.png" + elseif type == "condition" then + texture = "epic_node_condition.png" + end + + return { + texture, + texture, + texture .. "^epic_next_marker.png", + texture, + texture, + texture .. "^" .. overlay, + } +end + -- local on_rotate function epic.on_rotate = function(...) screwdriver.rotate_simple(...) diff --git a/readme.md b/readme.md index 125ae78..feae171 100644 --- a/readme.md +++ b/readme.md @@ -103,7 +103,7 @@ This makes it possible to copy your creations in the same or across worlds with ## Assets -* default_steel_block.png / epic_node_bg.png / epic_mese_crystal.png +* epic_node_action.png / epic_node_bg.png / epic_mese_crystal.png / epic_node_condition.png * CC BY-SA 3.0 https://github.com/minetest/minetest_game * 16x16 Icons in `textures/*` diff --git a/textures/epic_next_marker.png b/textures/epic_next_marker.png new file mode 100644 index 0000000..1ec2cc6 Binary files /dev/null and b/textures/epic_next_marker.png differ diff --git a/textures/epic_node_action.png b/textures/epic_node_action.png new file mode 100644 index 0000000..5e421f0 Binary files /dev/null and b/textures/epic_node_action.png differ diff --git a/textures/epic_node_condition.png b/textures/epic_node_condition.png new file mode 100644 index 0000000..491fc78 Binary files /dev/null and b/textures/epic_node_condition.png differ