From df37d66c582601d73b1064d6e5660ff400fbd3ef Mon Sep 17 00:00:00 2001 From: Thomas Rudin Date: Wed, 16 May 2018 14:10:45 +0200 Subject: [PATCH] texture rework / mission block stubs --- missionchest.lua => chest.lua | 13 ++++++------- craft.lua | 15 +++++++++++++++ dig.lua | 15 +++++++++++++++ goto.lua | 15 +++++++++++++++ init.lua | 13 +++++++++++-- kill.lua | 15 +++++++++++++++ notes.txt | 14 ++++++++++++++ textures/missionblock.png | Bin 290 -> 0 bytes textures/missionchest_front.png | Bin 482 -> 0 bytes ..._front_overlay.png => missions_m_overlay.png} | Bin missionblock.lua => transport.lua | 14 ++++++++++---- walk.lua | 15 +++++++++++++++ 12 files changed, 116 insertions(+), 13 deletions(-) rename missionchest.lua => chest.lua (91%) create mode 100644 craft.lua create mode 100644 dig.lua create mode 100644 goto.lua create mode 100644 kill.lua create mode 100644 notes.txt delete mode 100644 textures/missionblock.png delete mode 100644 textures/missionchest_front.png rename textures/{missionchest_front_overlay.png => missions_m_overlay.png} (100%) rename missionblock.lua => transport.lua (93%) create mode 100644 walk.lua 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 9ccd988e6964724770ff97ce6c7f13742b4b84b8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 290 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={W*pj^6T^Rm@;DWu&Cj&(|3p^r= z85sBugD~Uq{1qucLG}_)Usv`=tn94X$^x5T3IK)Hd%8G=cpOhIDJV!tOG{JW{`2?u z^aWC4Y;0`N(a~(T8kpJn3>@D+6kM|IVgd6)u|GdQ&D$k*fHx&+f#HIktU5ECxWx4) z-jIX7>ULfjl5`2{mwdoHT53*HHMesQ5eg!0TuQIj{YKDj#mu-&Bgg3A*x f9z58%%#nrRLWsFx%T+Uw7a2TV{an^LB{Ts5lsafQ diff --git a/textures/missionchest_front.png b/textures/missionchest_front.png deleted file mode 100644 index 4d2a5733cc535814d9ee37f13efab81053b74089..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 482 zcmV<80UiE{P)i&K4LJ(h4fd|)}Lf=h&H zLXT)Oby_pmu656)Y`~XZu7*#Kb4!G4MT>1goOVBpWiV}2FKSRK-QC@|u%qC!dc~Y& zzLs61d_{+CM1p2Nz__cUqocE{p6j=Mc6N54fmoDxPm^{|mw8KwZcBJ!K5tn$lWaGU zYBh#mEPz=jWJ@J{RU=tkP^|y}00Cl4M??UK1szBL000SaNLh0L01FcU01FcV0GgZ_ z00007bV*G`2jT?>1|A~E!=-5e006p4L_t&-({0Yl5`r)g1ked2frLQ9CJ3@9i@TP) z{{N3ToVAayrg|FSC$}ImMoMXdbx~Xpf+2JqKUclSc{fK$2HRtdr|D|7X9Yr}LO1j+ z%Ob?p4g5)x(3;YBQ_ET!iEw7zySBt%MvihQ0$mU_E)Uyw&SvQm!C+rl?l#bS9ZYZ6 z$|o)