texture rework / mission block stubs

This commit is contained in:
Thomas Rudin 2018-05-16 14:10:45 +02:00
parent a21d6e2afd
commit df37d66c58
12 changed files with 116 additions and 13 deletions

View File

@ -55,10 +55,10 @@ minetest.register_node("missions:missionchest", {
tiles = { tiles = {
"default_chest_top.png", "default_chest_top.png",
"default_chest_top.png", "default_chest_top.png",
"default_chest_side.png", "default_chest_side.png^missions_m_overlay.png",
"default_chest_side.png", "default_chest_side.png^missions_m_overlay.png",
"missionchest_front.png", "default_chest_front.png^missions_m_overlay.png",
"default_chest_side.png" "default_chest_side.png^missions_m_overlay.png"
}, },
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
@ -67,8 +67,6 @@ minetest.register_node("missions:missionchest", {
sound_close = "default_chest_close", sound_close = "default_chest_close",
groups = {choppy = 2, oddly_breakable_by_hand = 2}, groups = {choppy = 2, oddly_breakable_by_hand = 2},
drop = "missions:missionchest",
after_place_node = function(pos, placer) after_place_node = function(pos, placer)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
meta:set_string("owner", placer:get_player_name() or "") 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) on_receive_fields = function(pos, formname, fields, sender)
local meta = minetest.get_meta(pos) 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) meta:set_string("title", fields.title)
end end

15
craft.lua Normal file
View File

@ -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()
})

15
dig.lua Normal file
View File

@ -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()
})

15
goto.lua Normal file
View File

@ -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()
})

View File

@ -7,7 +7,16 @@ missions = {
dofile(MP.."/functions.lua") dofile(MP.."/functions.lua")
dofile(MP.."/hud.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") print("[OK] Missions")

15
kill.lua Normal file
View File

@ -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()
})

14
notes.txt Normal file
View File

@ -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)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 290 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 482 B

View File

Before

Width:  |  Height:  |  Size: 232 B

After

Width:  |  Height:  |  Size: 232 B

View File

@ -52,11 +52,17 @@ local update_formspec = function(meta)
end end
minetest.register_node("missions:missionblock", { minetest.register_node("missions:transport", {
description = "Mission block", description = "Transport mission",
tiles = {"missionblock.png"}, 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}, groups = {cracky=3,oddly_breakable_by_hand=3},
drop = "missions:missionblock",
sounds = default.node_sound_glass_defaults(), sounds = default.node_sound_glass_defaults(),
after_place_node = function(pos, placer) after_place_node = function(pos, placer)

15
walk.lua Normal file
View File

@ -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()
})