2019-06-08 23:57:01 +03:00
|
|
|
--[[
|
|
|
|
|
|
|
|
TechAge
|
|
|
|
=======
|
|
|
|
|
2020-02-02 00:00:58 +03:00
|
|
|
Copyright (C) 2019-2020 Joachim Stolberg
|
2019-06-08 23:57:01 +03:00
|
|
|
|
2020-10-19 20:09:17 +03:00
|
|
|
AGPL v3
|
2019-06-08 23:57:01 +03:00
|
|
|
See LICENSE.txt for more information
|
2022-01-03 23:40:31 +03:00
|
|
|
|
2019-06-08 23:57:01 +03:00
|
|
|
TA3 Oil Tower
|
|
|
|
|
|
|
|
]]--
|
|
|
|
|
|
|
|
-- for lazy programmers
|
|
|
|
local P = minetest.string_to_pos
|
|
|
|
local M = minetest.get_meta
|
2019-07-02 22:33:12 +03:00
|
|
|
local S = techage.S
|
2019-06-08 23:57:01 +03:00
|
|
|
|
|
|
|
minetest.register_node("techage:oiltower1", {
|
2019-07-02 22:33:12 +03:00
|
|
|
description = S("TA3 Derrick"),
|
2019-06-08 23:57:01 +03:00
|
|
|
tiles = {
|
|
|
|
"techage_oil_tower1.png",
|
|
|
|
},
|
|
|
|
drawtype = "nodebox",
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-8/16, -8/16, -8/16, -7/16, 8/16, 8/16},
|
|
|
|
{ 7/16, -8/16, -8/16, 8/16, 8/16, 8/16},
|
|
|
|
{-8/16, -8/16, -8/16, 8/16, -7/16, 8/16},
|
|
|
|
{-8/16, 7/16, -8/16, 8/16, 8/16, 8/16},
|
|
|
|
{-8/16, -8/16, -8/16, 8/16, 8/16, -7/16},
|
|
|
|
{-8/16, -8/16, 7/16, 8/16, 8/16, 8/16},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
drop = "",
|
|
|
|
diggable = false,
|
|
|
|
paramtype2 = "facedir",
|
|
|
|
paramtype = "light",
|
2021-03-19 22:06:22 +03:00
|
|
|
use_texture_alpha = techage.CLIP,
|
2019-06-08 23:57:01 +03:00
|
|
|
sunlight_propagates = true,
|
|
|
|
groups = {not_in_creative_inventory = 1},
|
|
|
|
is_ground_content = false,
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_node("techage:oiltower2", {
|
2019-07-02 22:33:12 +03:00
|
|
|
description = S("TA3 Derrick"),
|
2019-06-08 23:57:01 +03:00
|
|
|
tiles = {
|
|
|
|
-- up, down, right, left, back, front
|
|
|
|
"techage_oil_tower_top.png^[transformR180",
|
|
|
|
"techage_oil_tower_top.png^[transformR180",
|
|
|
|
"techage_oil_tower2.png^[transformFX",
|
|
|
|
"techage_oil_tower2.png",
|
|
|
|
"techage_oil_tower2.png",
|
|
|
|
"techage_oil_tower2.png^[transformFX",
|
|
|
|
},
|
|
|
|
drawtype = "nodebox",
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-8/16, -8/16, -8/16, -7/16, 8/16, 4/16},
|
|
|
|
{ 3/16, -8/16, -8/16, 4/16, 8/16, 4/16},
|
|
|
|
{-8/16, -8/16, -8/16, 4/16, -7/16, 4/16},
|
|
|
|
{-8/16, 7/16, -8/16, 4/16, 8/16, 4/16},
|
|
|
|
{-8/16, -8/16, -8/16, 4/16, 8/16, -7/16},
|
|
|
|
{-8/16, -8/16, 3/16, 4/16, 8/16, 4/16},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
drop = "",
|
|
|
|
diggable = false,
|
|
|
|
paramtype2 = "facedir",
|
|
|
|
paramtype = "light",
|
2021-03-19 22:06:22 +03:00
|
|
|
use_texture_alpha = techage.CLIP,
|
2019-06-08 23:57:01 +03:00
|
|
|
sunlight_propagates = true,
|
|
|
|
groups = {not_in_creative_inventory = 1},
|
|
|
|
is_ground_content = false,
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_node("techage:oiltower3", {
|
2019-07-02 22:33:12 +03:00
|
|
|
description = S("TA3 Derrick"),
|
2019-06-08 23:57:01 +03:00
|
|
|
tiles = {
|
|
|
|
-- up, down, right, left, back, front
|
|
|
|
"techage_oil_tower_top.png^[transformR180",
|
|
|
|
"techage_oil_tower_top.png^[transformR180",
|
|
|
|
"techage_oil_tower3.png^[transformFX",
|
|
|
|
"techage_oil_tower3.png",
|
|
|
|
"techage_oil_tower3.png",
|
|
|
|
"techage_oil_tower3.png^[transformFX",
|
|
|
|
},
|
|
|
|
drawtype = "nodebox",
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-8/16, -8/16, -8/16, -7/16, 8/16, 0/16},
|
|
|
|
{-1/16, -8/16, -8/16, 0/16, 8/16, 0/16},
|
|
|
|
{-8/16, -8/16, -8/16, 0/16, -7/16, 0/16},
|
|
|
|
{-8/16, 7/16, -8/16, 0/16, 8/16, 0/16},
|
|
|
|
{-8/16, -8/16, -8/16, 0/16, 8/16, -7/16},
|
|
|
|
{-8/16, -8/16, -1/16, 0/16, 8/16, 0/16},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
drop = "",
|
|
|
|
diggable = false,
|
|
|
|
paramtype2 = "facedir",
|
|
|
|
paramtype = "light",
|
2021-03-19 22:06:22 +03:00
|
|
|
use_texture_alpha = techage.CLIP,
|
2019-06-08 23:57:01 +03:00
|
|
|
sunlight_propagates = true,
|
|
|
|
groups = {not_in_creative_inventory = 1},
|
|
|
|
is_ground_content = false,
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_node("techage:oiltower4", {
|
2019-07-02 22:33:12 +03:00
|
|
|
description = S("TA3 Derrick"),
|
2019-06-08 23:57:01 +03:00
|
|
|
tiles = {
|
|
|
|
-- up, down, right, left, back, front
|
|
|
|
"techage_oil_tower_top.png^[transformR180",
|
|
|
|
"techage_oil_tower_top.png^[transformR180",
|
|
|
|
"techage_oil_tower4.png^[transformFX",
|
|
|
|
"techage_oil_tower4.png",
|
|
|
|
"techage_oil_tower4.png",
|
|
|
|
"techage_oil_tower4.png^[transformFX",
|
|
|
|
},
|
|
|
|
drawtype = "nodebox",
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-8/16, -8/16, -8/16, -7/16, 8/16, -4/16},
|
|
|
|
{-5/16, -8/16, -8/16, -4/16, 8/16, -4/16},
|
|
|
|
{-8/16, -8/16, -8/16, -4/16, -7/16, -4/16},
|
|
|
|
{-8/16, 7/16, -8/16, -4/16, 8/16, -4/16},
|
|
|
|
{-8/16, -8/16, -8/16, -4/16, 8/16, -7/16},
|
|
|
|
{-8/16, -8/16, -5/16, -4/16, 8/16, -4/16},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
drop = "",
|
|
|
|
diggable = false,
|
|
|
|
paramtype2 = "facedir",
|
|
|
|
paramtype = "light",
|
2021-03-19 22:06:22 +03:00
|
|
|
use_texture_alpha = techage.CLIP,
|
2019-06-08 23:57:01 +03:00
|
|
|
sunlight_propagates = true,
|
|
|
|
groups = {not_in_creative_inventory = 1},
|
|
|
|
is_ground_content = false,
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_node("techage:oiltower5", {
|
2019-07-02 22:33:12 +03:00
|
|
|
description = S("TA4 Derrick"),
|
2019-06-08 23:57:01 +03:00
|
|
|
tiles = {
|
|
|
|
-- up, down, right, left, back, front
|
|
|
|
"techage_oil_tower1.png",
|
|
|
|
},
|
|
|
|
drawtype = "nodebox",
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-8/16, -8/16, 7/16, 8/16, 8/16, 8/16},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
drop = "",
|
|
|
|
diggable = false,
|
|
|
|
paramtype2 = "facedir",
|
|
|
|
paramtype = "light",
|
2021-03-19 22:06:22 +03:00
|
|
|
use_texture_alpha = techage.CLIP,
|
2019-06-08 23:57:01 +03:00
|
|
|
sunlight_propagates = true,
|
|
|
|
groups = {not_in_creative_inventory = 1},
|
|
|
|
is_ground_content = false,
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_node("techage:oil_drillbit", {
|
2020-04-13 14:20:38 +03:00
|
|
|
description = S("TA3 Drill Pipe"),
|
2019-06-08 23:57:01 +03:00
|
|
|
drawtype = "plantlike",
|
|
|
|
tiles = {"techage_oil_drillbit.png"},
|
|
|
|
inventory_image = "techage_oil_drillbit_inv.png",
|
|
|
|
wield_image = "techage_oil_drillbit_inv.png",
|
|
|
|
visual_scale = 1,
|
|
|
|
paramtype = "light",
|
2021-03-19 22:06:22 +03:00
|
|
|
use_texture_alpha = techage.CLIP,
|
2019-06-08 23:57:01 +03:00
|
|
|
sunlight_propagates = true,
|
|
|
|
groups = {cracky = 1},
|
|
|
|
is_ground_content = false,
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_node("techage:oil_drillbit2", {
|
2020-04-13 14:20:38 +03:00
|
|
|
description = S("TA3 Drill Pipe"),
|
2019-06-08 23:57:01 +03:00
|
|
|
drawtype = "plantlike",
|
|
|
|
tiles = {"techage_oil_drillbit.png"},
|
|
|
|
inventory_image = "techage_oil_drillbit_inv.png",
|
|
|
|
wield_image = "techage_oil_drillbit_inv.png",
|
|
|
|
visual_scale = 1,
|
|
|
|
paramtype = "light",
|
2021-03-19 22:06:22 +03:00
|
|
|
use_texture_alpha = techage.CLIP,
|
2019-06-08 23:57:01 +03:00
|
|
|
drop = "",
|
|
|
|
diggable = false,
|
|
|
|
sunlight_propagates = true,
|
|
|
|
groups = {not_in_creative_inventory = 1},
|
|
|
|
is_ground_content = false,
|
|
|
|
})
|
|
|
|
|
|
|
|
local AssemblyPlan = {
|
|
|
|
-- y-offs, path, facedir-offs, name
|
2022-01-03 23:40:31 +03:00
|
|
|
|
2019-06-08 23:57:01 +03:00
|
|
|
-- level 0
|
|
|
|
{ 0, {0,1}, 0, "techage:oiltower1"},
|
|
|
|
{ 0, {0,3}, 0, "techage:oiltower1"},
|
|
|
|
{ 0, {2,1}, 0, "techage:oiltower1"},
|
|
|
|
{ 0, {2,3}, 0, "techage:oiltower1"},
|
|
|
|
-- level 1
|
|
|
|
{ 1, {0,1}, 0, "techage:oiltower1"},
|
|
|
|
{ 1, {0,3}, 0, "techage:oiltower1"},
|
|
|
|
{ 1, {2,1}, 0, "techage:oiltower1"},
|
|
|
|
{ 1, {2,3}, 0, "techage:oiltower1"},
|
|
|
|
{ 1, {0}, 2, "techage:oiltower5"},
|
|
|
|
{ 1, {1}, 3, "techage:oiltower5"},
|
|
|
|
{ 1, {2}, 0, "techage:oiltower5"},
|
|
|
|
{ 1, {3}, 1, "techage:oiltower5"},
|
|
|
|
-- level 2
|
|
|
|
{ 2, {0,1}, 0, "techage:oiltower2"},
|
|
|
|
{ 2, {0,3}, 3, "techage:oiltower2"},
|
|
|
|
{ 2, {2,1}, 1, "techage:oiltower2"},
|
|
|
|
{ 2, {2,3}, 2, "techage:oiltower2"},
|
|
|
|
{ 2, {0}, 2, "techage:oiltower5"},
|
|
|
|
{ 2, {1}, 3, "techage:oiltower5"},
|
|
|
|
{ 2, {2}, 0, "techage:oiltower5"},
|
|
|
|
{ 2, {3}, 1, "techage:oiltower5"},
|
|
|
|
-- level 3
|
|
|
|
{ 3, {0,1}, 0, "techage:oiltower3"},
|
|
|
|
{ 3, {0,3}, 3, "techage:oiltower3"},
|
|
|
|
{ 3, {2,1}, 1, "techage:oiltower3"},
|
|
|
|
{ 3, {2,3}, 2, "techage:oiltower3"},
|
|
|
|
{ 3, {0}, 2, "techage:oiltower5"},
|
|
|
|
{ 3, {1}, 3, "techage:oiltower5"},
|
|
|
|
{ 3, {2}, 0, "techage:oiltower5"},
|
|
|
|
{ 3, {3}, 1, "techage:oiltower5"},
|
|
|
|
-- level 4
|
|
|
|
{ 4, {0,1}, 0, "techage:oiltower4"},
|
|
|
|
{ 4, {0,3}, 3, "techage:oiltower4"},
|
|
|
|
{ 4, {2,1}, 1, "techage:oiltower4"},
|
|
|
|
{ 4, {2,3}, 2, "techage:oiltower4"},
|
|
|
|
{ 4, {0}, 2, "techage:oiltower5"},
|
|
|
|
{ 4, {1}, 3, "techage:oiltower5"},
|
|
|
|
{ 4, {2}, 0, "techage:oiltower5"},
|
|
|
|
{ 4, {3}, 1, "techage:oiltower5"},
|
|
|
|
-- level 5
|
|
|
|
{ 5, {0}, 2, "techage:oiltower5"},
|
|
|
|
{ 5, {1}, 3, "techage:oiltower5"},
|
|
|
|
{ 5, {2}, 0, "techage:oiltower5"},
|
|
|
|
{ 5, {3}, 1, "techage:oiltower5"},
|
|
|
|
-- level 6
|
|
|
|
{ 6, {0}, 2, "techage:oiltower5"},
|
|
|
|
{ 6, {1}, 3, "techage:oiltower5"},
|
|
|
|
{ 6, {2}, 0, "techage:oiltower5"},
|
|
|
|
{ 6, {3}, 1, "techage:oiltower5"},
|
|
|
|
-- level 7
|
|
|
|
{ 7, {}, 0, "techage:oiltower1"},
|
|
|
|
-- drill bits
|
|
|
|
{ 1, {}, 0, "techage:oil_drillbit2"},
|
|
|
|
{ 2, {}, 0, "techage:oil_drillbit2"},
|
|
|
|
{ 3, {}, 0, "techage:oil_drillbit2"},
|
|
|
|
{ 4, {}, 0, "techage:oil_drillbit2"},
|
|
|
|
{ 5, {}, 0, "techage:oil_drillbit2"},
|
|
|
|
{ 6, {}, 0, "techage:oil_drillbit2"},
|
|
|
|
}
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = "techage:oil_drillbit 12",
|
|
|
|
recipe = {
|
|
|
|
{"", "default:steel_ingot", "default:obsidian_shard"},
|
|
|
|
{"", "default:steel_ingot", ""},
|
|
|
|
{"default:obsidian_shard", "default:steel_ingot", ""},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
techage.oiltower = {}
|
|
|
|
|
|
|
|
-- Two important flags:
|
|
|
|
-- 1) mem.assemble_locked is true while the tower is being assembled/disassembled
|
|
|
|
-- 2) mem.assemble_build is true if the tower is assembled
|
|
|
|
function techage.oiltower.build(pos, player_name)
|
2019-07-02 22:33:12 +03:00
|
|
|
minetest.chat_send_player(player_name, S("[TA] Derrick is being built!"))
|
2019-06-08 23:57:01 +03:00
|
|
|
techage.assemble.build(pos, AssemblyPlan, player_name)
|
|
|
|
end
|
|
|
|
|
|
|
|
function techage.oiltower.remove(pos, player_name)
|
2019-07-02 22:33:12 +03:00
|
|
|
minetest.chat_send_player(player_name, S("[TA] Derrick is being removed!"))
|
2019-06-08 23:57:01 +03:00
|
|
|
techage.assemble.remove(pos, AssemblyPlan, player_name)
|
|
|
|
end
|