New release : best screens and electric components

This commit is contained in:
jimy-byerley 2015-04-26 09:16:19 +02:00
parent 70966d8c6b
commit 6d02daf9b3
20 changed files with 140 additions and 159 deletions

View File

@ -6,17 +6,9 @@ A minetest mod which provide some hi-tech stuff : flat screen, bronze structures
Install
=======
<<<<<<< HEAD
As other minetest mod : extract the zip file as "technology" in the `games/minetest_game/mods` directory.
=======
As other minetest mod : extract the zip file as "technology" in the games/minetest_game/mods directory.
>>>>>>> 23adb05612beee25e86052d11f6d5084ec06d3aa
Other
=====
<<<<<<< HEAD
See documentation.txt to learn more (about crafting for exemple).
=======
See documentation.txt to learn more (about crafting for exemple).
>>>>>>> 23adb05612beee25e86052d11f6d5084ec06d3aa
See documentation.txt to learn more (about crafting for exemple).

View File

@ -1,4 +1,3 @@
default
moreores
mesecons
farming
mesecons

View File

@ -1,6 +1,6 @@
This mod add computers and screen to minetest
made by jimy byerley jimy.byerley@gmail.com
License is GNU GPL v2
License is GNU GPL v2, do it what you want !
==[ crafting ]==========================================

View File

