diff --git a/missionchest.lua b/chest.lua similarity index 91% rename from missionchest.lua rename to chest.lua index 2b19f4a..775c0e0 100644 --- a/missionchest.lua +++ b/chest.lua @@ -55,10 +55,10 @@ minetest.register_node("missions:missionchest", { tiles = { "default_chest_top.png", "default_chest_top.png", - "default_chest_side.png", - "default_chest_side.png", - "missionchest_front.png", - "default_chest_side.png" + "default_chest_side.png^missions_m_overlay.png", + "default_chest_side.png^missions_m_overlay.png", + "default_chest_front.png^missions_m_overlay.png", + "default_chest_side.png^missions_m_overlay.png" }, paramtype = "light", paramtype2 = "facedir", @@ -67,8 +67,6 @@ minetest.register_node("missions:missionchest", { sound_close = "default_chest_close", groups = {choppy = 2, oddly_breakable_by_hand = 2}, - drop = "missions:missionchest", - after_place_node = function(pos, placer) local meta = minetest.get_meta(pos) meta:set_string("owner", placer:get_player_name() or "") @@ -130,8 +128,9 @@ minetest.register_node("missions:missionchest", { on_receive_fields = function(pos, formname, fields, sender) local meta = minetest.get_meta(pos) + local owner = meta:get_string("owner") - if fields.save then + if fields.save and sender:get_player_name() == owner then meta:set_string("title", fields.title) end diff --git a/craft.lua b/craft.lua new file mode 100644 index 0000000..960f533 --- /dev/null +++ b/craft.lua @@ -0,0 +1,15 @@ + + +minetest.register_node("missions:craft", { + description = "Craft mission", + tiles = { + "default_gold_block.png", + "default_gold_block.png", + "default_gold_block.png^default_paper.png^missions_m_overlay.png", + "default_gold_block.png^default_paper.png^missions_m_overlay.png", + "default_gold_block.png^default_paper.png^missions_m_overlay.png", + "default_gold_block.png^default_paper.png^missions_m_overlay.png" + }, + groups = {cracky=3,oddly_breakable_by_hand=3}, + sounds = default.node_sound_glass_defaults() +}) \ No newline at end of file diff --git a/dig.lua b/dig.lua new file mode 100644 index 0000000..8a260b9 --- /dev/null +++ b/dig.lua @@ -0,0 +1,15 @@ + + +minetest.register_node("missions:dig", { + description = "Dig mission", + tiles = { + "default_gold_block.png", + "default_gold_block.png", + "default_gold_block.png^default_tool_steelpick.png^missions_m_overlay.png", + "default_gold_block.png^default_tool_steelpick.png^missions_m_overlay.png", + "default_gold_block.png^default_tool_steelpick.png^missions_m_overlay.png", + "default_gold_block.png^default_tool_steelpick.png^missions_m_overlay.png" + }, + groups = {cracky=3,oddly_breakable_by_hand=3}, + sounds = default.node_sound_glass_defaults() +}) \ No newline at end of file diff --git a/goto.lua b/goto.lua new file mode 100644 index 0000000..a79fcba --- /dev/null +++ b/goto.lua @@ -0,0 +1,15 @@ + + +minetest.register_node("missions:goto", { + description = "Goto mission", + tiles = { + "default_gold_block.png", + "default_gold_block.png", + "default_gold_block.png^default_obsidian_shard.png^missions_m_overlay.png", + "default_gold_block.png^default_obsidian_shard.png^missions_m_overlay.png", + "default_gold_block.png^default_obsidian_shard.png^missions_m_overlay.png", + "default_gold_block.png^default_obsidian_shard.png^missions_m_overlay.png" + }, + groups = {cracky=3,oddly_breakable_by_hand=3}, + sounds = default.node_sound_glass_defaults() +}) \ No newline at end of file diff --git a/init.lua b/init.lua index 7dfc0d9..193e5bc 100644 --- a/init.lua +++ b/init.lua @@ -7,7 +7,16 @@ missions = { dofile(MP.."/functions.lua") dofile(MP.."/hud.lua") -dofile(MP.."/missionblock.lua") -dofile(MP.."/missionchest.lua") + +-- mission blocks +dofile(MP.."/transport.lua") +dofile(MP.."/kill.lua") +dofile(MP.."/walk.lua") +dofile(MP.."/goto.lua") +dofile(MP.."/dig.lua") +dofile(MP.."/craft.lua") + +-- target chest +dofile(MP.."/chest.lua") print("[OK] Missions") diff --git a/kill.lua b/kill.lua new file mode 100644 index 0000000..a2c4186 --- /dev/null +++ b/kill.lua @@ -0,0 +1,15 @@ + + +minetest.register_node("missions:kill", { + description = "Kill mission", + tiles = { + "default_gold_block.png", + "default_gold_block.png", + "default_gold_block.png^default_tool_steelsword.png^missions_m_overlay.png", + "default_gold_block.png^default_tool_steelsword.png^missions_m_overlay.png", + "default_gold_block.png^default_tool_steelsword.png^missions_m_overlay.png", + "default_gold_block.png^default_tool_steelsword.png^missions_m_overlay.png" + }, + groups = {cracky=3,oddly_breakable_by_hand=3}, + sounds = default.node_sound_glass_defaults() +}) \ No newline at end of file diff --git a/notes.txt b/notes.txt new file mode 100644 index 0000000..bdb420d --- /dev/null +++ b/notes.txt @@ -0,0 +1,14 @@ +missions: + +- missions:transport (missions:chest) + +- missions:kill (on_punch) + +- missions:walk (global_step, distance) + +- missions:goto (global_step, destination) + +- missions:dig (on_dig) + +- missions:craft (on_craft) + diff --git a/textures/missionblock.png b/textures/missionblock.png deleted file mode 100644 index 9ccd988..0000000 Binary files a/textures/missionblock.png and /dev/null differ diff --git a/textures/missionchest_front.png b/textures/missionchest_front.png deleted file mode 100644 index 4d2a573..0000000 Binary files a/textures/missionchest_front.png and /dev/null differ diff --git a/textures/missionchest_front_overlay.png b/textures/missions_m_overlay.png similarity index 100% rename from textures/missionchest_front_overlay.png rename to textures/missions_m_overlay.png diff --git a/missionblock.lua b/transport.lua similarity index 93% rename from missionblock.lua rename to transport.lua index ce1fc8d..31cd21a 100644 --- a/missionblock.lua +++ b/transport.lua @@ -52,11 +52,17 @@ local update_formspec = function(meta) end -minetest.register_node("missions:missionblock", { - description = "Mission block", - tiles = {"missionblock.png"}, +minetest.register_node("missions:transport", { + description = "Transport mission", + tiles = { + "default_gold_block.png", + "default_gold_block.png", + "default_gold_block.png^default_steel_ingot.png^missions_m_overlay.png", + "default_gold_block.png^default_steel_ingot.png^missions_m_overlay.png", + "default_gold_block.png^default_steel_ingot.png^missions_m_overlay.png", + "default_gold_block.png^default_steel_ingot.png^missions_m_overlay.png" + }, groups = {cracky=3,oddly_breakable_by_hand=3}, - drop = "missions:missionblock", sounds = default.node_sound_glass_defaults(), after_place_node = function(pos, placer) diff --git a/walk.lua b/walk.lua new file mode 100644 index 0000000..0127214 --- /dev/null +++ b/walk.lua @@ -0,0 +1,15 @@ + + +minetest.register_node("missions:walk", { + description = "Walk mission", + tiles = { + "default_gold_block.png", + "default_gold_block.png", + "default_gold_block.png^default_stick.png^missions_m_overlay.png", + "default_gold_block.png^default_stick.png^missions_m_overlay.png", + "default_gold_block.png^default_stick.png^missions_m_overlay.png", + "default_gold_block.png^default_stick.png^missions_m_overlay.png" + }, + groups = {cracky=3,oddly_breakable_by_hand=3}, + sounds = default.node_sound_glass_defaults() +}) \ No newline at end of file