commit ca08a926c1d02e40d8c68b17b0008f82103f8790 Author: Irremann Date: Mon Feb 24 00:21:24 2020 +0300 initial commit diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..3bbb7ee --- /dev/null +++ b/README.txt @@ -0,0 +1 @@ +Ufo wreck mod by Irremann \ No newline at end of file diff --git a/depends.txt b/depends.txt new file mode 100644 index 0000000..1b1b8d4 --- /dev/null +++ b/depends.txt @@ -0,0 +1,2 @@ +default +technic \ No newline at end of file diff --git a/engine.lua b/engine.lua new file mode 100644 index 0000000..f153d86 --- /dev/null +++ b/engine.lua @@ -0,0 +1,210 @@ +minetest.register_node("ufowreck:alien_engine", { + description = "Alien Engine", + sunlight_propagates = false, + tiles = { + "scifi_nodes_lighttop.png", + "scifi_nodes_lighttop.png", + {name="scifi_nodes_black_screen.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2.00},}, + {name="scifi_nodes_black_screen.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2.00},}, + {name="scifi_nodes_black_screen.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2.00},}, + {name="scifi_nodes_black_screen.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2.00},} + }, + light_source = 10, + paramtype = "light", + groups = {cracky=2, technic_machine = 1, technic_hv = 1}, + sounds = default.node_sound_metal_defaults(), + connect_sides = {"top", "bottom"}, + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("infotext", "Alien Engine") + meta:set_int("HV_EU_supply", 5000) + end, +}) + +technic.register_machine("HV", "ufowreck:alien_engine", technic.producer) + + +minetest.register_node("ufowreck:alien_health_charger0", { + description = "Alien Charger", + tiles = { + "scifi_nodes_lighttop.png", + "scifi_nodes_lighttop.png", + "scifi_nodes_lighttop.png", + "scifi_nodes_lighttop.png", + "scifi_nodes_lighttop.png", + "healthcharger_front.png^technic_power_meter0.png" + }, + light_source = 5, + groups = {cracky=2, technic_machine = 1, technic_hv = 1}, + connect_sides = {"top", "bottom", "back", "left", "right"}, + paramtype2 = "facedir", + sounds = default.node_sound_metal_defaults(), + drop = "ufowreck:alien_health_charger0", + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("infotext", "Alien Charger") + meta:set_int("HV_EU_demand", 5000) + minetest.get_node_timer(pos):start(20) + end, + on_timer = function(pos) + local meta = minetest.get_meta(pos) + local eu_input = meta:get_int("HV_EU_input") + if eu_input >= 5000 then + local node = minetest.get_node(pos) + minetest.set_node(pos, {name = "ufowreck:alien_health_charger2", param2=node.param2,}) + end + end, +}) + +minetest.register_node("ufowreck:alien_health_charger2", { + description = "Alien Charger", + tiles = { + "scifi_nodes_lighttop.png", + "scifi_nodes_lighttop.png", + "scifi_nodes_lighttop.png", + "scifi_nodes_lighttop.png", + "scifi_nodes_lighttop.png", + "healthcharger_front.png^technic_power_meter2.png" + }, + light_source = 5, + groups = {cracky=2, technic_machine = 1, technic_hv = 1}, + connect_sides = {"top", "bottom", "back", "left", "right"}, + paramtype2 = "facedir", + sounds = default.node_sound_metal_defaults(), + drop = "ufowreck:alien_health_charger0", + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("infotext", "Alien Charger") + meta:set_int("HV_EU_demand", 5000) + minetest.get_node_timer(pos):start(20) + end, + on_rightclick = function(pos, node, player, itemstack, pointed_thing) + if player:get_hp() < 20 then + player:set_hp(player:get_hp() + 10) + node.name = "ufowreck:alien_health_charger0" + minetest.set_node(pos,node) + end + end, + on_timer = function(pos) + local meta = minetest.get_meta(pos) + local eu_input = meta:get_int("HV_EU_input") + if eu_input >= 5000 then + local node = minetest.get_node(pos) + minetest.set_node(pos, {name = "ufowreck:alien_health_charger4", param2=node.param2,}) + end + end, +}) + +minetest.register_node("ufowreck:alien_health_charger4", { + description = "Alien Charger", + tiles = { + "scifi_nodes_lighttop.png", + "scifi_nodes_lighttop.png", + "scifi_nodes_lighttop.png", + "scifi_nodes_lighttop.png", + "scifi_nodes_lighttop.png", + "healthcharger_front.png^technic_power_meter4.png" + }, + light_source = 5, + groups = {cracky=2, technic_machine = 1, technic_hv = 1}, + connect_sides = {"top", "bottom", "back", "left", "right"}, + paramtype2 = "facedir", + sounds = default.node_sound_metal_defaults(), + drop = "ufowreck:alien_health_charger0", + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("infotext", "Alien Charger") + meta:set_int("HV_EU_demand", 5000) + minetest.get_node_timer(pos):start(20) + end, + on_rightclick = function(pos, node, player, itemstack, pointed_thing) + if player:get_hp() < 20 then + player:set_hp(player:get_hp() + 10) + node.name = "ufowreck:alien_health_charger2" + minetest.set_node(pos,node) + end + end, + on_timer = function(pos) + local meta = minetest.get_meta(pos) + local eu_input = meta:get_int("HV_EU_input") + if eu_input >= 5000 then + local node = minetest.get_node(pos) + minetest.set_node(pos, {name = "ufowreck:alien_health_charger6", param2=node.param2,}) + end + end, +}) + +minetest.register_node("ufowreck:alien_health_charger6", { + description = "Alien Charger", + tiles = { + "scifi_nodes_lighttop.png", + "scifi_nodes_lighttop.png", + "scifi_nodes_lighttop.png", + "scifi_nodes_lighttop.png", + "scifi_nodes_lighttop.png", + "healthcharger_front.png^technic_power_meter6.png" + }, + light_source = 5, + groups = {cracky=2, technic_machine = 1, technic_hv = 1}, + connect_sides = {"top", "bottom", "back", "left", "right"}, + paramtype2 = "facedir", + sounds = default.node_sound_metal_defaults(), + drop = "ufowreck:alien_health_charger0", + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("infotext", "Alien Charger") + meta:set_int("HV_EU_demand", 5000) + minetest.get_node_timer(pos):start(20) + end, + on_rightclick = function(pos, node, player, itemstack, pointed_thing) + if player:get_hp() < 20 then + player:set_hp(player:get_hp() + 10) + node.name = "ufowreck:alien_health_charger4" + minetest.set_node(pos,node) + end + end, + on_timer = function(pos) + local meta = minetest.get_meta(pos) + local eu_input = meta:get_int("HV_EU_input") + if eu_input >= 5000 then + local node = minetest.get_node(pos) + minetest.set_node(pos, {name = "ufowreck:alien_health_charger8", param2=node.param2,}) + end + end, +}) + +minetest.register_node("ufowreck:alien_health_charger8", { + description = "Alien Charger", + tiles = { + "scifi_nodes_lighttop.png", + "scifi_nodes_lighttop.png", + "scifi_nodes_lighttop.png", + "scifi_nodes_lighttop.png", + "scifi_nodes_lighttop.png", + "healthcharger_front.png^technic_power_meter8.png" + }, + light_source = 5, + groups = {cracky=2, technic_machine = 1, technic_hv = 1}, + connect_sides = {"top", "bottom", "back", "left", "right"}, + paramtype2 = "facedir", + sounds = default.node_sound_metal_defaults(), + drop = "ufowreck:alien_health_charger0", + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("infotext", "Alien Charger") +-- meta:set_int("HV_EU_demand", 5000) + end, + on_rightclick = function(pos, node, player, itemstack, pointed_thing) + if player:get_hp() < 20 then + player:set_hp(player:get_hp() + 10) + node.name = "ufowreck:alien_health_charger6" + minetest.set_node(pos,node) + end + end, +}) + +technic.register_machine("HV", "ufowreck:alien_health_charger0", technic.receiver) +technic.register_machine("HV", "ufowreck:alien_health_charger2", technic.receiver) +technic.register_machine("HV", "ufowreck:alien_health_charger4", technic.receiver) +technic.register_machine("HV", "ufowreck:alien_health_charger6", technic.receiver) +technic.register_machine("HV", "ufowreck:alien_health_charger8", technic.receiver) diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..32da5c9 --- /dev/null +++ b/init.lua @@ -0,0 +1,191 @@ +local modpath = minetest.get_modpath(minetest.get_current_modname()) + +dofile(modpath.."/nodes.lua") +dofile(modpath.."/invader.lua") +dofile(modpath.."/engine.lua") + +local _ = { + name = "air", + prob = 0, +} + +local M = { + name = "ufowreck:alien_metal", + force_place = true, +} + +local M1 = { + name = "ufowreck:alien_metal", +} + +local L = { + name = "ufowreck:alien_light", +} + +local G = { + name = "ufowreck:alien_glass", + force_place = true, +} + +local D1 = { + name = "ufowreck:alien_door_closed", param2=3, + force_place = true, +} + +local D2 = { + name = "ufowreck:alien_door_closed", param2=1, + force_place = true, +} + +local D3 = { + name = "ufowreck:alien_door_closed_top", param2=3, + force_place = true, +} + +local D4 = { + name = "ufowreck:alien_door_closed_top", param2=1, + force_place = true, +} + +local C = { + name = "ufowreck:alien_control", +} + +local E = { + name = "ufowreck:alien_engine", +} + +local H = { + name = "ufowreck:alien_health_charger8", param2=3, +} + +local F = {name = "air", prob = 0,} +local i = math.random(3) +if i == 1 then + F = {name = "technic:mineral_uranium", + force_place = true,} + E = {name = "technic:mineral_uranium", + force_place = true,} +elseif i == 2 then + F = {name = "default:stone_with_mese", + force_place = true,} + E = {name = "default:stone_with_mese", + force_place = true,} +end + +local P1 = {name = "ufowreck:locked_crate", + force_place = true,} +local P2 = {name = "air", prob = 0,} +local P3 = {name = "air", prob = 0,} + +local i = math.random(3) +if i == 1 then + P2 = {name = "ufowreck:bar_light",} +elseif i == 2 then + P2 = {name = "ufowreck:crate",} +end; + +local j = math.random(4) +if j == 1 then + P3 = {name = "ufowreck:eye_tree",} +elseif j == 2 then + P3 = {name = "ufowreck:predatory_plant",} +elseif j == 3 then + P3 = {name = "ufowreck:alien_egg",} +else + P3 = {name = "ufowreck:glow_plant",} +end + +local S = { + name = "ufowreck:floob_spawner", +} + +-- make schematic +ufowreck_schematic = { + size = {x = 10, y = 5, z = 10}, + data = { +--1 + _, _, _, _, _, _, _, _, _, _, + _, _, _, M, M, M, M, _, _, _, + _, _, _, M, M, M, G, _, _, _, + _, _, _, _, _, _, _, _, _, _, + _, _, _, _, _, _, _, _, _, _, +--2 + _, _, _, M1, M, M1, M1, _, _, _, + _, M, M, F, _, M, _, M, M1, _, + _, M, M, _, _, H, _, G, G, _, + _, _, _, M, M, M, M, _, _, _, + _, _, _, _, _, _, _, _, _, _, +--3 + _, _, M, M, M, M1, M, M, _, _, + _, M, F, E, F, _, _, _, M, _, + _, M, _, F, _, _, _, _, G, _, + _, _, M, _, _, _, _, M1, _, _, + _, _, _, M, M, M, M1, _, _, _, +--4 + _, M, M, M1, M, M, M1, M, M, _, + M, M, M, L, L, M, _, _, _, M, + M, M, M, L, L, M, _, _, _, G, + _, M, M, L, L, M, _, _, M, _, + _, _, M, M1, M, M, M1, M1, _, _, +--5 + _, M, M, M1, M, M, M, M, M, _, + _, D1, _, _, _, _, _, _, C, M, + _, D3, _, _, _, _, _, _, _, G, + _, M, _, _, _, _, _, _, M, _, + _, _, M, M1, M, M, M, M1, _, _, +--6 + _, M, M, S, M, M, M, M, M1, _, + _, D2, _, _, _, _, _, _, C, M, + _, D4, _, _, _, _, _, _, _, G, + _, M, _, _, _, _, _, _, M, _, + _, _, M1, M, M, M, M, M, _, _, +--7 + _, M, M, M, M, M, M1, M, M, _, + M, M, M, L, L, M, _, _, _, M, + M, M, M, L, L, M, _, _, _, G, + _, M, M, L, L, M, _, _, M, _, + _, _, M, M, M, M1, M1, M, _, _, +--8 + _, _, M, M, M, M, M, M, _, _, + _, M, P1, _, _, _, _, _, M, _, + _, M, P2, _, _, _, _, _, G, _, + _, _, M, _, _, _, _, M, _, _, + _, _, _, M, M, M, M1, _, _, _, +--9 + _, _, _, M, M, M, M1, _, _, _, + _, M, M, P2, P3, M, _, M, M, _, + _, M, M, P2, _, M, _, G, G, _, + _, _, _, M, M, M, M, _, _, _, + _, _, _, _, _, _, _, _, _, _, +--10 + _, _, _, _, _, _, _, _, _, _, + _, _, _, M, M, M1, M1, _, _, _, + _, _, _, M, M, M, G, _, _, _, + _, _, _, _, _, _, _, _, _, _, + _, _, _, _, _, _, _, _, _, _, + + } +} + +if math.random(2) == 1 then rotx = '180' +else rotx = '0' +end + +minetest.register_decoration({ + deco_type = "schematic", + place_on = {"default:stone", "default:dirt_with_coniferous_litter", "default:dirt_with_rainforest_litter", "default:dirt_with_snow", "default:snow", + "default:permafrost_with_stones", "default:sand", "default:dirt_with_grass"}, + biomes = {--"desert", "snowy_grassland", "grassland", "grassland_dunes", "grassland_ocean", "coniferous_forest_dunes", "deciduous_forest", "deciduous_forest_shore", "deciduous_forest_ocean", "cold_desert", + --"savanna", "savanna_shore", "savanna_ocean", "tundra_beach", + "icesheet_ocean", "tundra", "tundra_ocean", "taiga", "taiga_ocean", "snowy_grassland_ocean", + "coniferous_forest", "coniferous_forest_ocean", "cold_desert_ocean", "rainforest", "rainforest_swamp", "rainforest_ocean", + "underground", "floatland_coniferous_forest", "floatland_coniferous_forest_ocean"}, + sidelen = 5, + fill_ratio = 0.0000000000000001, + schematic = ufowreck_schematic, + rotation = rotx, + y_min = -20, + y_max = 31000, + flags = {place_center_z = true, place_center_x = true}, +}) diff --git a/invader.lua b/invader.lua new file mode 100644 index 0000000..cfc7ad2 --- /dev/null +++ b/invader.lua @@ -0,0 +1,86 @@ +mobs:spawn({name = "ufowreck:floob", + nodes = {"ufowreck:floob_spawner"}, +-- min_light = 10, + min_height = 0, + active_object_count = 1, + chance = 1, + interval = 1, +}) + +mobs:register_mob("ufowreck:floob", { + type = "monster", + passive = false, + attack_type = "shoot", + attack_animals = true; + attack_players = true; + shoot_interval = 2.5, + arrow = "ufowreck:rayray", + shoot_offset = 0.5, + damage = 0.5, + hp_min = 12, + hp_max = 35, + armor = 100, + --reach = 1.5, + collisionbox = {-0.5, -0.01, -0.5, 0.5, 2.2, 0.5}, + rotate = 180, + visual = "mesh", + mesh = "amcaw_floob.b3d", + textures = { + {"amcaw_floob.png"}, + }, + visual_size = {x=4, y=4}, + makes_footstep_sound = true, + sounds = { +-- random = "amcaw_floob", +-- damage = "amcaw_floobhurt", + shoot_attack = "blaster_long", + death = "amcaw_floobdeath", + }, + walk_velocity = 1, + run_velocity = 1.5, + jump = true, + floats = 1, + view_range = 20, +-- drops = { +-- {name = "ufowreck:raygun", +-- chance = 2, min = 0, max = 1,}, +-- }, + water_damage = 0, + fear_height = 6, + lava_damage = 1, + light_damage = 0, + animation = { + speed_normal = 25, speed_run = 30, + stand_start = 40, stand_end = 80, + walk_start = 0, walk_end = 40, + run_start = 0, run_end = 40, +-- punch_start = 168, punch_end = 188, + }, +}) + +-- raygun arrow (weapon) +mobs:register_arrow("ufowreck:rayray", { + visual = "sprite", + visual_size = {x = 0.5, y = 0.5}, + textures = {"amcaw_rayray.png"}, + velocity = 6, + + hit_player = function(self, player) + player:punch(self.object, 1.0, { + full_punch_interval = 1.0, + damage_groups = {fleshy = 2}, + }, nil) + end, + + hit_mob = function(self, player) + player:punch(self.object, 1.0, { + full_punch_interval = 1.0, + damage_groups = {fleshy = 2}, + }, nil) + end, + + hit_node = function(self, pos, node) + end +}) + +mobs:register_egg("ufowreck:floob", "floob", "amcaw_a_floob_inv.png", 0) diff --git a/models/amcaw_floob.b3d b/models/amcaw_floob.b3d new file mode 100644 index 0000000..2fe48f5 Binary files /dev/null and b/models/amcaw_floob.b3d differ diff --git a/models/amcaw_floob.png b/models/amcaw_floob.png new file mode 100644 index 0000000..371472b Binary files /dev/null and b/models/amcaw_floob.png differ diff --git a/models/scifi_nodes_slope.obj b/models/scifi_nodes_slope.obj new file mode 100644 index 0000000..57298d7 --- /dev/null +++ b/models/scifi_nodes_slope.obj @@ -0,0 +1,56 @@ +g top +v 0.500000 0.500000 0.500000 +v -0.500000 0.500000 0.500000 +v -0.500000 -0.500000 -0.500000 +v 0.500000 -0.500000 -0.500000 +vt 1.0000 1.0000 +vt 0.0000 1.0000 +vt 0.0000 0.0000 +vt 1.0000 0.0000 +vn 0.0000 0.7071 -0.7071 +s off +f 2/1/1 1/2/1 4/3/1 3/4/1 +g bottom +v -0.500000 -0.500000 0.500000 +v 0.500000 -0.500000 0.500000 +v -0.500000 -0.500000 -0.500000 +v 0.500000 -0.500000 -0.500000 +vt 0.0000 0.0000 +vt 1.0000 0.0000 +vt 1.0000 1.0000 +vt 0.0000 1.0000 +vn 0.0000 -1.0000 -0.0000 +s off +f 6/5/2 5/6/2 7/7/2 8/8/2 +g right +v -0.500000 0.500000 0.500000 +v -0.500000 -0.500000 0.500000 +v -0.500000 -0.500000 -0.500000 +vt 1.0000 1.0000 +vt 0.0000 0.0000 +vt 1.0000 0.0000 +vn -1.0000 0.0000 0.0000 +s off +f 9/9/3 11/10/3 10/11/3 +g left +v 0.500000 0.500000 0.500000 +v 0.500000 -0.500000 0.500000 +v 0.500000 -0.500000 -0.500000 +vt 0.0000 1.0000 +vt 0.0000 0.0000 +vt 1.0000 0.0000 +vn 1.0000 0.0000 0.0000 +s off +f 12/12/4 13/13/4 14/14/4 +g back +v 0.500000 0.500000 0.500000 +v -0.500000 0.500000 0.500000 +v -0.500000 -0.500000 0.500000 +v 0.500000 -0.500000 0.500000 +vt 1.0000 1.0000 +vt 0.0000 1.0000 +vt 0.0000 0.0000 +vt 1.0000 0.0000 +vn 0.0000 -0.0000 1.0000 +s off +f 15/15/5 16/16/5 17/17/5 18/18/5 diff --git a/nodes.lua b/nodes.lua new file mode 100644 index 0000000..915284f --- /dev/null +++ b/nodes.lua @@ -0,0 +1,832 @@ +local chest_formspec = + "size[8,9]" .. + default.gui_bg .. + default.gui_bg_img .. + default.gui_slots .. + "list[current_name;main;0,0.3;8,4;]" .. + "list[current_player;main;0,4.85;8,1;]" .. + "list[current_player;main;0,6.08;8,3;8]" .. + "listring[current_name;main]" .. + "listring[current_player;main]" .. + default.get_hotbar_bg(0,4.85) + +minetest.register_node("ufowreck:locked_crate", { + description = "Locked Crate", + tiles = {"scifi_nodes_crate.png"}, + paramtype2 = "facedir", + groups = {cracky = 1, oddly_breakable_by_hand = 2, fuel = 8}, + legacy_facedir_simple = true, + is_ground_content = false, + sounds = default.node_sound_metal_defaults(), + drop = { + max_items = 3, + items = { + {items = {'ufowreck:pad'}, rarity = 10}, + {items = {'ufowreck:glow_plant'},rarity = 5}, + {items = {'ufowreck:eye'},rarity = 5}, + {items = {'ufowreck:predatory_plant'},rarity = 5}, + {items = {'default:mese'},rarity = 5}, + {items = {'technic:uranium_block'},rarity = 5}, + {items = {'ufowreck:powered_stand'},rarity = 5}, + {items = {'ufowreck:ladder 9'},rarity = 5}, + {items = {'ufowreck:crate'}}, + } + }, +}) + +minetest.register_node("ufowreck:crate", { + description = "Crate", + tiles = {"scifi_nodes_crate.png"}, + paramtype2 = "facedir", + groups = {cracky = 1, oddly_breakable_by_hand = 2, fuel = 8}, + legacy_facedir_simple = true, + is_ground_content = false, + sounds = default.node_sound_metal_defaults(), + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("formspec", chest_formspec) + meta:set_string("infotext", "Crate") + local inv = meta:get_inventory() + inv:set_size("main", 8 * 4) + end, + on_metadata_inventory_move = function(pos, from_list, from_index, + to_list, to_index, count, player) + minetest.log("action", player:get_player_name() .. + " moves stuff in chest at " .. minetest.pos_to_string(pos)) + end, + on_metadata_inventory_put = function(pos, listname, index, stack, player) + minetest.log("action", player:get_player_name() .. + " moves stuff to chest at " .. minetest.pos_to_string(pos)) + end, + on_metadata_inventory_take = function(pos, listname, index, stack, player) + minetest.log("action", player:get_player_name() .. + " takes stuff from chest at " .. minetest.pos_to_string(pos)) + end, +}) + +minetest.register_node("ufowreck:alien_metal", { + description = "Alien Metal Block", + tiles = {"scifi_nodes_lighttop.png"}, + drawtype = "nodebox", + paramtype2 = "facedir", + paramtype = "light", + sunlight_propagates = true, + is_ground_content = false, + groups = {cracky = 2}, + sounds = default.node_sound_metal_defaults(), +}) + +minetest.register_craft({ + output = "default:steel_ingot 9", + type = "shapeless", + recipe = {"ufowreck:alien_metal"} +}) + +minetest.register_node("ufowreck:alien_light", { + description = "Alien Lightbox", + sunlight_propagates = false, + tiles = { + "scifi_nodes_lighttop.png", + "scifi_nodes_lighttop.png", + "scifi_nodes_greenlight.png", + "scifi_nodes_greenlight.png", + "scifi_nodes_greenlight.png", + "scifi_nodes_greenlight.png" + }, + light_source = 10, + paramtype = "light", + groups = {cracky=1}, + sounds = default.node_sound_glass_defaults() +}) + +minetest.register_craft({ + output = "ufowreck:alien_light", + type = "shapeless", + recipe = {"ufowreck:alien_metal", "technic:uranium0_ingot"} +}) + +minetest.register_node("ufowreck:alien_glass", { + description = "Alien Glass", + drawtype = "glasslike", + sunlight_propagates = true, + tiles = { + "scifi_nodes_glass.png" + }, + use_texture_alpha = true, + paramtype = "light", + groups = {cracky=2}, + sounds = default.node_sound_glass_defaults() +}) + +minetest.register_craft({ + output = "ufowreck:alien_glass 2", + type = "shapeless", + recipe = {"ufowreck:alien_metal", "default:obsidian_glass"} +}) + +minetest.register_node("ufowreck:alien_control", { + description = "Alien Control Block", + sunlight_propagates = false, + tiles = {{ + name="scifi_nodes_black_lights.png", + animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=3.50}, --length=0.50 + }}, + paramtype = "light", + groups = {cracky=3}, + sounds = default.node_sound_metal_defaults(), +}) + +--door + +minetest.register_node("ufowreck:alien_door_closed", { + description = "Alien Door", + inventory_image = "scifi_nodes_door_black_inv.png", + wield_image = "scifi_nodes_door_black_inv.png", + tiles = { + "scifi_nodes_door_black_edge.png", + "scifi_nodes_door_black_edge.png", + "scifi_nodes_door_black_edge.png", + "scifi_nodes_door_black_edge.png", + "scifi_nodes_door_black_rbottom.png", + "scifi_nodes_door_black_bottom.png" + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + groups = {cracky = 3, oddly_breakable_by_hand = 1}, + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.0625, 0.5, 0.5, 0.0625} + } + }, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.0625, 0.5, 1.5, 0.0625} + } + }, + on_place = function(itemstack, placer, pointed_thing) + -- Is there room enough ? + local pos1 = pointed_thing.above + local pos2 = {x=pos1.x, y=pos1.y, z=pos1.z} + pos2.y = pos2.y+1 -- 2 nodes above + + if + not minetest.registered_nodes[minetest.get_node(pos1).name].buildable_to or + not minetest.registered_nodes[minetest.get_node(pos2).name].buildable_to or + not placer or + not placer:is_player() or + minetest.is_protected(pos1, placer:get_player_name()) or + minetest.is_protected(pos2, placer:get_player_name()) then + return + end + + local pt = pointed_thing.above + local pt2 = {x=pt.x, y=pt.y, z=pt.z} + pt2.y = pt2.y+1 + -- Player look dir is converted to node rotation ? + local p2 = minetest.dir_to_facedir(placer:get_look_dir()) + -- Where to look for another door ? + local pt3 = {x=pt.x, y=pt.y, z=pt.z} + + -- Door param2 depends of placer's look dir + local p4 = 0 + if p2 == 0 then + pt3.x = pt3.x-1 + p4 = 2 + elseif p2 == 1 then + pt3.z = pt3.z+1 + p4 = 3 + elseif p2 == 2 then + pt3.x = pt3.x+1 + p4 = 0 + elseif p2 == 3 then + pt3.z = pt3.z-1 + p4 = 1 + end + + -- First door of a pair is already there + if minetest.get_node(pt3).name == "ufowreck:alien_door_closed" then + minetest.set_node(pt, {name="ufowreck:alien_door_closed", param2=p4,}) + minetest.set_node(pt2, {name="ufowreck:alien_door_closed_top", param2=p4}) + -- Placed door is the first of a pair + else + minetest.set_node(pt, {name="ufowreck:alien_door_closed", param2=p2,}) + minetest.set_node(pt2, {name="ufowreck:alien_door_closed_top", param2=p2}) + end + + itemstack:take_item(1) + return itemstack; + end, + + after_destruct = function(pos, oldnode) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z},{name="air"}) + end, + + on_rightclick = function(pos, node, player, itemstack, pointed_thing) + -- play sound + minetest.sound_play("scifi_nodes_door_mechanic",{ + max_hear_distance = 16, + pos = pos, + gain = 1.0 + }) + + local timer = minetest.get_node_timer(pos) + local a = minetest.get_node({x=pos.x, y=pos.y, z=pos.z-1}) + local b = minetest.get_node({x=pos.x, y=pos.y, z=pos.z+1}) + local c = minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z}) + local d = minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z}) + local e = minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z-1}) + local f = minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z-1}) + local g = minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z+1}) + local h = minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z+1}) + + + minetest.set_node(pos, {name="ufowreck:alien_door_opened", param2=node.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z}, {name="ufowreck:alien_door_opened_top", param2=node.param2}) + + if a.name == "ufowreck:alien_door_closed" then + minetest.set_node({x=pos.x, y=pos.y, z=pos.z-1}, {name="ufowreck:alien_door_opened", param2=a.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z-1}, {name="ufowreck:alien_door_opened_top", param2=a.param2}) + end + if b.name == "ufowreck:alien_door_closed" then + minetest.set_node({x=pos.x, y=pos.y, z=pos.z+1}, {name="ufowreck:alien_door_opened", param2=b.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z+1}, {name="ufowreck:alien_door_opened_top", param2=b.param2}) + end + if c.name == "ufowreck:alien_door_closed" then + minetest.set_node({x=pos.x+1, y=pos.y, z=pos.z}, {name="ufowreck:alien_door_opened", param2=c.param2}) + minetest.set_node({x=pos.x+1,y=pos.y+1,z=pos.z}, {name="ufowreck:alien_door_opened_top", param2=c.param2}) + end + if d.name == "ufowreck:alien_door_closed" then + minetest.set_node({x=pos.x-1, y=pos.y, z=pos.z}, {name="ufowreck:alien_door_opened", param2=d.param2}) + minetest.set_node({x=pos.x-1,y=pos.y+1,z=pos.z}, {name="ufowreck:alien_door_opened_top", param2=d.param2}) + end + if e.name == "ufowreck:alien_door_closed" then + minetest.set_node({x=pos.x+1, y=pos.y, z=pos.z-1}, {name="ufowreck:alien_door_opened", param2=e.param2}) + minetest.set_node({x=pos.x+1, y=pos.y+1, z=pos.z-1}, {name="ufowreck:alien_door_opened_top", param2=e.param2}) + end + if f.name == "ufowreck:alien_door_closed" then + minetest.set_node({x=pos.x-1, y=pos.y, z=pos.z-1}, {name="ufowreck:alien_door_opened", param2=f.param2}) + minetest.set_node({x=pos.x-1, y=pos.y+1, z=pos.z-1}, {name="ufowreck:alien_door_opened_top", param2=f.param2}) + end + if g.name == "ufowreck:alien_door_closed" then + minetest.set_node({x=pos.x+1, y=pos.y, z=pos.z+1}, {name="ufowreck:alien_door_opened", param2=g.param2}) + minetest.set_node({x=pos.x+1, y=pos.y+1, z=pos.z+1}, {name="ufowreck:alien_door_opened_top", param2=g.param2}) + end + if h.name == "ufowreck:alien_door_closed" then + minetest.set_node({x=pos.x-1, y=pos.y, z=pos.z+1}, {name="ufowreck:alien_door_opened", param2=h.param2}) + minetest.set_node({x=pos.x-1, y=pos.y+1, z=pos.z+1}, {name="ufowreck:alien_door_opened_top", param2=h.param2}) + end + timer:start(5) + end, +}) + +minetest.register_node("ufowreck:alien_door_closed_top", { + tiles = { + "scifi_nodes_door_black_edge.png", + "scifi_nodes_door_black_edge.png", + "scifi_nodes_door_black_edge.png", + "scifi_nodes_door_black_edge.png", + "scifi_nodes_door_black_rtop.png", + "scifi_nodes_door_black_top.png" + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + groups = {cracky = 1}, + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.0625, 0.5, 0.5, 0.0625} + } + }, + selection_box = { + type = "fixed", + fixed = { + {0, 0, 0, 0, 0, 0}, + } + }, + can_dig = nodig, +}) + +minetest.register_node("ufowreck:alien_door_opened", { + tiles = { + "scifi_nodes_door_black_edge.png", + "scifi_nodes_door_black_edge.png", + "scifi_nodes_door_black_edge.png", + "scifi_nodes_door_black_edge.png", + "scifi_nodes_door_black_rbottom0.png", + "scifi_nodes_door_black_bottom0.png" + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + drop = closed, + groups = {cracky = 1}, + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.0625, -0.25, 0.5, 0.0625}, + } + }, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.0625, -0.25, 1.5, 0.0625}, + } + }, + after_place_node = function(pos, placer, itemstack, pointed_thing) + local node = minetest.get_node(pos) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z},{name="ufowreck:alien_door_opened_top",param2=node.param2}) + end, + after_destruct = function(pos, oldnode) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z},{name="air"}) + end, + on_timer = function(pos, elapsed) + -- play sound + minetest.sound_play("scifi_nodes_door_mechanic",{ + max_hear_distance = 16, + pos = pos, + gain = 1.0 + }) + + local node = minetest.get_node(pos) + local a = minetest.get_node({x=pos.x, y=pos.y, z=pos.z-1}) + local b = minetest.get_node({x=pos.x, y=pos.y, z=pos.z+1}) + local c = minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z}) + local d = minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z}) + local e = minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z-1}) + local f = minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z-1}) + local g = minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z+1}) + local h = minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z+1}) + + minetest.set_node(pos, {name="ufowreck:alien_door_closed", param2=node.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z}, {name="ufowreck:alien_door_closed_top", param2=node.param2}) + + if a.name == "ufowreck:alien_door_opened" then + minetest.set_node({x=pos.x, y=pos.y, z=pos.z-1}, {name="ufowreck:alien_door_closed", param2=a.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z-1}, {name="ufowreck:alien_door_closed_top", param2=a.param2}) + end + if b.name == "ufowreck:alien_door_opened" then + minetest.set_node({x=pos.x, y=pos.y, z=pos.z+1}, {name="ufowreck:alien_door_closed", param2=b.param2}) + minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z+1}, {name="ufowreck:alien_door_closed_top", param2=b.param2}) + end + if c.name == "ufowreck:alien_door_opened" then + minetest.set_node({x=pos.x+1, y=pos.y, z=pos.z}, {name="ufowreck:alien_door_closed", param2=c.param2}) + minetest.set_node({x=pos.x+1,y=pos.y+1,z=pos.z}, {name="ufowreck:alien_door_closed_top", param2=c.param2}) + end + if d.name == "ufowreck:alien_door_opened" then + minetest.set_node({x=pos.x-1, y=pos.y, z=pos.z}, {name="ufowreck:alien_door_closed", param2=d.param2}) + minetest.set_node({x=pos.x-1,y=pos.y+1,z=pos.z}, {name="ufowreck:alien_door_closed_top", param2=d.param2}) + end + if e.name == "ufowreck:alien_door_opened" then + minetest.set_node({x=pos.x+1, y=pos.y, z=pos.z-1}, {name="ufowreck:alien_door_closed", param2=e.param2}) + minetest.set_node({x=pos.x+1, y=pos.y+1, z=pos.z-1}, {name="ufowreck:alien_door_closed_top", param2=e.param2}) + end + if f.name == "ufowreck:alien_door_opened" then + minetest.set_node({x=pos.x-1, y=pos.y, z=pos.z-1}, {name="ufowreck:alien_door_closed", param2=f.param2}) + minetest.set_node({x=pos.x-1, y=pos.y+1, z=pos.z-1}, {name="ufowreck:alien_door_closed_top", param2=f.param2}) + end + if g.name == "ufowreck:alien_door_opened" then + minetest.set_node({x=pos.x+1, y=pos.y, z=pos.z+1}, {name="ufowreck:alien_door_closed", param2=g.param2}) + minetest.set_node({x=pos.x+1, y=pos.y+1, z=pos.z+1}, {name="ufowreck:alien_door_closed_top", param2=g.param2}) + end + if h.name == "ufowreck:alien_door_opened" then + minetest.set_node({x=pos.x-1, y=pos.y, z=pos.z+1}, {name="ufowreck:alien_door_closed", param2=h.param2}) + minetest.set_node({x=pos.x-1, y=pos.y+1, z=pos.z+1}, {name="ufowreck:alien_door_closed_top", param2=h.param2}) + end + end, +}) + +minetest.register_node("ufowreck:alien_door_opened_top", { + tiles = { + "scifi_nodes_door_black_edge.png", + "scifi_nodes_door_black_edge.png", + "scifi_nodes_door_black_edge.png", + "scifi_nodes_door_black_edge.png", + "scifi_nodes_door_black_rtopo.png", + "scifi_nodes_door_black_topo.png" + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + groups = {cracky = 1}, + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.0625, -0.25, 0.5, 0.0625}, + } + }, + selection_box = { + type = "fixed", + fixed = { + {0, 0, 0, 0, 0, 0}, + } + }, + can_dig = nodig, +}) + +local function nodig(pos, digger) + return false +end + +minetest.register_node("ufowreck:bar_light", { + description = "Alien Lightbars", + tiles = { + "scifi_nodes_orange2.png", + }, + drawtype = "nodebox", + paramtype = "light", + use_texture_alpha = true, + light_source = 9, + node_box = { + type = "fixed", + fixed = { + {0.125, -0.5, 0.125, 0.375, 0.5, 0.375}, -- NodeBox1 + {-0.375, -0.5, 0.125, -0.125, 0.5, 0.375}, -- NodeBox2 + {-0.375, -0.5, -0.375, -0.125, 0.5, -0.125}, -- NodeBox3 + {0.125, -0.5, -0.375, 0.375, 0.5, -0.125}, -- NodeBox4 + } + }, + groups = {cracky=1}, + sounds = default.node_sound_glass_defaults() +}) + +minetest.register_node("ufowreck:alien_egg", { + description = "Alien Egg", + tiles = { + "scifi_nodes_egg_top.png", + "scifi_nodes_egg_top.png", + "scifi_nodes_egg_side.png", + "scifi_nodes_egg_side.png", + "scifi_nodes_egg_side.png", + "scifi_nodes_egg_side.png" + }, + sunlight_propagates = false, + drawtype = "nodebox", + paramtype = "light", + groups = {cracky=1, oddly_breakable_by_hand=1, dig_immediate=2, falling_node=1}, + light_source = 5, + node_box = { + type = "fixed", + fixed = { + {-0.25, -0.5, -0.25, 0.25, -0.4375, 0.25}, -- NodeBox1 + {-0.375, -0.4375, -0.375, 0.375, -0.3125, 0.375}, -- NodeBox2 + {-0.4375, -0.3125, -0.375, 0.4375, 0.3125, 0.375}, -- NodeBox3 + {-0.375, 0.3125, -0.375, 0.375, 0.4375, 0.375}, -- NodeBox4 + {-0.3125, 0.4375, -0.3125, 0.3125, 0.5625, 0.3125}, -- NodeBox5 + {-0.25, 0.5625, -0.25, 0.25, 0.6875, 0.25}, -- NodeBox6 + {-0.1875, 0.6875, -0.1875, 0.1875, 0.75, 0.1875}, -- NodeBox7 + {-0.125, 0.75, -0.125, 0.125, 0.8125, 0.125}, -- NodeBox8 + {-0.375, -0.3125, -0.4375, 0.375, 0.3125, 0.4375}, -- NodeBox9 + }, + sounds = default.node_sound_wood_defaults() + } +}) + +minetest.register_node("ufowreck:eye_tree", { + description = "Alien Eye Tree", + tiles = {{ + name="scifi_nodes_eyetree.png", + animation={type="vertical_frames", aspect_w=48, aspect_h=48, length=10}, --length=0.50 + }}, + drawtype = "plantlike", + groups = {snappy=1, oddly_breakable_by_hand=1, flora=1}, + paramtype = "light", + visual_scale = 2.5, + buildable_to = true, + walkable = false, + selection_box = { + type = "fixed", + fixed = { + {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}, + } + }, + drop = { + items = { + {items = {'ufowreck:eye 4'}}, + } + }, + after_destruct = function(pos, oldnode) + minetest.set_node(pos, {name = "ufowreck:eye_tree_empty"}) + end, + is_ground_content = false, +}) + +minetest.register_node("ufowreck:eye_tree_empty", { + description = "Alien Eye Tree", + tiles = {"scifi_nodes_eyetree_2.png"}, + drawtype = "plantlike", + inventory_image = {"scifi_nodes_eyetree_2.png"}, + groups = {snappy=1, oddly_breakable_by_hand=1, flora=1}, + paramtype = "light", + visual_scale = 2.5, + buildable_to = true, + walkable = false, + selection_box = { + type = "fixed", + fixed = { + {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}, + } + }, + drop = { + items = { + {items = {'ufowreck:eye'}}, + } + }, + on_construct = function(pos) + minetest.get_node_timer(pos):start(math.random(300, 1500)) + end, + on_timer = function(pos) + minetest.set_node(pos, {name = "ufowreck:eye_tree"}) + end, + is_ground_content = false, +}) + +minetest.register_node("ufowreck:eye", { + description = "Alien Eye", + tiles = {"eye.png"}, + drawtype = "plantlike", + inventory_image = "eye.png", + wield_image = "eye.png", + groups = { food = 2, eatable = 4 }, + on_use = minetest.item_eat(4), + buildable_to = true, + walkable = false, + on_construct = function(pos) + minetest.get_node_timer(pos):start(math.random(300, 1500)) + end, + on_timer = function(pos) + minetest.set_node(pos, {name = "ufowreck:eye_tree"}) + end, +}) + +minetest.register_node("ufowreck:predatory_plant", { + description = "Alien Predatory Plant", + tiles = {"scifi_nodes_flower3.png"}, + drawtype = "plantlike", + inventory_image = {"scifi_nodes_flower3.png"}, + groups = {snappy=1, oddly_breakable_by_hand=1, dig_immediate=3, flora=1}, + paramtype = "light", + visual_scale = 2.5, + buildable_to = true, + walkable = false, + damage_per_second = 0.5, + selection_box = { + type = "fixed", + fixed = { + {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}, + } + }, + is_ground_content = false, +}) + +minetest.register_node("ufowreck:glow_plant", { + description = "Alien Glow Plant", + tiles = {"scifi_nodes_plant2.png"}, + drawtype = "plantlike", + inventory_image = {"scifi_nodes_plant2.png"}, + groups = {snappy=1, oddly_breakable_by_hand=1, dig_immediate=3, flora=1}, + paramtype = "light", + visual_scale = 1.5, + buildable_to = true, + walkable = false, + selection_box = { + type = "fixed", + fixed = { + {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}, + } + }, + is_ground_content = false, + light_source = 15, +}) + +minetest.register_node("ufowreck:floob_spawner", { + description = "Alien Metal Block", + tiles = {"scifi_nodes_lighttop.png"}, + drawtype = "nodebox", + paramtype2 = "facedir", + paramtype = "light", + sunlight_propagates = true, + is_ground_content = false, + groups = {cracky = 2}, + sounds = default.node_sound_metal_defaults(), +}) + +minetest.register_node("ufowreck:pad", { + description = "Alien Teleport", + tiles = { + "scifi_nodes_pad.png", + "scifi_nodes_pad.png", + "scifi_nodes_pad.png", + "scifi_nodes_pad.png", + "scifi_nodes_pad.png", + "scifi_nodes_pad.png" + }, + drawtype = "nodebox", + paramtype = "light", + groups = {cracky=1, oddly_breakable_by_hand=1}, + light_source = 5, + on_construct = function(pos, node, placer) + local meta = minetest.get_meta(pos) + if position1 == nil then + position1 = pos + meta:set_int("type", 1) + elseif position2 == nil then + position2 = pos + meta:set_int("type", 2) + else + minetest.chat_send_all("There can only be two teleportation pads at a time!") + end + end, + on_rightclick = function(pos, node, clicker) + local meta = minetest.get_meta(pos) + if meta:get_int("type") == 1 and position2 ~= nil and position1 ~= nil then + minetest.add_particlespawner( + 25, --amount + 1.5, --time + {x=pos.x-0.9, y=pos.y-0.3, z=pos.z-0.9}, --minpos + {x=pos.x+0.9, y=pos.y-0.3, z=pos.z+0.9}, --maxpos + {x=0, y=0, z=0}, --minvel + {x=0, y=0, z=0}, --maxvel + {x=-0,y=1,z=-0}, --minacc + {x=0,y=2,z=0}, --maxacc + 0.5, --minexptime + 1, --maxexptime + 2, --minsize + 5, --maxsize + false, --collisiondetection + "scifi_nodes_tp_part.png" --texture + ) + minetest.after(1, function() + local ppos = clicker:getpos() + if minetest.get_node({x=ppos.x, y=ppos.y, z=ppos.z}).name == "ufowreck:pad" then + clicker:setpos(position2) + end + local objs = minetest.env:get_objects_inside_radius(pos, 3) + for _, obj in pairs(objs) do + if obj:get_luaentity() and not obj:is_player() then + if obj:get_luaentity().name == "__builtin:item" then + local item1 = obj:get_luaentity().itemstring + local obj2 = minetest.env:add_entity(position2, "__builtin:item") + obj2:get_luaentity():set_item(item1) + obj:remove() + end + end + end + end) + elseif meta:get_int("type") == 2 and position1 ~= nil and position2 ~= nil then + minetest.add_particlespawner( + 25, --amount + 1.5, --time + {x=pos.x-0.9, y=pos.y-0.3, z=pos.z-0.9}, --minpos + {x=pos.x+0.9, y=pos.y-0.3, z=pos.z+0.9}, --maxpos + {x=0, y=0, z=0}, --minvel + {x=0, y=0, z=0}, --maxvel + {x=-0,y=1,z=-0}, --minacc + {x=0,y=2,z=0}, --maxacc + 0.5, --minexptime + 1, --maxexptime + 2, --minsize + 5, --maxsize + false, --collisiondetection + "scifi_nodes_tp_part.png" --texture + ) + minetest.after(1, function() + local ppos = clicker:getpos() + if minetest.get_node({x=ppos.x, y=ppos.y, z=ppos.z}).name == "ufowreck:pad" then + clicker:setpos(position1) + end + local objs = minetest.env:get_objects_inside_radius(pos, 3) + for _, obj in pairs(objs) do + if obj:get_luaentity() and not obj:is_player() then + if obj:get_luaentity().name == "__builtin:item" then + local item1 = obj:get_luaentity().itemstring + local obj2 = minetest.env:add_entity(position1, "__builtin:item") + obj2:get_luaentity():set_item(item1) + obj:remove() + end + end + end + end) + elseif position1 == nil and meta:get_int("type") ~= 2 then + position1 = pos + meta:set_int("type", 1) + minetest.chat_send_all("Teleporter 1 connected at "..minetest.pos_to_string(pos)) + elseif position2 == nil and meta:get_int("type") ~= 1 then + position2 = pos + meta:set_int("type", 2) + minetest.chat_send_all("Teleporter 2 connected at "..minetest.pos_to_string(pos)) + else minetest.chat_send_all("Teleporter error!") + end + end, + on_destruct = function(pos, oldnode, placer) + local meta = minetest.get_meta(pos) + if meta:get_int("type") == 1 then + position1 = nil + meta:set_int("type", 0) + elseif meta:get_int("type") == 2 then + position2 = nil + meta:set_int("type", 0) + end + end, + node_box = { + type = "fixed", + fixed = { + {-0.9375, -0.5, -0.75, 0.875, -0.375, 0.75}, -- NodeBox1 + {-0.8125, -0.5, -0.875, 0.75, -0.375, 0.875}, -- NodeBox2 + {-0.875, -0.5, -0.8125, 0.8125, -0.375, 0.8125}, -- NodeBox3 + {-0.8125, -0.5, -0.75, 0.75, -0.3125, 0.75}, -- NodeBox4 + }, + sounds = default.node_sound_metal_defaults(), + } +}) + +minetest.register_craft({ + output = "ufowreck:pad", + recipe = { + {"ufowreck:alien_metal", "ufowreck:alien_metal", "ufowreck:alien_metal"}, + {"ufowreck:alien_metal", "ufowreck:alien_control", "ufowreck:alien_metal"}, + {"ufowreck:alien_metal", "ufowreck:alien_metal", "ufowreck:alien_metal"} + } +}) + +minetest.register_node("ufowreck:powered_stand", { + description = "Powered Stand", + tiles = { + "scifi_nodes_pwrstnd_top.png", + "scifi_nodes_pwrstnd_top.png", + "scifi_nodes_pwrstnd_side.png", + "scifi_nodes_pwrstnd_side.png", + "scifi_nodes_pwrstnd_side.png", + "scifi_nodes_pwrstnd_side.png" + }, + drawtype = "nodebox", + paramtype = "light", + node_box = { + type = "fixed", + fixed = { + {-0.375, 0.25, -0.3125, 0.375, 0.4375, 0.3125}, -- NodeBox1 + {-0.3125, 0.25, -0.375, 0.3125, 0.4375, 0.375}, -- NodeBox2 + {-0.3125, 0.4375, -0.3125, 0.3125, 0.5, 0.3125}, -- NodeBox3 + {-0.5, -0.5, -0.125, 0.5, 0.125, 0.125}, -- NodeBox4 + {-0.125, -0.5, -0.5, 0.125, 0.125, 0.5}, -- NodeBox5 + {-0.4375, 0.125, -0.125, 0.4375, 0.25, 0.125}, -- NodeBox6 + {-0.125, 0.125, -0.4375, 0.125, 0.25, 0.4375}, -- NodeBox7 + {-0.3125, -0.5, -0.375, 0.3125, 0.0625, 0.3125}, -- NodeBox8 + {-0.25, 0.0625, -0.3125, 0.25, 0.125, 0.3125}, -- NodeBox9 + } + }, + groups = {cracky=1, oddly_breakable_by_hand=1}, + on_rightclick = function(pos, node, clicker, item, _) + local wield_item_stack = clicker:get_wielded_item() + local wield_item = wield_item_stack:get_name() + local taken = item:take_item() + if taken and not taken:is_empty() then + + if wield_item_stack:get_count() == 1 then + -- only 1 item in "hands" copy over entire stack with metadata + wield_item = wield_item_stack + end + + minetest.add_item({x=pos.x, y=pos.y+1, z=pos.z}, wield_item) + return item + end + end, +}) + +minetest.register_node("ufowreck:ladder", { + description = "Metal Ladder", + tiles = { + "scifi_nodes_ladder.png", + }, + drawtype = "nodebox", + paramtype = "light", + selection_box = { + type = "wallmounted", + fixed = {-0.5, -0.5, -0.5, -0.45, 0.5, 0.5} + }, + node_box = { + type = "fixed", + fixed = { + {0.3125, -0.5, -0.4375, 0.4375, -0.375, -0.3125}, -- NodeBox12 + {-0.4375, -0.5, -0.4375, -0.3125, -0.375, -0.3125}, -- NodeBox13 + {-0.375, -0.375, -0.4375, 0.375, -0.3125, -0.3125}, -- NodeBox14 + {-0.375, -0.375, 0.3125, 0.375, -0.3125, 0.4375}, -- NodeBox18 + {-0.375, -0.375, 0.0625, 0.375, -0.3125, 0.1875}, -- NodeBox19 + {-0.375, -0.375, -0.1875, 0.375, -0.3125, -0.0625}, -- NodeBox20 + {-0.4375, -0.5, -0.1875, -0.3125, -0.375, -0.0625}, -- NodeBox21 + {-0.4375, -0.5, 0.0625, -0.3125, -0.375, 0.1875}, -- NodeBox22 + {-0.4375, -0.5, 0.3125, -0.3125, -0.375, 0.4375}, -- NodeBox23 + {0.3125, -0.5, 0.3125, 0.4375, -0.375, 0.4375}, -- NodeBox24 + {0.3125, -0.5, 0.0625, 0.4375, -0.375, 0.1875}, -- NodeBox25 + {0.3125, -0.5, -0.1875, 0.4375, -0.375, -0.0625}, -- NodeBox26 + }, + sounds = default.node_sound_metal_defaults() + }, + paramtype2 = "wallmounted", + walkable = false, + climbable = true, + groups = {cracky=1, oddly_breakable_by_hand=1}, +}) diff --git a/sounds/amcaw_floob.1.ogg b/sounds/amcaw_floob.1.ogg new file mode 100644 index 0000000..abe7832 Binary files /dev/null and b/sounds/amcaw_floob.1.ogg differ diff --git a/sounds/amcaw_floob.2.ogg b/sounds/amcaw_floob.2.ogg new file mode 100644 index 0000000..f5678e9 Binary files /dev/null and b/sounds/amcaw_floob.2.ogg differ diff --git a/sounds/amcaw_floob.3.ogg b/sounds/amcaw_floob.3.ogg new file mode 100644 index 0000000..33b374c Binary files /dev/null and b/sounds/amcaw_floob.3.ogg differ diff --git a/sounds/amcaw_floob.4.ogg b/sounds/amcaw_floob.4.ogg new file mode 100644 index 0000000..d31b2f6 Binary files /dev/null and b/sounds/amcaw_floob.4.ogg differ diff --git a/sounds/amcaw_floob.5.ogg b/sounds/amcaw_floob.5.ogg new file mode 100644 index 0000000..5b57a7c Binary files /dev/null and b/sounds/amcaw_floob.5.ogg differ diff --git a/sounds/amcaw_floob.6.ogg b/sounds/amcaw_floob.6.ogg new file mode 100644 index 0000000..664828c Binary files /dev/null and b/sounds/amcaw_floob.6.ogg differ diff --git a/sounds/amcaw_floobdeath.1.ogg b/sounds/amcaw_floobdeath.1.ogg new file mode 100644 index 0000000..db7060a Binary files /dev/null and b/sounds/amcaw_floobdeath.1.ogg differ diff --git a/sounds/amcaw_floobdeath.2.ogg b/sounds/amcaw_floobdeath.2.ogg new file mode 100644 index 0000000..8d81552 Binary files /dev/null and b/sounds/amcaw_floobdeath.2.ogg differ diff --git a/sounds/amcaw_floobdeath.3.ogg b/sounds/amcaw_floobdeath.3.ogg new file mode 100644 index 0000000..70fb03c Binary files /dev/null and b/sounds/amcaw_floobdeath.3.ogg differ diff --git a/sounds/amcaw_floobhurt.1.ogg b/sounds/amcaw_floobhurt.1.ogg new file mode 100644 index 0000000..deae1b0 Binary files /dev/null and b/sounds/amcaw_floobhurt.1.ogg differ diff --git a/sounds/amcaw_floobhurt.2.ogg b/sounds/amcaw_floobhurt.2.ogg new file mode 100644 index 0000000..9fed530 Binary files /dev/null and b/sounds/amcaw_floobhurt.2.ogg differ diff --git a/sounds/amcaw_floobhurt.3.ogg b/sounds/amcaw_floobhurt.3.ogg new file mode 100644 index 0000000..8ec12c1 Binary files /dev/null and b/sounds/amcaw_floobhurt.3.ogg differ diff --git a/sounds/amcaw_floobhurt.4.ogg b/sounds/amcaw_floobhurt.4.ogg new file mode 100644 index 0000000..f63edbb Binary files /dev/null and b/sounds/amcaw_floobhurt.4.ogg differ diff --git a/sounds/amcaw_floobhurt.5.ogg b/sounds/amcaw_floobhurt.5.ogg new file mode 100644 index 0000000..c240be9 Binary files /dev/null and b/sounds/amcaw_floobhurt.5.ogg differ diff --git a/sounds/blaster_long.ogg b/sounds/blaster_long.ogg new file mode 100644 index 0000000..88f2143 Binary files /dev/null and b/sounds/blaster_long.ogg differ diff --git a/sounds/scifi_nodes_access_granted.ogg b/sounds/scifi_nodes_access_granted.ogg new file mode 100644 index 0000000..ef5d541 Binary files /dev/null and b/sounds/scifi_nodes_access_granted.ogg differ diff --git a/sounds/scifi_nodes_access_refused.ogg b/sounds/scifi_nodes_access_refused.ogg new file mode 100644 index 0000000..2a4083c Binary files /dev/null and b/sounds/scifi_nodes_access_refused.ogg differ diff --git a/sounds/scifi_nodes_digicode.ogg b/sounds/scifi_nodes_digicode.ogg new file mode 100644 index 0000000..4b5d4e4 Binary files /dev/null and b/sounds/scifi_nodes_digicode.ogg differ diff --git a/sounds/scifi_nodes_digicode_granted.ogg b/sounds/scifi_nodes_digicode_granted.ogg new file mode 100644 index 0000000..c3c2579 Binary files /dev/null and b/sounds/scifi_nodes_digicode_granted.ogg differ diff --git a/sounds/scifi_nodes_digicode_refused.ogg b/sounds/scifi_nodes_digicode_refused.ogg new file mode 100644 index 0000000..92816e9 Binary files /dev/null and b/sounds/scifi_nodes_digicode_refused.ogg differ diff --git a/sounds/scifi_nodes_door_mechanic.ogg b/sounds/scifi_nodes_door_mechanic.ogg new file mode 100644 index 0000000..f869ed8 Binary files /dev/null and b/sounds/scifi_nodes_door_mechanic.ogg differ diff --git a/sounds/scifi_nodes_door_normal.ogg b/sounds/scifi_nodes_door_normal.ogg new file mode 100644 index 0000000..1d79357 Binary files /dev/null and b/sounds/scifi_nodes_door_normal.ogg differ diff --git a/sounds/scifi_nodes_palm_scanner.ogg b/sounds/scifi_nodes_palm_scanner.ogg new file mode 100644 index 0000000..05bdcd5 Binary files /dev/null and b/sounds/scifi_nodes_palm_scanner.ogg differ diff --git a/sounds/scifi_nodes_scanner_granted.ogg b/sounds/scifi_nodes_scanner_granted.ogg new file mode 100644 index 0000000..195a216 Binary files /dev/null and b/sounds/scifi_nodes_scanner_granted.ogg differ diff --git a/sounds/scifi_nodes_scanner_refused.ogg b/sounds/scifi_nodes_scanner_refused.ogg new file mode 100644 index 0000000..d6c8363 Binary files /dev/null and b/sounds/scifi_nodes_scanner_refused.ogg differ diff --git a/sounds/scifi_nodes_switch.ogg b/sounds/scifi_nodes_switch.ogg new file mode 100644 index 0000000..b1f9efc Binary files /dev/null and b/sounds/scifi_nodes_switch.ogg differ diff --git a/sounds/scifi_nodes_wrong.ogg b/sounds/scifi_nodes_wrong.ogg new file mode 100644 index 0000000..2a4083c Binary files /dev/null and b/sounds/scifi_nodes_wrong.ogg differ diff --git a/textures/amcaw_a_floob_inv.png b/textures/amcaw_a_floob_inv.png new file mode 100644 index 0000000..27b77a5 Binary files /dev/null and b/textures/amcaw_a_floob_inv.png differ diff --git a/textures/amcaw_rayray.png b/textures/amcaw_rayray.png new file mode 100644 index 0000000..be0471e Binary files /dev/null and b/textures/amcaw_rayray.png differ diff --git a/textures/eye.png b/textures/eye.png new file mode 100644 index 0000000..5d77e1e Binary files /dev/null and b/textures/eye.png differ diff --git a/textures/healthcharger_front.png b/textures/healthcharger_front.png new file mode 100644 index 0000000..921d7f4 Binary files /dev/null and b/textures/healthcharger_front.png differ diff --git a/textures/healthcharger_front.xcf b/textures/healthcharger_front.xcf new file mode 100644 index 0000000..09c0003 Binary files /dev/null and b/textures/healthcharger_front.xcf differ diff --git a/textures/scifi_nodes_black_lights.png b/textures/scifi_nodes_black_lights.png new file mode 100644 index 0000000..c53bf70 Binary files /dev/null and b/textures/scifi_nodes_black_lights.png differ diff --git a/textures/scifi_nodes_black_screen.png b/textures/scifi_nodes_black_screen.png new file mode 100644 index 0000000..20de6c2 Binary files /dev/null and b/textures/scifi_nodes_black_screen.png differ diff --git a/textures/scifi_nodes_crate.png b/textures/scifi_nodes_crate.png new file mode 100644 index 0000000..7577854 Binary files /dev/null and b/textures/scifi_nodes_crate.png differ diff --git a/textures/scifi_nodes_door_black_bottom.png b/textures/scifi_nodes_door_black_bottom.png new file mode 100644 index 0000000..c20612f Binary files /dev/null and b/textures/scifi_nodes_door_black_bottom.png differ diff --git a/textures/scifi_nodes_door_black_bottom0.png b/textures/scifi_nodes_door_black_bottom0.png new file mode 100644 index 0000000..e96791c Binary files /dev/null and b/textures/scifi_nodes_door_black_bottom0.png differ diff --git a/textures/scifi_nodes_door_black_edge.png b/textures/scifi_nodes_door_black_edge.png new file mode 100644 index 0000000..887193b Binary files /dev/null and b/textures/scifi_nodes_door_black_edge.png differ diff --git a/textures/scifi_nodes_door_black_inv.png b/textures/scifi_nodes_door_black_inv.png new file mode 100644 index 0000000..611c0cc Binary files /dev/null and b/textures/scifi_nodes_door_black_inv.png differ diff --git a/textures/scifi_nodes_door_black_rbottom.png b/textures/scifi_nodes_door_black_rbottom.png new file mode 100644 index 0000000..59d84b2 Binary files /dev/null and b/textures/scifi_nodes_door_black_rbottom.png differ diff --git a/textures/scifi_nodes_door_black_rbottom0.png b/textures/scifi_nodes_door_black_rbottom0.png new file mode 100644 index 0000000..78ed88c Binary files /dev/null and b/textures/scifi_nodes_door_black_rbottom0.png differ diff --git a/textures/scifi_nodes_door_black_rtop.png b/textures/scifi_nodes_door_black_rtop.png new file mode 100644 index 0000000..75c7531 Binary files /dev/null and b/textures/scifi_nodes_door_black_rtop.png differ diff --git a/textures/scifi_nodes_door_black_rtopo.png b/textures/scifi_nodes_door_black_rtopo.png new file mode 100644 index 0000000..5ddbde4 Binary files /dev/null and b/textures/scifi_nodes_door_black_rtopo.png differ diff --git a/textures/scifi_nodes_door_black_top.png b/textures/scifi_nodes_door_black_top.png new file mode 100644 index 0000000..f7cb190 Binary files /dev/null and b/textures/scifi_nodes_door_black_top.png differ diff --git a/textures/scifi_nodes_door_black_topo.png b/textures/scifi_nodes_door_black_topo.png new file mode 100644 index 0000000..8a8cf81 Binary files /dev/null and b/textures/scifi_nodes_door_black_topo.png differ diff --git a/textures/scifi_nodes_egg_side.png b/textures/scifi_nodes_egg_side.png new file mode 100644 index 0000000..f179d64 Binary files /dev/null and b/textures/scifi_nodes_egg_side.png differ diff --git a/textures/scifi_nodes_egg_top.png b/textures/scifi_nodes_egg_top.png new file mode 100644 index 0000000..d1f0612 Binary files /dev/null and b/textures/scifi_nodes_egg_top.png differ diff --git a/textures/scifi_nodes_eyetree.png b/textures/scifi_nodes_eyetree.png new file mode 100644 index 0000000..4041074 Binary files /dev/null and b/textures/scifi_nodes_eyetree.png differ diff --git a/textures/scifi_nodes_eyetree_2.png b/textures/scifi_nodes_eyetree_2.png new file mode 100644 index 0000000..e0a2484 Binary files /dev/null and b/textures/scifi_nodes_eyetree_2.png differ diff --git a/textures/scifi_nodes_flower3.png b/textures/scifi_nodes_flower3.png new file mode 100644 index 0000000..92d74bc Binary files /dev/null and b/textures/scifi_nodes_flower3.png differ diff --git a/textures/scifi_nodes_glass.png b/textures/scifi_nodes_glass.png new file mode 100644 index 0000000..23ff6ff Binary files /dev/null and b/textures/scifi_nodes_glass.png differ diff --git a/textures/scifi_nodes_greenlight.png b/textures/scifi_nodes_greenlight.png new file mode 100644 index 0000000..fde3b09 Binary files /dev/null and b/textures/scifi_nodes_greenlight.png differ diff --git a/textures/scifi_nodes_ladder.png b/textures/scifi_nodes_ladder.png new file mode 100644 index 0000000..557f02d Binary files /dev/null and b/textures/scifi_nodes_ladder.png differ diff --git a/textures/scifi_nodes_lighttop.png b/textures/scifi_nodes_lighttop.png new file mode 100644 index 0000000..0bc0109 Binary files /dev/null and b/textures/scifi_nodes_lighttop.png differ diff --git a/textures/scifi_nodes_orange2.png b/textures/scifi_nodes_orange2.png new file mode 100644 index 0000000..b2aa985 Binary files /dev/null and b/textures/scifi_nodes_orange2.png differ diff --git a/textures/scifi_nodes_pad.png b/textures/scifi_nodes_pad.png new file mode 100644 index 0000000..2154c6f Binary files /dev/null and b/textures/scifi_nodes_pad.png differ diff --git a/textures/scifi_nodes_plant2.png b/textures/scifi_nodes_plant2.png new file mode 100644 index 0000000..4cf4251 Binary files /dev/null and b/textures/scifi_nodes_plant2.png differ diff --git a/textures/scifi_nodes_pwrstnd_side.png b/textures/scifi_nodes_pwrstnd_side.png new file mode 100644 index 0000000..839f519 Binary files /dev/null and b/textures/scifi_nodes_pwrstnd_side.png differ diff --git a/textures/scifi_nodes_pwrstnd_top.png b/textures/scifi_nodes_pwrstnd_top.png new file mode 100644 index 0000000..3474196 Binary files /dev/null and b/textures/scifi_nodes_pwrstnd_top.png differ diff --git a/textures/scifi_nodes_tp_part.png b/textures/scifi_nodes_tp_part.png new file mode 100644 index 0000000..fe55554 Binary files /dev/null and b/textures/scifi_nodes_tp_part.png differ diff --git a/textures/technic_power_meter0.png b/textures/technic_power_meter0.png new file mode 100644 index 0000000..ced1506 Binary files /dev/null and b/textures/technic_power_meter0.png differ diff --git a/textures/technic_power_meter1.png b/textures/technic_power_meter1.png new file mode 100644 index 0000000..ad19fd3 Binary files /dev/null and b/textures/technic_power_meter1.png differ diff --git a/textures/technic_power_meter2.png b/textures/technic_power_meter2.png new file mode 100644 index 0000000..6ff2c0e Binary files /dev/null and b/textures/technic_power_meter2.png differ diff --git a/textures/technic_power_meter3.png b/textures/technic_power_meter3.png new file mode 100644 index 0000000..67d44d4 Binary files /dev/null and b/textures/technic_power_meter3.png differ diff --git a/textures/technic_power_meter4.png b/textures/technic_power_meter4.png new file mode 100644 index 0000000..93c9de0 Binary files /dev/null and b/textures/technic_power_meter4.png differ diff --git a/textures/technic_power_meter5.png b/textures/technic_power_meter5.png new file mode 100644 index 0000000..6188a45 Binary files /dev/null and b/textures/technic_power_meter5.png differ diff --git a/textures/technic_power_meter6.png b/textures/technic_power_meter6.png new file mode 100644 index 0000000..5c82eee Binary files /dev/null and b/textures/technic_power_meter6.png differ diff --git a/textures/technic_power_meter7.png b/textures/technic_power_meter7.png new file mode 100644 index 0000000..ad010c8 Binary files /dev/null and b/textures/technic_power_meter7.png differ diff --git a/textures/technic_power_meter8.png b/textures/technic_power_meter8.png new file mode 100644 index 0000000..5aa52b8 Binary files /dev/null and b/textures/technic_power_meter8.png differ