@ -8,6 +8,16 @@ minetest.register_craft({
}
})
minetest.register_craft({
output = 'mesecons_extrawires:vertical_off',
recipe = {{'mesecons:mesecon'}}
})
minetest.register_craft({
output = 'mesecons:mesecon',
recipe = {{'mesecons_extrawires:vertical_off'}}
})
minetest.register_craft({
output = 'technology:resistor 2',
recipe = {
@ -51,7 +61,7 @@ minetest.register_craft({
})
minetest.register_craft({
output = 'technology:small_lamp 5',
output = 'technology:lamp_small 5',
recipe = {
{'glass:bottle_empty'},
{'default:steel_ingot'},
@ -128,14 +138,14 @@ minetest.register_node("technology:12V_battery", {
tiles = {"battery_top.png", "battery_top.png", "battery_side.png", "battery_side.png", "battery_side.png", "battery_back.png"},
walkable = true,
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,pinch=1,generator=1},
electric = {generated = 12},
electric = {generated = 12.5},
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
meta:set_string("infotext", "\"12V DC BATTERY\"")
meta:set_string("infotext", "\"12.5V DC BATTERY\"")
end,
})
minetest.register_node("technology:small_lamp", {
minetest.register_node("technology:lamp_small", {
description = "Electric lamp small",
drawtype = "torchlike",
tiles = {"lamp_small_floor.png", "lamp_small_ceiling.png", "lamp_small.png"},
@ -162,14 +172,14 @@ minetest.register_node("technology:small_lamp", {
minetest.env:set_node(pos, {name="fire:basic_flame"})
else
local node = minetest.env:get_node(pos)
node.name = "technology:small_lamp_on"
node.name = "technology:lamp_small_on"
minetest.env:set_node(pos, node)
end
end,
}
})
minetest.register_node("technology:small_lamp_on", {
minetest.register_node("technology:lamp_small_on", {
description = "Electric lamp small",
drawtype = "torchlike",
tiles = {"lamp_small_on_floor.png", "lamp_small_on_ceiling.png", "lamp_small_on.png"},
@ -187,13 +197,13 @@ minetest.register_node("technology:small_lamp_on", {
wall_side = {-0.5, -0.3, -0.1, -0.5+0.3, 0.3, 0.1},
},
legacy_wallmounted = true,
drop = "technology:small_lamp",
drop = "technology:lamp_small",
groups = {choppy=2,dig_immediate=3,flammable=1,attached_node=1,electric=1},
electric = {
action = function(pos, energy)
if energy < 10 then
local node = minetest.env:get_node(pos)
node.name = "technology:small_lamp"
node.name = "technology:lamp_small"
minetest.env:set_node(pos, node)
elseif energy > 80 then
minetest.env:set_node(pos, {name="fire:basic_flame"})

View File

@ -25,5 +25,3 @@ dofile(minetest.get_modpath("technology").."/electric_nodes.lua")
dofile(minetest.get_modpath("technology").."/aircraft.lua")
dofile(minetest.get_modpath("technology").."/screen.lua")

View File

@ -1,4 +1,10 @@
local screens = {
"technology:flat_screen_on",
"technology:flat_screen_text",
"technology:flat_screen_compiling",
}
-- crafting
minetest.register_craft({
@ -14,7 +20,6 @@ minetest.register_craft({
minetest.register_node("technology:flat_screen_off", {
description = "modern screen",
stack_max = 1,
node_placement_prediction = "",
paramtype = "light",
paramtype2 = "facedir",
@ -33,15 +38,15 @@ minetest.register_node("technology:flat_screen_off", {
groups = {choppy=2, dig_immediate=2},
on_punch = function(pos, node, puncher)
local node = minetest.env:get_node(pos)
node.name = "technology:flat_screen_smalltext"
minetest.env:set_node(pos, node)
--node.name = "technology:flat_screen_on"
node.name = screens[math.random(1,#screens)]
minetest.set_node(pos, node)
end,
drop = 'technology:flat_screen_off',
})
minetest.register_node("technology:flat_screen_smalltext", {
minetest.register_node("technology:flat_screen_on", {
description = "modern screen",
stack_max = 1,
node_placement_prediction = "",
paramtype = "light",
light_source = 3,
@ -56,140 +61,110 @@ minetest.register_node("technology:flat_screen_smalltext", {
{-0.35, -0.35, 0.3, 0.35, 0.25, 0.4},
}},
tiles = {"screen_flat_top.png", "screen_flat_bottom.png", "screen_flat_left.png",
"screen_flat_right.png", "screen_flat_back.png", "screen_flat_front_smalltext.png"},
"screen_flat_right.png", "screen_flat_back.png", {
image="screen_flat_animated_cursor_blink.png",
backface_culling=false,
animation={type="vertical_frames", aspect_w=128, aspect_h=128, length=4.6}
}},
walkable = true,
groups = {choppy=2, dig_immediate=2},
on_punch = function(pos, node, puncher)
node.name = "technology:flat_screen_off"
minetest.env:set_node(pos, node)
minetest.set_node(pos, node)
end,
drop = 'technology:flat_screen_off',
})
minetest.register_node("technology:flat_screen_bigtext", {
description = "modern screen",
stack_max = 1,
node_placement_prediction = "",
paramtype = "light",
light_source = 5,
paramtype2 = "facedir",
drawtype = "nodebox",
node_box = {type = "fixed", fixed = {
{-0.45, -0.4, 0.3, 0.45, 0.3, 0.25},
{-0.35, -0.35, 0.3, 0.35, 0.25, 0.4},
}},
selection_box = {type = "fixed", fixed = {
{-0.45, -0.4, 0.3, 0.45, 0.3, 0.25},
{-0.35, -0.35, 0.3, 0.35, 0.25, 0.4},
}},
tiles = {"screen_flat_top.png", "screen_flat_bottom.png", "screen_flat_left.png",
"screen_flat_right.png", "screen_flat_back.png", "screen_flat_front_bigtext.png"},
walkable = true,
groups = {choppy=2, dig_immediate=2},
on_punch = function(pos, node, puncher)
node.name = "technology:flat_screen_off"
minetest.env:set_node(pos, node)
end,
minetest.register_node("technology:flat_screen_text", {
description = "modern screen",
node_placement_prediction = "",
paramtype = "light",
light_source = 3,
paramtype2 = "facedir",
drawtype = "nodebox",
node_box = {type = "fixed", fixed = {
{-0.45, -0.4, 0.3, 0.45, 0.3, 0.25},
{-0.35, -0.35, 0.3, 0.35, 0.25, 0.4},
}},
selection_box = {type = "fixed", fixed = {
{-0.45, -0.4, 0.3, 0.45, 0.3, 0.25},
{-0.35, -0.35, 0.3, 0.35, 0.25, 0.4},
}},
tiles = {"screen_flat_top.png", "screen_flat_bottom.png", "screen_flat_left.png",
"screen_flat_right.png", "screen_flat_back.png", {
image="screen_flat_animated_text.png",
backface_culling=false,
animation={type="vertical_frames", aspect_w=128, aspect_h=128, length=4.6}
}},
walkable = true,
groups = {choppy=2, dig_immediate=2},
on_punch = function(pos, node, puncher)
node.name = "technology:flat_screen_off"
minetest.set_node(pos, node)
end,
drop = 'technology:flat_screen_off',
})
minetest.register_node("technology:flat_screen_2columns", {
description = "modern screen",
stack_max = 1,
node_placement_prediction = "",
paramtype = "light",
light_source = 4,
paramtype2 = "facedir",
drawtype = "nodebox",
node_box = {type = "fixed", fixed = {
{-0.45, -0.4, 0.3, 0.45, 0.3, 0.25},
{-0.35, -0.35, 0.3, 0.35, 0.25, 0.4},
}},
selection_box = {type = "fixed", fixed = {
{-0.45, -0.4, 0.3, 0.45, 0.3, 0.25},
{-0.35, -0.35, 0.3, 0.35, 0.25, 0.4},
}},
tiles = {"screen_flat_top.png", "screen_flat_bottom.png", "screen_flat_left.png",
"screen_flat_right.png", "screen_flat_back.png", "screen_flat_front_2columns.png"},
walkable = true,
groups = {choppy=2, dig_immediate=2},
on_punch = function(pos, node, puncher)
node.name = "technology:flat_screen_off"
minetest.env:set_node(pos, node)
end,
minetest.register_node("technology:flat_screen_compiling", {
description = "modern screen",
node_placement_prediction = "",
paramtype = "light",
light_source = 3,
paramtype2 = "facedir",
drawtype = "nodebox",
node_box = {type = "fixed", fixed = {
{-0.45, -0.4, 0.3, 0.45, 0.3, 0.25},
{-0.35, -0.35, 0.3, 0.35, 0.25, 0.4},
}},
selection_box = {type = "fixed", fixed = {
{-0.45, -0.4, 0.3, 0.45, 0.3, 0.25},
{-0.35, -0.35, 0.3, 0.35, 0.25, 0.4},
}},
tiles = {"screen_flat_top.png", "screen_flat_bottom.png", "screen_flat_left.png",
"screen_flat_right.png", "screen_flat_back.png", {
image="screen_flat_animated_compiling.png",
backface_culling=false,
animation={type="vertical_frames", aspect_w=128, aspect_h=128, length=4.6}
}},
walkable = true,
groups = {choppy=2, dig_immediate=2},
on_punch = function(pos, node, puncher)
node.name = "technology:flat_screen_off"
minetest.set_node(pos, node)
end,
drop = 'technology:flat_screen_off',
})
minetest.register_node("technology:flat_screen_map", {
description = "modern screen",
stack_max = 1,
node_placement_prediction = "",
paramtype = "light",
light_source = 6,
paramtype2 = "facedir",
drawtype = "nodebox",
node_box = {type = "fixed", fixed = {
{-0.45, -0.4, 0.3, 0.45, 0.3, 0.25},
{-0.35, -0.35, 0.3, 0.35, 0.25, 0.4},
}},
selection_box = {type = "fixed", fixed = {
{-0.45, -0.4, 0.3, 0.45, 0.3, 0.25},
{-0.35, -0.35, 0.3, 0.35, 0.25, 0.4},
}},
tiles = {"screen_flat_top.png", "screen_flat_bottom.png", "screen_flat_left.png",
"screen_flat_right.png", "screen_flat_back.png", "screen_flat_front_map.png"},
walkable = true,
groups = {choppy=2, dig_immediate=2},
on_punch = function(pos, node, puncher)
node.name = "technology:flat_screen_off"
minetest.env:set_node(pos, node)
end,
drop = 'technology:flat_screen_off',
})
minetest.register_node("technology:flat_screen_screensaver", {
description = "modern screen",
stack_max = 1,
node_placement_prediction = "",
paramtype = "light",
light_source = 4,
paramtype2 = "facedir",
drawtype = "nodebox",
node_box = {type = "fixed", fixed = {
{-0.45, -0.4, 0.3, 0.45, 0.3, 0.25},
{-0.35, -0.35, 0.3, 0.35, 0.25, 0.4},
}},
selection_box = {type = "fixed", fixed = {
{-0.45, -0.4, 0.3, 0.45, 0.3, 0.25},
{-0.35, -0.35, 0.3, 0.35, 0.25, 0.4},
}},
tiles = {"screen_flat_top.png", "screen_flat_bottom.png", "screen_flat_left.png",
"screen_flat_right.png", "screen_flat_back.png", "screen_flat_front_cybertronic.png"},
walkable = true,
groups = {choppy=2, dig_immediate=2},
on_punch = function(pos, node, puncher)
node.name = "technology:flat_screen_off"
minetest.env:set_node(pos, node)
end,
drop = 'technology:flat_screen_off',
})
local screens = {"technology:flat_screen_smalltext",
local old_screens = {"technology:flat_screen_smalltext",
"technology:flat_screen_bigtext", "technology:flat_screen_2columns", "technology:flat_screen_map",
"technology:flat_screen_screensaver"}
minetest.register_abm({
nodenames = screens,
nodenames = old_screens,
interval = 1,
chance = 2,
action = function(pos, node, _, _)
if math.random(1,2) == 1 then return end
local newname = screens[math.random(1,5)]
local node = minetest.env:get_node(pos)
node.name = newname
minetest.env:set_node(pos, node)
local new_name = screens[math.random(1,#screens)]
node.name = new_name
minetest.add_node(pos, node)
end,
})
--[[
minetest.register_abm({
nodenames = screens,
interval = 2,
chance = 2,
action = function(pos, node, _, _)
if math.random(1,2) == 1 then return end
local new_name = screens[math.random(1,#screens)]
node.name = new_name
minetest.set_node(pos, node)
end,
})
]]
minetest.register_alias("technology:flat_screen", "technology:flat_screen_off")

BIN
sounds/cps-vflSymP2Q.swf Executable file

Binary file not shown.

View File

@ -59,6 +59,14 @@ minetest.register_node("technology:concrete", {
})
local metal_punch = function(pos, puncher)
local table = {
name = "metal_footstep",
gain = 1.0,
max_hear_distance = 200,
loop = false,
pos = pos
}
minetest.sound_play(table.name, table)
end
local metal_footstep = {
@ -85,9 +93,9 @@ minetest.register_node("technology:armature_h", {
}},
tiles = {"steel_armature_top.png", "steel_armature_top.png", "steel_armature_top.png", "steel_armature_top.png", "steel_armature_h_side.png", "steel_armature_h_side.png"},
walkable = true,
groups = {mechanic=1},
groups = {mecanic=1},
on_punch = metal_punch,
sounds = metal_footstep,
sound = "metal_footstep",
})
minetest.register_node("technology:armature_v", {
@ -109,9 +117,9 @@ minetest.register_node("technology:armature_v", {
}},
tiles = {"steel_armature_top.png", "steel_armature_top.png", "steel_armature_top.png", "steel_armature_top.png", "steel_armature_v_side.png", "steel_armature_v_side.png"},
walkable = true,
groups = {mechanic=1},
groups = {mecanic=1},
on_punch = metal_punch,
sounds = metal_footstep,
sound = "metal_footstep",
})
minetest.register_node("technology:grid_v", {
@ -133,8 +141,8 @@ minetest.register_node("technology:grid_v", {
tiles = {"bronze_grid_side.png", "bronze_grid_side.png", "bronze_grid_side.png", "bronze_grid_side.png", "bronze_grid_front.png", "steel_grid_front.png"},
walkable = true,
groups = {paffy=2},
on_punch = metal_punch,
sounds = metal_footstep,
sound = "metal_footstep",
})
minetest.register_node("technology:grid_h", {
@ -156,8 +164,8 @@ minetest.register_node("technology:grid_h", {
tiles = {"bronze_grid_side.png", "bronze_grid_front.png", "bronze_grid_side.png", "bronze_grid_front.png", "bronze_grid_side.png", "steel_grid_side.png"},
walkable = true,
groups = {paffy=2},
on_punch = metal_punch,
sounds = metal_footstep,
sound = "metal_footstep",
})
minetest.register_craft({
@ -235,9 +243,9 @@ minetest.register_node("technology:floor", {
}},
tiles = {"floor_top.png", "floor_bottom.png", "floor_side.png", "floor_side.png", "floor_side.png", "floor_side.png"},
walkable = true,
groups = {paffly=2, mechanic=1},
groups = {paffly=2, mecanic=1},
on_punch = metal_punch,
sounds = metal_footstep,
sound = "metal_footstep",
})
minetest.register_craft({
@ -262,14 +270,13 @@ minetest.register_node("technology:stairs", {
{-0.5, -0.1, 0, 0.5, 0.02, 0.5},
}},
selection_box = {type = "fixed", fixed = {
{-0.5, -0.5, -0.5, 0.5, -0.38, 0},
{-0.5, -0.1, 0, 0.5, 0.02, 0.5},
{-0.5, 0, -0.5, 0.5, 0.5, 0.5},
}},
tiles = {"floor_top.png", "floor_bottom.png", "floor_side.png", "floor_side.png", "floor_side.png", "floor_side.png"},
walkable = true,
groups = {paffly=2, mechanic=1},
groups = {paffly=2, mecanic=1},
on_punch = metal_punch,
sounds = metal_footstep,
sound = "metal_footstep",
})
minetest.register_node("technology:edge", {
@ -289,9 +296,9 @@ minetest.register_node("technology:edge", {
}},
tiles = {"edge_side.png", "edge_side.png", "edge_side.png", "edge_side.png", "edge_side.png", "edge_side.png"},
walkable = true,
groups = {paffly=2, mechanic=1},
groups = {paffly=2, mecanic=1},
on_punch = metal_punch,
sounds = metal_footstep,
sound = "metal_footstep",
})
minetest.register_node("technology:edge_angle", {
@ -315,9 +322,9 @@ minetest.register_node("technology:edge_angle", {
}},
tiles = {"edge_side.png", "edge_side.png", "edge_side.png", "edge_side.png", "edge_side.png", "edge_side.png"},
walkable = true,
groups = {paffly=2, mechanic=1},
groups = {paffly=2, mecanic=1},
on_punch = metal_punch,
sounds = metal_footstep,
sound = "metal_footstep",
drop = "technology:edge",
})
@ -337,9 +344,9 @@ minetest.register_node("technology:triangle", {
}},
tiles = {"triangle_side.png", "triangle_side.png", "triangle_right.png", "triangle_left.png", "triangle_side.png", "triangle_side.png"},
walkable = true,
groups = {paffly=2, mechanic=1},
groups = {paffly=2, mecanic=1},
on_punch = metal_punch,
sounds = metal_footstep,
sound = "metal_footstep",
})
@ -372,9 +379,9 @@ minetest.register_node("technology:ladder", {
tiles = {"technology_ladder.png", "technology_ladder.png", "technology_ladder.png", "technology_ladder.png", "technology_ladder.png", "technology_ladder.png"},
walkable = true,
climbable = true,
groups = {paffly=2, mechanic=1},
groups = {paffly=2, mecanic=1},
on_punch = metal_punch,
sounds = metal_footstep,
sound = "metal_footstep",
})
@ -415,8 +422,8 @@ minetest.register_node("technology:ladder_closed", {
tiles = {"technology_ladder.png", "technology_ladder.png", "technology_ladder.png", "technology_ladder.png", "technology_ladder.png", "technology_ladder.png"},
walkable = true,
climbable = true,
groups = {paffly=2, mechanic=1},
groups = {paffly=2, mecanic=1},
on_punch = metal_punch,
sounds = metal_footstep,
sound = "metal_footstep",
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 909 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

View File

@ -14,7 +14,7 @@ minetest.register_tool("technology:wrench", {
tool_capabilities = {
max_drop_level=1,
groupcaps={
mechanic={times={[1]=1.00, [2]=2.60, [3]=4.00}, uses=0, maxlevel=3},
mecanic={times={[1]=1.00, [2]=2.60, [3]=4.00}, uses=0, maxlevel=3},
}
},
})