Compare commits
10 Commits
1a86d116c6
...
a35e564b81
Author | SHA1 | Date | |
---|---|---|---|
|
a35e564b81 | ||
|
21a3e9f1b9 | ||
|
495c1c9003 | ||
|
87e9fa2506 | ||
|
2f098f1fd8 | ||
|
c759cbf6c0 | ||
|
774037bdb1 | ||
|
5963500c2e | ||
|
668763b85b | ||
|
3780586d11 |
17
.gitattributes
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
# Auto detect text files and perform LF normalization
|
||||
* text=auto
|
||||
|
||||
# Custom for Visual Studio
|
||||
*.cs diff=csharp
|
||||
|
||||
# Standard to msysgit
|
||||
*.doc diff=astextplain
|
||||
*.DOC diff=astextplain
|
||||
*.docx diff=astextplain
|
||||
*.DOCX diff=astextplain
|
||||
*.dot diff=astextplain
|
||||
*.DOT diff=astextplain
|
||||
*.pdf diff=astextplain
|
||||
*.PDF diff=astextplain
|
||||
*.rtf diff=astextplain
|
||||
*.RTF diff=astextplain
|
47
.gitignore
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
# Windows image file caches
|
||||
Thumbs.db
|
||||
ehthumbs.db
|
||||
|
||||
# Folder config file
|
||||
Desktop.ini
|
||||
|
||||
# Recycle Bin used on file shares
|
||||
$RECYCLE.BIN/
|
||||
|
||||
# Windows Installer files
|
||||
*.cab
|
||||
*.msi
|
||||
*.msm
|
||||
*.msp
|
||||
|
||||
# Windows shortcuts
|
||||
*.lnk
|
||||
|
||||
# =========================
|
||||
# Operating System Files
|
||||
# =========================
|
||||
|
||||
# OSX
|
||||
# =========================
|
||||
|
||||
.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
|
||||
# Thumbnails
|
||||
._*
|
||||
|
||||
# Files that might appear in the root of a volume
|
||||
.DocumentRevisions-V100
|
||||
.fseventsd
|
||||
.Spotlight-V100
|
||||
.TemporaryItems
|
||||
.Trashes
|
||||
.VolumeIcon.icns
|
||||
|
||||
# Directories potentially created on remote AFP share
|
||||
.AppleDB
|
||||
.AppleDesktop
|
||||
Network Trash Folder
|
||||
Temporary Items
|
||||
.apdisk
|
21
LICENSE
@ -1,21 +0,0 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 Minetest Mods Team
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
3
LICENSE.md
Normal file
@ -0,0 +1,3 @@
|
||||
# License
|
||||
|
||||
All licenses can be found in their respective mod folders.
|
12
README.md
Normal file
@ -0,0 +1,12 @@
|
||||
# Castles++
|
||||
A modpack that contains a big variety of nodes and tools to build castles and castle dungeons.
|
||||
|
||||
![image](https://raw.githubusercontent.com/minetest-mods/castle/master/screenshot.png)
|
||||
|
||||
## Installation
|
||||
|
||||
This mod works as a "metapackage", marking the mods it includes as dependencies to be installed alongside [on ContentDB](https://content.minetest.net/packages/philipbenr/castle/).
|
||||
|
||||
## License
|
||||
|
||||
See [`LICENSE.md`](LICENSE.md) for full information.
|
58
README.txt
@ -1,58 +0,0 @@
|
||||
=-=-=-=-=-=-=-=-=-=
|
||||
|
||||
Castles Mod
|
||||
by: Philipbenr And DanDuncombe
|
||||
|
||||
=-=-=-=-=-=-=-=-=-=
|
||||
|
||||
Licence: MIT, LGPLv2.1 (Crossbow)
|
||||
|
||||
see: LICENSE
|
||||
|
||||
=-=-=-=-=-=-=-=-=-=
|
||||
|
||||
This is a mod all about creating castles and castle dungeons. Many of the nodes are used for the outer-walls or dungeons.
|
||||
|
||||
=-=-=-=-=-=-=-=-=-=
|
||||
|
||||
Contains as of now:
|
||||
|
||||
--Walls, Corner-walls,
|
||||
--Castlestone Stairs, Slabs, and Pillars
|
||||
--Jailbars
|
||||
--Hides
|
||||
--Arrows and Arrowslits
|
||||
--Rubble
|
||||
--Doors
|
||||
--Weapons
|
||||
--Chandeliers
|
||||
--Tapestries
|
||||
--and more!
|
||||
|
||||
=-=-=-=-=-=-=-=-=-=
|
||||
|
||||
Big release coming soon. ;) Stay tuned.
|
||||
|
||||
Planned features (anything with question mark means that I am either unsure or don't know how to accomplish it ;)
|
||||
|
||||
--More/Better weapons
|
||||
--More decorations
|
||||
--More nodes
|
||||
--Redone columns
|
||||
--More doors
|
||||
--Gatehouse mod
|
||||
--Armor
|
||||
--More magical items (mana, orbs, potions...)
|
||||
--Crowns/capes/player decor
|
||||
--Flags
|
||||
--Brewery/Liquor (liquor effects is another thing altogether)
|
||||
--Tannery?
|
||||
--Dye Vats?
|
||||
--Books? (that is an interesting one... I'll write a post on it later)
|
||||
--Guards?
|
||||
--Player status (King, queen, etc.)?
|
||||
--Foods?
|
||||
--Horses/Livestock?
|
||||
--Ruins?
|
||||
|
||||
--Modpack Configurator
|
133
arrowslit.lua
@ -1,133 +0,0 @@
|
||||
minetest.register_alias("castle:arrowslit", "castle:arrowslit_stonewall")
|
||||
minetest.register_alias("castle:arrowslit_hole", "castle:arrowslit_stonewall_hole")
|
||||
minetest.register_alias("castle:arrowslit", "castle:arrowslit_stonewall_cross")
|
||||
|
||||
local arrowslit = {}
|
||||
|
||||
arrowslit.types = {
|
||||
{"stonewall", "Stonewall", "castle_stonewall", "castle:stonewall"},
|
||||
{"cobble", "Cobble", "default_cobble", "default:cobble"},
|
||||
{"stonebrick", "Stonebrick", "default_stone_brick", "default:stonebrick"},
|
||||
{"sandstonebrick", "Sandstone Brick", "default_sandstone_brick", "default:sandstonebrick"},
|
||||
{"desertstonebrick", "Desert Stone Brick", "default_desert_stone_brick", "default:desert_stonebrick"},
|
||||
{"stone", "Stone", "default_stone", "default:stone"},
|
||||
{"sandstone", "Sandstone", "default_sandstone", "default:sandstone"},
|
||||
{"desertstone", "Desert Stone", "default_desert_stone", "default:desert_stone"},
|
||||
}
|
||||
|
||||
for _, row in ipairs(arrowslit.types) do
|
||||
local name = row[1]
|
||||
local desc = row[2]
|
||||
local tile = row[3]
|
||||
local craft_material = row[4]
|
||||
-- Node Definition
|
||||
minetest.register_node("castle:arrowslit_"..name, {
|
||||
drawtype = "nodebox",
|
||||
description = desc.." Arrowslit",
|
||||
tiles = {tile..".png"},
|
||||
groups = {cracky=3},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.500000,-0.375000,-0.500000,-0.062500,0.375000,-0.312500},
|
||||
{0.062500,-0.375000,-0.500000,0.500000,0.375000,-0.312500},
|
||||
{-0.500000,0.375000,-0.500000,0.500000,0.500000,-0.312500},
|
||||
{-0.500000,-0.500000,-0.500000,0.500000,-0.375000,-0.312500},
|
||||
},
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.500000,-0.500000,-0.500000,0.500000,0.500000,-0.312500},
|
||||
},
|
||||
},
|
||||
})
|
||||
minetest.register_node("castle:arrowslit_"..name.."_cross", {
|
||||
drawtype = "nodebox",
|
||||
description = desc.." Arrowslit with Cross",
|
||||
tiles = {tile..".png"},
|
||||
groups = {cracky=3},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.500000,-0.125000,-0.500000,-0.062500,0.375000,-0.312500},
|
||||
{0.062500,-0.125000,-0.500000,0.500000,0.375000,-0.312500},
|
||||
{-0.500000,0.375000,-0.500000,0.500000,0.500000,-0.312500},
|
||||
{-0.500000,-0.500000,-0.500000,0.500000,-0.375000,-0.312500},
|
||||
{0.062500,-0.375000,-0.500000,0.500000,-0.250000,-0.312500},
|
||||
{-0.500000,-0.375000,-0.500000,-0.062500,-0.250000,-0.312500},
|
||||
{-0.500000,-0.250000,-0.500000,-0.187500,-0.125000,-0.312500},
|
||||
{0.187500,-0.250000,-0.500000,0.500000,-0.125000,-0.312500},
|
||||
},
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.500000,-0.500000,-0.500000,0.500000,0.500000,-0.312500},
|
||||
},
|
||||
},
|
||||
})
|
||||
minetest.register_node("castle:arrowslit_"..name.."_hole", {
|
||||
drawtype = "nodebox",
|
||||
description = desc.." Arrowslit with Hole",
|
||||
tiles = {tile..".png"},
|
||||
groups = {cracky=3},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.500000,-0.375000,-0.500000,-0.125000,0.375000,-0.312500},
|
||||
{0.125000,-0.375000,-0.500000,0.500000,0.375000,-0.312500},
|
||||
{-0.500000,-0.500000,-0.500000,0.500000,-0.375000,-0.312500},
|
||||
{0.062500,-0.125000,-0.500000,0.125000,0.375000,-0.312500},
|
||||
{-0.125000,-0.125000,-0.500000,-0.062500,0.375000,-0.312500},
|
||||
{-0.500000,0.375000,-0.500000,0.500000,0.500000,-0.312500},
|
||||
},
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.500000,-0.500000,-0.500000,0.500000,0.500000,-0.312500},
|
||||
},
|
||||
},
|
||||
})
|
||||
if craft_material then
|
||||
--Choose craft material
|
||||
minetest.register_craft({
|
||||
output = "castle:arrowslit_"..name.." 6",
|
||||
recipe = {
|
||||
{craft_material,"", craft_material},
|
||||
{craft_material,"", craft_material},
|
||||
{craft_material,"", craft_material} },
|
||||
})
|
||||
end
|
||||
if craft_material then
|
||||
minetest.register_craft({
|
||||
output = "castle:arrowslit_"..name.."_cross",
|
||||
recipe = {
|
||||
{"castle:arrowslit_"..name} },
|
||||
})
|
||||
end
|
||||
if craft_material then
|
||||
minetest.register_craft({
|
||||
output = "castle:arrowslit_"..name.."_hole",
|
||||
recipe = {
|
||||
{"castle:arrowslit_"..name.."_cross"} },
|
||||
})
|
||||
end
|
||||
if craft_material then
|
||||
minetest.register_craft({
|
||||
output = "castle:arrowslit_"..name,
|
||||
recipe = {
|
||||
{"castle:arrowslit_"..name.."_hole"} },
|
||||
})
|
||||
end
|
||||
end
|
443
crossbow.lua
@ -1,443 +0,0 @@
|
||||
--[[
|
||||
Minetest Mod - Simple Shooter [shooter] 0.5.3
|
||||
=======================================
|
||||
|
||||
License Source Code: 2013 Stuart Jones - LGPL v2.1
|
||||
|
||||
License Textures: Stuart Jones - WTFPL
|
||||
|
||||
Licence Models: Stuart Jones - CC-BY-SA 3.0
|
||||
|
||||
License Sounds: freesound.org
|
||||
|
||||
--]]
|
||||
local crossbow={}
|
||||
|
||||
minetest.register_alias("crossbow", "castle:crossbow")
|
||||
minetest.register_alias("bolt", "castle:crossbow_bolt")
|
||||
|
||||
CROSSBOW_USES = 300
|
||||
CROSSBOW_BOLT_TOOL_CAPS = {damage_groups={fleshy=4}}
|
||||
CROSSBOW_BOLT_LIFETIME = 60-- 1 minute
|
||||
CROSSBOW_ENABLE_PARTICLE_FX = false
|
||||
CROSSBOW_ENABLE_PROTECTION = true
|
||||
CROSSBOW_EXPLOSION_TEXTURE = "castle_crossbow_hit.png"
|
||||
CROSSBOW_ALLOW_NODES = true
|
||||
CROSSBOW_ALLOW_ENTITIES = true
|
||||
CROSSBOW_ALLOW_PLAYERS = true
|
||||
CROSSBOW_PLAYER_OFFSET = {x=0, y=1, z=0}
|
||||
CROSSBOW_ENTITY_OFFSET = {x=0, y=0, z=0}
|
||||
CROSSBOW_ENTITIES = {
|
||||
"mobs:chicken",
|
||||
"mobs:cow",
|
||||
"mobs:dirt_monster",
|
||||
"mobs:dungeon_master",
|
||||
"mobs:goat",
|
||||
"mobs:mese_monster",
|
||||
"mobs:npc",
|
||||
"mobs:oerkki",
|
||||
"mobs:pig",
|
||||
"mobs:pumba",
|
||||
"mobs:rat",
|
||||
"mobs:rhino",
|
||||
"mobs:sand_monster",
|
||||
"mobs:sheep",
|
||||
"mobs:spider",
|
||||
"mobs:stone_monster",
|
||||
"mobs:tree_monster",
|
||||
}
|
||||
|
||||
if minetest.is_singleplayer() == true then
|
||||
CROSSBOW_ALLOW_ENTITIES = true
|
||||
CROSSBOW_ALLOW_PLAYERS = true
|
||||
end
|
||||
|
||||
local allowed_entities = {}
|
||||
for _,v in ipairs(CROSSBOW_ENTITIES) do
|
||||
allowed_entities[v] = 1
|
||||
end
|
||||
|
||||
local function get_dot_product(v1, v2)
|
||||
return v1.x * v2.x + v1.y * v2.y + v1.z * v2.z
|
||||
end
|
||||
|
||||
local function get_particle_pos(p, v, d)
|
||||
return vector.add(p, vector.multiply(v, {x=d, y=d, z=d}))
|
||||
end
|
||||
|
||||
function crossbow:spawn_particles(pos, texture)
|
||||
if CROSSBOW_ENABLE_PARTICLE_FX == true then
|
||||
if type(texture) ~= "string" then
|
||||
texture = CROSSBOW_EXPLOSION_TEXTURE
|
||||
end
|
||||
local spread = {x=0.1, y=0.1, z=0.1}
|
||||
minetest.add_particlespawner(15, 0.3,
|
||||
vector.subtract(pos, spread), vector.add(pos, spread),
|
||||
{x=-1, y=1, z=-1}, {x=1, y=2, z=1},
|
||||
{x=-2, y=-2, z=-2}, {x=2, y=-2, z=2},
|
||||
0.1, 0.75, 1, 2, false, texture
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
function crossbow:punch_node(pos, def)
|
||||
local node = minetest.get_node(pos)
|
||||
if not node then
|
||||
return
|
||||
end
|
||||
local item = minetest.registered_items[node.name]
|
||||
if not item then
|
||||
return
|
||||
end
|
||||
if CROSSBOW_ENABLE_PROTECTION then
|
||||
if minetest.is_protected(pos, def.name) then
|
||||
return
|
||||
end
|
||||
end
|
||||
if item.groups then
|
||||
for k, v in pairs(def.groups) do
|
||||
local level = item.groups[k] or 0
|
||||
if level >= v then
|
||||
minetest.remove_node(pos)
|
||||
if item.tiles then
|
||||
if item.tiles[1] then
|
||||
crossbow:spawn_particles(pos, item.tiles[1])
|
||||
end
|
||||
end
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function crossbow:is_valid_object(object)
|
||||
if object then
|
||||
if object:is_player() == true then
|
||||
return CROSSBOW_ALLOW_PLAYERS
|
||||
end
|
||||
if CROSSBOW_ALLOW_ENTITIES == true then
|
||||
local luaentity = object:get_luaentity()
|
||||
if luaentity then
|
||||
if luaentity.name then
|
||||
if allowed_entities[luaentity.name] then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function crossbow:get_intersect_pos(ray, plane, collisionbox)
|
||||
local v = vector.subtract(ray.pos, plane.pos)
|
||||
local r1 = get_dot_product(v, plane.normal)
|
||||
local r2 = get_dot_product(ray.dir, plane.normal)
|
||||
if r2 ~= 0 then
|
||||
local t = -(r1 / r2)
|
||||
local td = vector.multiply(ray.dir, {x=t, y=t, z=t})
|
||||
local pt = vector.add(ray.pos, td)
|
||||
local pd = vector.subtract(pt, plane.pos)
|
||||
if math.abs(pd.x) < collisionbox[4] and
|
||||
math.abs(pd.y) < collisionbox[5] and
|
||||
math.abs(pd.z) < collisionbox[6] then
|
||||
return pt
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function crossbow:process_round(round)
|
||||
local target = {object=nil, distance=10000}
|
||||
local p1 = round.pos
|
||||
local v1 = round.ray
|
||||
for _,ref in ipairs(castle.objects) do
|
||||
local p2 = vector.add(ref.pos, ref.offset)
|
||||
if p1 and p2 and ref.name ~= round.name then
|
||||
local d = vector.distance(p1, p2)
|
||||
if d < round.def.step and d < target.distance then
|
||||
local ray = {pos=p1, dir=v1}
|
||||
local plane = {pos=p2, normal={x=-1, y=0, z=-1}}
|
||||
local pos = crossbow:get_intersect_pos(ray, plane, ref.collisionbox)
|
||||
if pos then
|
||||
target.object = ref.object
|
||||
target.pos = pos
|
||||
target.distance = d
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
if target.object and target.pos then
|
||||
local success, pos = minetest.line_of_sight(p1, target.pos, 1)
|
||||
if success then
|
||||
local user = minetest.get_player_by_name(round.name)
|
||||
if user then
|
||||
target.object:punch(user, nil, round.def.tool_caps, v1)
|
||||
crossbow:spawn_particles(target.pos, CROSSBOW_EXPLOSION_TEXTURE)
|
||||
end
|
||||
return 1
|
||||
elseif pos and CROSSBOW_ALLOW_NODES == true then
|
||||
crossbow:punch_node(pos, round.def)
|
||||
return 1
|
||||
end
|
||||
elseif CROSSBOW_ALLOW_NODES == true then
|
||||
local d = round.def.step
|
||||
local p2 = vector.add(p1, vector.multiply(v1, {x=d, y=d, z=d}))
|
||||
local success, pos = minetest.line_of_sight(p1, p2, 1)
|
||||
if pos then
|
||||
crossbow:punch_node(pos, round.def)
|
||||
return 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function get_animation_frame(dir)
|
||||
local angle = math.atan(dir.y)
|
||||
local frame = 90 - math.floor(angle * 360 / math.pi)
|
||||
if frame < 1 then
|
||||
frame = 1
|
||||
elseif frame > 180 then
|
||||
frame = 180
|
||||
end
|
||||
return frame
|
||||
end
|
||||
|
||||
local function get_target_pos(p1, p2, dir, offset)
|
||||
local d = vector.distance(p1, p2) - offset
|
||||
local td = vector.multiply(dir, {x=d, y=d, z=d})
|
||||
return vector.add(p1, td)
|
||||
end
|
||||
|
||||
local function punch_object(puncher, object)
|
||||
if puncher and crossbow:is_valid_object(object) then
|
||||
if puncher ~= object then
|
||||
local dir = puncher:get_look_dir()
|
||||
local p1 = puncher:getpos()
|
||||
local p2 = object:getpos()
|
||||
local tpos = get_target_pos(p1, p2, dir, 0)
|
||||
crossbow:spawn_particles(tpos, CROSSBOW_EXPLOSION_TEXTURE)
|
||||
object:punch(puncher, nil, CROSSBOW_BOLT_TOOL_CAPS, dir)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function stop_crossbow_bolt(object, pos, stuck)
|
||||
local acceleration = {x=0, y=-10, z=0}
|
||||
if stuck == true then
|
||||
pos = pos or object:getpos()
|
||||
acceleration = {x=0, y=0, z=0}
|
||||
object:moveto(pos)
|
||||
end
|
||||
object:set_properties({
|
||||
physical = true,
|
||||
collisionbox = {-1/8,-1/8,-1/8, 1/8,1/8,1/8},
|
||||
})
|
||||
object:setvelocity({x=0, y=0, z=0})
|
||||
object:setacceleration(acceleration)
|
||||
end
|
||||
|
||||
minetest.register_craftitem("castle:crossbow_bolt", {
|
||||
description = "Bolt",
|
||||
stack_max = 20,
|
||||
inventory_image = "castle_crossbow_bolt_inv.png",
|
||||
})
|
||||
|
||||
minetest.register_entity("castle:crossbow_bolt_entity", {
|
||||
physical = false,
|
||||
visual = "mesh",
|
||||
mesh = "castle_crossbow_bolt.b3d",
|
||||
visual_size = {x=1.0, y=1.0},
|
||||
textures = {
|
||||
"castle_crossbow_bolt_uv.png"
|
||||
},
|
||||
timer = 0,
|
||||
lifetime = CROSSBOW_BOLT_LIFETIME,
|
||||
player = nil,
|
||||
state = "init",
|
||||
node_pos = nil,
|
||||
collisionbox = {0,0,0, 0,0,0},
|
||||
on_activate = function(self, staticdata)
|
||||
self.object:set_armor_groups({immortal=1})
|
||||
if staticdata == "expired" then
|
||||
self.object:remove()
|
||||
end
|
||||
end,
|
||||
on_punch = function(self, puncher)
|
||||
if puncher then
|
||||
if puncher:is_player() then
|
||||
local stack = "castle:crossbow_bolt"
|
||||
local inv = puncher:get_inventory()
|
||||
if inv:room_for_item("main", stack) then
|
||||
inv:add_item("main", stack)
|
||||
self.object:remove()
|
||||
end
|
||||
end
|
||||
end
|
||||
end,
|
||||
on_step = function(self, dtime)
|
||||
if self.state == "init" then
|
||||
return
|
||||
end
|
||||
self.timer = self.timer + dtime
|
||||
self.lifetime = self.lifetime - dtime
|
||||
if self.lifetime < 0 then
|
||||
self.object:remove()
|
||||
return
|
||||
elseif self.state == "dropped" then
|
||||
return
|
||||
elseif self.state == "stuck" then
|
||||
if self.timer > 1 then
|
||||
if self.node_pos then
|
||||
local node = minetest.get_node(self.node_pos)
|
||||
if node.name then
|
||||
local item = minetest.registered_items[node.name]
|
||||
if item then
|
||||
if not item.walkable then
|
||||
self.state = "dropped"
|
||||
stop_crossbow_bolt(self.object)
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
self.timer = 0
|
||||
end
|
||||
return
|
||||
end
|
||||
if self.timer > 0.2 then
|
||||
local pos = self.object:getpos()
|
||||
local dir = vector.normalize(self.object:getvelocity())
|
||||
local frame = get_animation_frame(dir)
|
||||
self.object:set_animation({x=frame, y=frame}, 0)
|
||||
local objects = minetest.get_objects_inside_radius(pos, 5)
|
||||
for _,obj in ipairs(objects) do
|
||||
if crossbow:is_valid_object(obj) then
|
||||
local collisionbox = {-0.25,-1.0,-0.25, 0.25,0.8,0.25}
|
||||
local offset = CROSSBOW_PLAYER_OFFSET
|
||||
if not obj:is_player() then
|
||||
offset = CROSSBOW_ENTITY_OFFSET
|
||||
local ent = obj:get_luaentity()
|
||||
if ent then
|
||||
local def = minetest.registered_entities[ent.name]
|
||||
collisionbox = def.collisionbox or collisionbox
|
||||
end
|
||||
end
|
||||
local opos = vector.add(obj:getpos(), offset)
|
||||
local ray = {pos=pos, dir=dir}
|
||||
local plane = {pos=opos, normal={x=-1, y=0, z=-1}}
|
||||
local ipos = crossbow:get_intersect_pos(ray, plane, collisionbox)
|
||||
if ipos then
|
||||
punch_object(self.player, obj)
|
||||
end
|
||||
end
|
||||
end
|
||||
local p = vector.add(pos, vector.multiply(dir, {x=5, y=5, z=5}))
|
||||
local _, npos = minetest.line_of_sight(pos, p, 1)
|
||||
if npos then
|
||||
local node = minetest.get_node(npos)
|
||||
local tpos = get_target_pos(pos, npos, dir, 0.66)
|
||||
self.node_pos = npos
|
||||
self.state = "stuck"
|
||||
stop_crossbow_bolt(self.object, tpos, true)
|
||||
minetest.sound_play("castle_crossbow_bolt", {gain = 0.08, max_hear_distance = 2})
|
||||
end
|
||||
self.timer = 0
|
||||
end
|
||||
end,
|
||||
get_staticdata = function(self)
|
||||
return "expired"
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_tool("castle:crossbow_loaded", {
|
||||
description = "Crossbow",
|
||||
inventory_image = "castle_crossbow_loaded.png",
|
||||
groups = {not_in_creative_inventory=1},
|
||||
on_use = function(itemstack, user, pointed_thing)
|
||||
minetest.sound_play("castle_crossbow_click", {object=user})
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:add_wear(65535/CROSSBOW_USES)
|
||||
end
|
||||
itemstack = "castle:crossbow 1 "..itemstack:get_wear()
|
||||
local pos = user:getpos()
|
||||
local dir = user:get_look_dir()
|
||||
local yaw = user:get_look_yaw()
|
||||
if pos and dir and yaw then
|
||||
pos.y = pos.y + 1.5
|
||||
local obj = minetest.add_entity(pos, "castle:crossbow_bolt_entity")
|
||||
local ent = nil
|
||||
if obj then
|
||||
ent = obj:get_luaentity()
|
||||
end
|
||||
if ent then
|
||||
obj:set_properties({
|
||||
textures = {"castle_crossbow_bolt_uv.png"}
|
||||
})
|
||||
minetest.sound_play("castle_crossbow_shoot", {object=obj})
|
||||
local frame = get_animation_frame(dir)
|
||||
obj:setyaw(yaw + math.pi)
|
||||
obj:set_animation({x=frame, y=frame}, 0)
|
||||
obj:setvelocity({x=dir.x * 14, y=dir.y * 14, z=dir.z * 14})
|
||||
if pointed_thing.type ~= "nothing" then
|
||||
local ppos = minetest.get_pointed_thing_position(pointed_thing, false)
|
||||
local _, npos = minetest.line_of_sight(pos, ppos, 1)
|
||||
if npos then
|
||||
ppos = npos
|
||||
pointed_thing.type = "node"
|
||||
end
|
||||
if pointed_thing.type == "object" then
|
||||
punch_object(user, pointed_thing.ref)
|
||||
elseif pointed_thing.type == "node" then
|
||||
local node = minetest.get_node(ppos)
|
||||
local tpos = get_target_pos(pos, ppos, dir, 0.66)
|
||||
minetest.after(0.2, function(object, pos, npos)
|
||||
ent.node_pos = npos
|
||||
ent.state = "stuck"
|
||||
stop_crossbow_bolt(object, pos, true)
|
||||
minetest.sound_play("castle_crossbow_bolt", {gain = 0.08, max_hear_distance = 2})
|
||||
end, obj, tpos, ppos)
|
||||
return itemstack
|
||||
end
|
||||
end
|
||||
obj:setacceleration({x=dir.x * -3, y=-5, z=dir.z * -3})
|
||||
ent.player = ent.player or user
|
||||
ent.state = "flight"
|
||||
end
|
||||
end
|
||||
return itemstack
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_tool("castle:crossbow", {
|
||||
description = "Crossbow",
|
||||
inventory_image = "castle_crossbow_inv.png",
|
||||
on_use = function(itemstack, user, pointed_thing)
|
||||
local inv = user:get_inventory()
|
||||
if inv:contains_item("main", "castle:crossbow_bolt") then
|
||||
minetest.sound_play("castle_crossbow_reload", {object=user})
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
inv:remove_item("main", "castle:crossbow_bolt 1")
|
||||
end
|
||||
return "castle:crossbow_loaded 1 "..itemstack:get_wear()
|
||||
end
|
||||
minetest.sound_play("castle_crossbow_click", {object=user})
|
||||
end,
|
||||
})
|
||||
|
||||
-----------
|
||||
--Crafting
|
||||
-----------
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'castle:crossbow',
|
||||
recipe = {
|
||||
{'default:steel_ingot', 'default:stick', 'default:steel_ingot'},
|
||||
{'farming:string', 'farming:string', 'farming:string'},
|
||||
{'', 'default:stick', ''},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "castle:crossbow_bolt 6",
|
||||
recipe = {
|
||||
{'default:stick', 'default:stick', 'default:steel_ingot'},
|
||||
}
|
||||
})
|
@ -1,9 +0,0 @@
|
||||
default
|
||||
stairs
|
||||
doors
|
||||
farming
|
||||
building_blocks?
|
||||
asphalt?
|
||||
streets?
|
||||
moreblocks?
|
||||
xpanes?
|
@ -1 +0,0 @@
|
||||
This is a mod all about creating castles and castle dungeons. Many of the nodes are used for the outer-walls or dungeons.
|
391
init.lua
@ -1,390 +1 @@
|
||||
dofile(minetest.get_modpath("castle").."/pillars.lua")
|
||||
dofile(minetest.get_modpath("castle").."/arrowslit.lua")
|
||||
dofile(minetest.get_modpath("castle").."/tapestry.lua")
|
||||
dofile(minetest.get_modpath("castle").."/jailbars.lua")
|
||||
dofile(minetest.get_modpath("castle").."/town_item.lua")
|
||||
dofile(minetest.get_modpath("castle").."/shields_decor.lua")
|
||||
dofile(minetest.get_modpath("castle").."/murder_hole.lua")
|
||||
dofile(minetest.get_modpath("castle").."/orbs.lua")
|
||||
dofile(minetest.get_modpath("castle").."/rope.lua")
|
||||
dofile(minetest.get_modpath("castle").."/crossbow.lua")
|
||||
|
||||
minetest.register_node("castle:stonewall", {
|
||||
description = "Castle Wall",
|
||||
drawtype = "normal",
|
||||
tiles = {"castle_stonewall.png"},
|
||||
paramtype = "light",
|
||||
drop = "castle:stonewall",
|
||||
groups = {cracky=3},
|
||||
sunlight_propagates = false,
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("castle:rubble", {
|
||||
description = "Castle Rubble",
|
||||
drawtype = "normal",
|
||||
tiles = {"castle_rubble.png"},
|
||||
paramtype = "light",
|
||||
groups = {crumbly=3,falling_node=1},
|
||||
sounds = default.node_sound_gravel_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "castle:stonewall",
|
||||
recipe = {
|
||||
{"default:cobble"},
|
||||
{"default:desert_stone"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "castle:rubble",
|
||||
recipe = {
|
||||
{"castle:stonewall"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "castle:rubble 2",
|
||||
recipe = {
|
||||
{"default:gravel"},
|
||||
{"default:desert_stone"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_node("castle:stonewall_corner", {
|
||||
drawtype = "normal",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
description = "Castle Corner",
|
||||
tiles = {"castle_corner_stonewall_tb.png^[transformR90",
|
||||
"castle_corner_stonewall_tb.png^[transformR180",
|
||||
"castle_corner_stonewall1.png",
|
||||
"castle_stonewall.png",
|
||||
"castle_stonewall.png",
|
||||
"castle_corner_stonewall2.png"},
|
||||
groups = {cracky=3},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "castle:stonewall_corner",
|
||||
recipe = {
|
||||
{"", "castle:stonewall"},
|
||||
{"castle:stonewall", "default:sandstone"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_node("castle:roofslate", {
|
||||
drawtype = "raillike",
|
||||
description = "Roof Slates",
|
||||
inventory_image = "castle_slate.png",
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
tiles = {'castle_slate.png'},
|
||||
climbable = true,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
|
||||
},
|
||||
groups = {cracky=3,attached_node=1},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("castle:hides", {
|
||||
drawtype = "signlike",
|
||||
description = "Hides",
|
||||
inventory_image = "castle_hide.png",
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
tiles = {'castle_hide.png'},
|
||||
climbable = true,
|
||||
paramtype2 = "wallmounted",
|
||||
legacy_wallmounted = true,
|
||||
groups = {dig_immediate=2},
|
||||
selection_box = {
|
||||
type = "wallmounted",
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
type = "shapeless",
|
||||
output = "castle:hides 6",
|
||||
recipe = { "wool:white" , "bucket:bucket_water" },
|
||||
replacements = {
|
||||
{ 'bucket:bucket_water', 'bucket:bucket_empty' }
|
||||
}
|
||||
})
|
||||
|
||||
local mod_building_blocks = minetest.get_modpath("building_blocks")
|
||||
local mod_streets = minetest.get_modpath("streets") or minetest.get_modpath("asphalt")
|
||||
|
||||
if mod_building_blocks then
|
||||
minetest.register_craft({
|
||||
output = "castle:roofslate 4",
|
||||
recipe = {
|
||||
{ "building_blocks:Tar" , "default:gravel" },
|
||||
{ "default:gravel", "building_blocks:Tar" }
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "castle:roofslate 4",
|
||||
recipe = {
|
||||
{ "default:gravel", "building_blocks:Tar" },
|
||||
{ "building_blocks:Tar" , "default:gravel" }
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
if mod_streets then
|
||||
minetest.register_craft( {
|
||||
output = "castle:roofslate 4",
|
||||
recipe = {
|
||||
{ "streets:asphalt" , "default:gravel" },
|
||||
{ "default:gravel", "streets:asphalt" }
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "castle:roofslate 4",
|
||||
recipe = {
|
||||
{ "default:gravel", "streets:asphalt" },
|
||||
{ "streets:asphalt" , "default:gravel" }
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
if not (mod_building_blocks or mod_streets) then
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
output = "castle:roofslate",
|
||||
recipe = "default:gravel",
|
||||
})
|
||||
|
||||
end
|
||||
|
||||
doors.register("castle:oak_door", {
|
||||
tiles = {{ name = "castle_door_oak.png", backface_culling = true }},
|
||||
description = "Oak Door",
|
||||
inventory_image = "castle_oak_door_inv.png",
|
||||
protected = true,
|
||||
groups = { choppy = 2, door = 1 },
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
recipe = {
|
||||
{"default:tree", "default:tree"},
|
||||
{"default:tree", "default:tree"},
|
||||
{"default:tree", "default:tree"},
|
||||
}
|
||||
})
|
||||
|
||||
doors.register("castle:jail_door", {
|
||||
tiles = {{ name = "castle_door_jail.png", backface_culling = true }},
|
||||
description = "Jail Door",
|
||||
inventory_image = "castle_jail_door_inv.png",
|
||||
protected = true,
|
||||
groups = { cracky = 2, door = 1},
|
||||
sound_open = "doors_steel_door_open",
|
||||
sound_close = "doors_steel_door_close",
|
||||
recipe = {
|
||||
{"castle:jailbars", "castle:jailbars"},
|
||||
{"castle:jailbars", "castle:jailbars"},
|
||||
{"castle:jailbars", "castle:jailbars"},
|
||||
}
|
||||
})
|
||||
|
||||
function default.get_ironbound_chest_formspec(pos)
|
||||
local spos = pos.x .. "," .. pos.y .. "," ..pos.z
|
||||
local formspec =
|
||||
"size[8,9]"..
|
||||
default.gui_bg ..
|
||||
default.gui_bg_img ..
|
||||
default.gui_slots ..
|
||||
"list[nodemeta:".. spos .. ";main;0,0;8,4;]"..
|
||||
"list[current_player;main;0,5;8,4;]"
|
||||
return formspec
|
||||
end
|
||||
|
||||
local function has_ironbound_chest_privilege(meta, player)
|
||||
local name = ""
|
||||
if player then
|
||||
if minetest.check_player_privs(player, "protection_bypass") then
|
||||
return true
|
||||
end
|
||||
name = player:get_player_name()
|
||||
end
|
||||
if name ~= meta:get_string("owner") then
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
minetest.register_node("castle:ironbound_chest",{
|
||||
drawtype = "nodebox",
|
||||
description = "Ironbound Chest",
|
||||
tiles = {"castle_ironbound_chest_top.png",
|
||||
"castle_ironbound_chest_top.png",
|
||||
"castle_ironbound_chest_side.png",
|
||||
"castle_ironbound_chest_side.png",
|
||||
"castle_ironbound_chest_back.png",
|
||||
"castle_ironbound_chest_front.png"},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {cracky=2},
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.500000,-0.500000,-0.312500,0.500000,-0.062500,0.312500},
|
||||
{-0.500000,-0.062500,-0.250000,0.500000,0.000000,0.250000},
|
||||
{-0.500000,0.000000,-0.187500,0.500000,0.062500,0.187500},
|
||||
{-0.500000,0.062500,-0.062500,0.500000,0.125000,0.062500},
|
||||
},
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5,-0.500000,-0.400000,0.5,0.200000,0.4},
|
||||
|
||||
},
|
||||
},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
after_place_node = function(pos, placer)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("owner", placer:get_player_name() or "")
|
||||
meta:set_string("infotext", "Ironbound Chest (owned by "..
|
||||
meta:get_string("owner")..")")
|
||||
end,
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("infotext", "Ironbound Chest")
|
||||
meta:set_string("owner", "")
|
||||
local inv = meta:get_inventory()
|
||||
inv:set_size("main", 8*4)
|
||||
end,
|
||||
can_dig = function(pos,player)
|
||||
local meta = minetest.get_meta(pos);
|
||||
local inv = meta:get_inventory()
|
||||
return inv:is_empty("main") and has_ironbound_chest_privilege(meta, player)
|
||||
end,
|
||||
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if not has_ironbound_chest_privilege(meta, player) then
|
||||
minetest.log("action", player:get_player_name()..
|
||||
" tried to access a locked chest belonging to "..
|
||||
meta:get_string("owner").." at "..
|
||||
minetest.pos_to_string(pos))
|
||||
return 0
|
||||
end
|
||||
return count
|
||||
end,
|
||||
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if not has_ironbound_chest_privilege(meta, player) then
|
||||
minetest.log("action", player:get_player_name()..
|
||||
" tried to access a locked chest belonging to "..
|
||||
meta:get_string("owner").." at "..
|
||||
minetest.pos_to_string(pos))
|
||||
return 0
|
||||
end
|
||||
return stack:get_count()
|
||||
end,
|
||||
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if not has_ironbound_chest_privilege(meta, player) then
|
||||
minetest.log("action", player:get_player_name()..
|
||||
" tried to access a locked chest belonging to "..
|
||||
meta:get_string("owner").." at "..
|
||||
minetest.pos_to_string(pos))
|
||||
return 0
|
||||
end
|
||||
return stack:get_count()
|
||||
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 locked 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 locked 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 locked chest at "..minetest.pos_to_string(pos))
|
||||
end,
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if has_ironbound_chest_privilege(meta, clicker) then
|
||||
minetest.show_formspec(
|
||||
clicker:get_player_name(),
|
||||
"castle:ironbound_chest",
|
||||
default.get_ironbound_chest_formspec(pos)
|
||||
)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "castle:ironbound_chest",
|
||||
recipe = {
|
||||
{"default:wood", "default:steel_ingot","default:wood"},
|
||||
{"default:wood", "default:steel_ingot","default:wood"}
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_tool("castle:battleaxe", {
|
||||
description = "Battleaxe",
|
||||
inventory_image = "castle_battleaxe.png",
|
||||
tool_capabilities = {
|
||||
full_punch_interval = 2.0,
|
||||
max_drop_level=1,
|
||||
groupcaps={
|
||||
choppy={times={[1]=2.10, [2]=0.90, [3]=0.50}, uses=20, maxlevel=3},
|
||||
snappy={times={[1]=1.90, [2]=0.90, [3]=0.30}, uses=20, maxlevel=3},
|
||||
},
|
||||
damage_groups = {fleshy=7},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "castle:battleaxe",
|
||||
recipe = {
|
||||
{"default:steel_ingot", "default:steel_ingot","default:steel_ingot"},
|
||||
{"default:steel_ingot", "default:stick","default:steel_ingot"},
|
||||
{"", "default:stick",""}
|
||||
}
|
||||
})
|
||||
|
||||
if minetest.get_modpath("moreblocks") then
|
||||
stairsplus:register_all("castle", "stonewall", "castle:stonewall", {
|
||||
description = "Stone Wall",
|
||||
tiles = {"castle_stonewall.png"},
|
||||
groups = {cracky=3, not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
sunlight_propagates = true,
|
||||
})
|
||||
|
||||
stairsplus:register_all("castle", "rubble", "castle:rubble", {
|
||||
description = "Rubble",
|
||||
tiles = {"castle_rubble.png"},
|
||||
groups = {cracky=3, not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_gravel_defaults(),
|
||||
sunlight_propagates = true,
|
||||
})
|
||||
|
||||
else
|
||||
stairs.register_stair_and_slab("stonewall", "castle:stonewall",
|
||||
{cracky=3},
|
||||
{"castle_stonewall.png"},
|
||||
"Castle Stonewall Stair",
|
||||
"Castle Stonewall Slab",
|
||||
default.node_sound_stone_defaults()
|
||||
)
|
||||
|
||||
stairs.register_stair_and_slab("rubble", "castle:rubble",
|
||||
{cracky=3},
|
||||
{"castle_rubble.png"},
|
||||
"Castle Rubble Stair",
|
||||
"Castle Rubble Slab",
|
||||
default.node_sound_stone_defaults()
|
||||
)
|
||||
end
|
||||
-- Empty
|
22
jailbars.lua
@ -1,22 +0,0 @@
|
||||
if minetest.get_modpath("xpanes") then
|
||||
xpanes.register_pane("jailbars", {
|
||||
description = "Jail Bars",
|
||||
tiles = {"castle_jailbars.png"},
|
||||
drawtype = "airlike",
|
||||
paramtype = "light",
|
||||
textures = {"castle_jailbars.png", "castle_jailbars.png", "xpanes_space.png"},
|
||||
inventory_image = "castle_jailbars.png",
|
||||
wield_image = "castle_jailbars.png",
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
groups = {cracky=1, pane=1},
|
||||
recipe = {
|
||||
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
|
||||
{"default:steel_ingot", "", "default:steel_ingot"},
|
||||
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"}},
|
||||
})
|
||||
end
|
||||
|
||||
for i = 1, 15 do
|
||||
minetest.register_alias("castle:jailbars_"..i, "xpanes:jailbars_"..i)
|
||||
end
|
||||
minetest.register_alias("castle:jailbars", "xpanes:jailbars")
|
3
mod.conf
@ -1 +1,4 @@
|
||||
name = castle
|
||||
title = Castles++
|
||||
description = This is a modpack all about creating castles and castle dungeons.
|
||||
depends = anvil, castle_farming, castle_gates, castle_lighting, castle_masonry, castle_shields, castle_storage, castle_tapestries, castle_weapons, crafting_bench, orbs_of_time, ropes
|
||||
|
@ -1,10 +0,0 @@
|
||||
License Textures: Stuart Jones - WTFPL
|
||||
|
||||
-castle_crossbow_bolt_inv.png
|
||||
-castle_crossbow_bolt_uv.png
|
||||
-castle_crossbow_hit.png
|
||||
|
||||
Licence Models: Stuart Jones - CC-BY-SA 3.0
|
||||
|
||||
-castle_crossbow_bolt.b3d
|
||||
-castle_crossbow_bolt.blend
|
Before Width: | Height: | Size: 157 B |
@ -1,50 +0,0 @@
|
||||
local hole = {}
|
||||
|
||||
hole.types = {
|
||||
{"stonewall", "Stonewall", "castle_stonewall", "castle:stonewall"},
|
||||
{"cobble", "Cobble", "default_cobble", "default:cobble"},
|
||||
{"stonebrick", "Stonebrick", "default_stone_brick", "default:stonebrick"},
|
||||
{"sandstonebrick", "Sandstone Brick", "default_sandstone_brick", "default:sandstonebrick"},
|
||||
{"desertstonebrick", "Desert Stone Brick", "default_desert_stone_brick", "default:desert_stonebrick"},
|
||||
{"stone", "Stone", "default_stone", "default:stone"},
|
||||
{"sandstone", "Sandstone", "default_sandstone", "default:sandstone"},
|
||||
{"desertstone", "Desert Stone", "default_desert_stone", "default:desert_stone"},
|
||||
}
|
||||
|
||||
for _, row in ipairs(hole.types) do
|
||||
local name = row[1]
|
||||
local desc = row[2]
|
||||
local tile = row[3]
|
||||
local craft_material = row[4]
|
||||
-- Node Definition
|
||||
minetest.register_node("castle:hole_"..name, {
|
||||
drawtype = "nodebox",
|
||||
description = desc.." Murder Hole",
|
||||
tiles = {tile..".png"},
|
||||
groups = {cracky=3},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-8/16,-8/16,-8/16,-4/16,8/16,8/16},
|
||||
{4/16,-8/16,-8/16,8/16,8/16,8/16},
|
||||
{-4/16,-8/16,-8/16,4/16,8/16,-4/16},
|
||||
{-4/16,-8/16,8/16,4/16,8/16,4/16},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
if craft_material then
|
||||
--Choose craft material
|
||||
minetest.register_craft({
|
||||
output = "castle:hole_"..name.." 4",
|
||||
recipe = {
|
||||
{"",craft_material, "" },
|
||||
{craft_material,"", craft_material},
|
||||
{"",craft_material, ""} },
|
||||
})
|
||||
end
|
||||
end
|
||||
|
58
orbs.lua
@ -1,58 +0,0 @@
|
||||
|
||||
----------
|
||||
--Tools
|
||||
----------
|
||||
|
||||
minetest.register_tool("castle:orb_day", {
|
||||
description = "Orb of Midday",
|
||||
tiles = {"castle_orb_day.png"},
|
||||
inventory_image = "castle_orb_day.png",
|
||||
wield_image = "castle_orb_day_weild.png",
|
||||
stack_max=1,
|
||||
on_use = function(itemstack, user)
|
||||
minetest.sound_play("castle_orbs", {pos=pos, loop=false})
|
||||
minetest.set_timeofday(0.5)
|
||||
minetest.sound_play("castle_birds", {pos=pos, loop=false})
|
||||
--1 use per diamond used in crafting :)
|
||||
itemstack:add_wear(65535/8)
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_tool("castle:orb_night",{
|
||||
description = "Orb of Midnight",
|
||||
tiles = {"castle_orb_night.png"},
|
||||
inventory_image = "castle_orb_night.png",
|
||||
wield_image = "castle_orb_night_weild.png",
|
||||
stack_max=1,
|
||||
on_use = function(itemstack, user)
|
||||
minetest.sound_play("castle_orbs", {pos=pos, loop=false})
|
||||
minetest.set_timeofday(0)
|
||||
minetest.sound_play("castle_owl", {pos=pos, loop=false})
|
||||
--1 use per diamond used in crafting :)
|
||||
itemstack:add_wear(65535/8)
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
-----------
|
||||
--Crafting
|
||||
-----------
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "castle:orb_day",
|
||||
recipe = {
|
||||
{"default:diamond", "default:diamond","default:diamond"},
|
||||
{"default:diamond", "default:mese_crystal","default:diamond"},
|
||||
{"default:diamond", "default:diamond","default:diamond"}
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "castle:orb_night",
|
||||
recipe = {
|
||||
{"default:diamond", "default:diamond","default:diamond"},
|
||||
{"default:diamond", "default:obsidian_shard","default:diamond"},
|
||||
{"default:diamond", "default:diamond","default:diamond"}
|
||||
},
|
||||
})
|
108
pillars.lua
@ -1,108 +0,0 @@
|
||||
minetest.register_alias("castle:pillars_bottom", "castle:pillars_stonewall_bottom")
|
||||
minetest.register_alias("castle:pillars_top", "castle:pillars_stonewall_top")
|
||||
minetest.register_alias("castle:pillars_middle", "castle:pillars_stonewall_middle")
|
||||
|
||||
local pillar = {}
|
||||
|
||||
pillar.types = {
|
||||
{"stonewall", "Stonewall", "castle_stonewall", "castle:stonewall"},
|
||||
{"cobble", "Cobble", "default_cobble", "default:cobble"},
|
||||
{"stonebrick", "Stonebrick", "default_stone_brick", "default:stonebrick"},
|
||||
{"sandstonebrick", "Sandstone Brick", "default_sandstone_brick", "default:sandstonebrick"},
|
||||
{"desertstonebrick", "Desert Stone Brick", "default_desert_stone_brick", "default:desert_stonebrick"},
|
||||
{"stone", "Stone", "default_stone", "default:stone"},
|
||||
{"sandstone", "Sandstone", "default_sandstone", "default:sandstone"},
|
||||
{"desertstone", "Desert Stone", "default_desert_stone", "default:desert_stone"},
|
||||
}
|
||||
|
||||
for _, row in ipairs(pillar.types) do
|
||||
local name = row[1]
|
||||
local desc = row[2]
|
||||
local tile = row[3]
|
||||
local craft_material = row[4]
|
||||
-- Node Definition
|
||||
minetest.register_node("castle:pillars_"..name.."_bottom", {
|
||||
drawtype = "nodebox",
|
||||
description = desc.." Pillar Base",
|
||||
tiles = {tile..".png"},
|
||||
groups = {cracky=3,attached_node=1},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.500000,-0.500000,-0.500000,0.500000,-0.375000,0.500000},
|
||||
{-0.375000,-0.375000,-0.375000,0.375000,-0.125000,0.375000},
|
||||
{-0.250000,-0.125000,-0.250000,0.250000,0.500000,0.250000},
|
||||
},
|
||||
},
|
||||
})
|
||||
minetest.register_node("castle:pillars_"..name.."_top", {
|
||||
drawtype = "nodebox",
|
||||
description = desc.." Pillar Top",
|
||||
tiles = {tile..".png"},
|
||||
groups = {cracky=3,attached_node=1},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.500000,0.312500,-0.500000,0.500000,0.500000,0.500000},
|
||||
{-0.375000,0.062500,-0.375000,0.375000,0.312500,0.375000},
|
||||
{-0.250000,-0.500000,-0.250000,0.250000,0.062500,0.250000},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_node("castle:pillars_"..name.."_middle", {
|
||||
drawtype = "nodebox",
|
||||
description = desc.." Pillar Middle",
|
||||
tiles = {tile..".png"},
|
||||
groups = {cracky=3,attached_node=1},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.250000,-0.500000,-0.250000,0.250000,0.500000,0.250000},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
if craft_material then
|
||||
--Choose craft material
|
||||
minetest.register_craft({
|
||||
output = "castle:pillars_"..name.."_bottom 4",
|
||||
recipe = {
|
||||
{"",craft_material,""},
|
||||
{"",craft_material,""},
|
||||
{craft_material,craft_material,craft_material} },
|
||||
})
|
||||
end
|
||||
|
||||
if craft_material then
|
||||
--Choose craft material
|
||||
minetest.register_craft({
|
||||
output = "castle:pillars_"..name.."_top 4",
|
||||
recipe = {
|
||||
{craft_material,craft_material,craft_material},
|
||||
{"",craft_material,""},
|
||||
{"",craft_material,""} },
|
||||
})
|
||||
end
|
||||
|
||||
if craft_material then
|
||||
--Choose craft material
|
||||
minetest.register_craft({
|
||||
output = "castle:pillars_"..name.."_middle 4",
|
||||
recipe = {
|
||||
{craft_material,craft_material},
|
||||
{craft_material,craft_material},
|
||||
{craft_material,craft_material} },
|
||||
})
|
||||
end
|
||||
end
|
||||
|
124
rope.lua
@ -1,124 +0,0 @@
|
||||
minetest.register_node("castle:ropes",{
|
||||
description = "Rope",
|
||||
drawtype = "nodebox",
|
||||
sunlight_propagates = true,
|
||||
tiles = {"castle_ropes.png"},
|
||||
groups = {choppy=3,snappy=3,oddly_breakable_by_hand=3,flammable=1},
|
||||
sounds = default.node_sound_defaults(),
|
||||
paramtype = "light",
|
||||
climbable = true,
|
||||
walkable = false,
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-1/16, -8/16, -1/16, 1/16, 8/16, 1/16},
|
||||
},
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-1/16, -8/16, -1/16, 1/16, 8/16, 1/16},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "castle:ropes",
|
||||
recipe = {
|
||||
{"farming:string"},
|
||||
{"farming:string"},
|
||||
{"farming:string"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_node("castle:box_rope", {
|
||||
description = "Rope from Ropebox",
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
tiles = {"castle_ropes.png"},
|
||||
groups = {not_in_creative_inventory=1},
|
||||
climbable = true,
|
||||
walkable = false,
|
||||
diggable = false,
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-1/16, -8/16, -1/16, 1/16, 8/16, 1/16},
|
||||
},
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-1/16, -8/16, -1/16, 1/16, 8/16, 1/16},
|
||||
},
|
||||
},
|
||||
after_destruct = function(pos,oldnode)
|
||||
local node = minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z})
|
||||
if node.name == "castle:box_rope" then
|
||||
minetest.remove_node({x=pos.x,y=pos.y-1,z=pos.z})
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("castle:ropebox", {
|
||||
description = "Ropebox",
|
||||
drawtype = "nodebox",
|
||||
sunlight_propagates = true,
|
||||
tiles = {"castle_ropebox_top.png",
|
||||
"castle_ropebox_top.png",
|
||||
"castle_ropebox_side_1.png",
|
||||
"castle_ropebox_side_1.png",
|
||||
"castle_ropebox_side_2.png",
|
||||
"castle_ropebox_side_2.png"},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {choppy=3},
|
||||
sounds = default.node_sound_defaults(),
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-2/16, -2/16, -4/16, 2/16, 2/16, 4/16},
|
||||
{-2/16, -4/16, -2/16, 2/16, 4/16, 2/16},
|
||||
{-2/16, -3/16, -3/16, 2/16, 3/16, 3/16},
|
||||
{-3/16, -2/16, -2/16, -2/16, 8/16, 2/16},
|
||||
{2/16, -2/16, -2/16, 3/16, 8/16, 2/16},
|
||||
{-1/16, -8/16, -1/16, 1/16, -4/16, 1/16},
|
||||
},
|
||||
},
|
||||
after_destruct = function(pos,oldnode)
|
||||
local node = minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z})
|
||||
if node.name == "castle:box_rope" then
|
||||
minetest.remove_node({x=pos.x,y=pos.y-1,z=pos.z})
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"castle:ropebox"},
|
||||
interval = 1,
|
||||
chance = 1,
|
||||
action = function(pos, node)
|
||||
if minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z}).name ~= 'air' then return end
|
||||
minetest.add_node({x=pos.x,y=pos.y-1,z=pos.z}, {name="castle:box_rope"})
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"castle:box_rope"},
|
||||
interval = 1,
|
||||
chance = 1,
|
||||
action = function(pos, node)
|
||||
if minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z}).name ~= 'air' then return end
|
||||
minetest.add_node({x=pos.x,y=pos.y-1,z=pos.z}, {name="castle:box_rope"})
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "castle:ropebox",
|
||||
recipe = {
|
||||
{"default:wood"},
|
||||
{"castle:ropes"},
|
||||
}
|
||||
})
|
||||
|
@ -1,103 +0,0 @@
|
||||
minetest.register_node("castle:shield",{
|
||||
description = "Mounted Shield",
|
||||
tiles = {"castle_shield_side.png", "castle_shield_side.png", "castle_shield_side.png", "castle_shield_side.png", "castle_shield_back.png", "castle_shield_front.png"},
|
||||
drawtype="nodebox",
|
||||
paramtype2 = "facedir",
|
||||
paramtype = "light",
|
||||
groups={cracky=3},
|
||||
sounds = default.node_sound_defaults(),
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.500000,-0.125000,0.375000,0.500000,0.500000,0.500000}, --NodeBox 1
|
||||
{-0.437500,-0.312500,0.375000,0.425000,0.500000,0.500000}, --NodeBox 2
|
||||
{-0.312500,-0.437500,0.375000,0.312500,0.500000,0.500000}, --NodeBox 3
|
||||
{-0.187500,-0.500000,0.375000,0.187500,0.500000,0.500000}, --NodeBox 4
|
||||
},
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.500000,-0.500000,0.375000,0.500000,0.500000,0.500000}, --NodeBox 1
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = "castle:shield",
|
||||
recipe = {
|
||||
{"default:steel_ingot","default:steel_ingot","default:steel_ingot"},
|
||||
{"default:steel_ingot", "default:steel_ingot","default:steel_ingot"},
|
||||
{"dye:red", "default:steel_ingot","dye:blue"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_node("castle:shield_2",{
|
||||
description = "Mounted Shield",
|
||||
tiles = {"castle_shield_side_2.png", "castle_shield_side_2.png", "castle_shield_side_2.png", "castle_shield_side_2.png", "castle_shield_back.png", "castle_shield_front_2.png"},
|
||||
drawtype="nodebox",
|
||||
paramtype2 = "facedir",
|
||||
paramtype = "light",
|
||||
groups={cracky=3},
|
||||
sounds = default.node_sound_defaults(),
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.500000,-0.125000,0.375000,0.500000,0.500000,0.500000}, --NodeBox 1
|
||||
{-0.437500,-0.312500,0.375000,0.425000,0.500000,0.500000}, --NodeBox 2
|
||||
{-0.312500,-0.437500,0.375000,0.312500,0.500000,0.500000}, --NodeBox 3
|
||||
{-0.187500,-0.500000,0.375000,0.187500,0.500000,0.500000}, --NodeBox 4
|
||||
},
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.500000,-0.500000,0.375000,0.500000,0.500000,0.500000}, --NodeBox 1
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "castle:shield_2",
|
||||
recipe = {
|
||||
{"default:steel_ingot","default:steel_ingot","default:steel_ingot"},
|
||||
{"default:steel_ingot", "default:steel_ingot","default:steel_ingot"},
|
||||
{"dye:cyan", "default:steel_ingot","dye:yellow"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_node("castle:shield_3",{
|
||||
description = "Mounted Shield",
|
||||
tiles = {"castle_shield_side_3.png", "castle_shield_side_3.png", "castle_shield_side_3.png", "castle_shield_side_3.png", "castle_shield_back.png", "castle_shield_front_3.png"},
|
||||
drawtype="nodebox",
|
||||
paramtype2 = "facedir",
|
||||
paramtype = "light",
|
||||
groups={cracky=3},
|
||||
sounds = default.node_sound_defaults(),
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.500000,-0.125000,0.375000,0.500000,0.500000,0.500000}, --NodeBox 1
|
||||
{-0.437500,-0.312500,0.375000,0.425000,0.500000,0.500000}, --NodeBox 2
|
||||
{-0.312500,-0.437500,0.375000,0.312500,0.500000,0.500000}, --NodeBox 3
|
||||
{-0.187500,-0.500000,0.375000,0.187500,0.500000,0.500000}, --NodeBox 4
|
||||
},
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.500000,-0.500000,0.375000,0.500000,0.500000,0.500000}, --NodeBox 1
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "castle:shield_3",
|
||||
recipe = {
|
||||
{"default:steel_ingot","default:steel_ingot","default:steel_ingot"},
|
||||
{"default:steel_ingot", "default:steel_ingot","default:steel_ingot"},
|
||||
{"dye:grey", "default:steel_ingot","dye:green"},
|
||||
}
|
||||
})
|
||||
|
@ -1,52 +0,0 @@
|
||||
License Sounds
|
||||
------------------
|
||||
|
||||
(From Simple Shooter mod by Stuart Jones)
|
||||
-castle_crossbow_click.ogg
|
||||
-castle_crossbow_shoot.ogg
|
||||
-castle_crossbow_reload.ogg
|
||||
|
||||
Author : freesound.org
|
||||
License : Attribution 3.0 Unported (CC BY 3.0)
|
||||
CC0 1.0 Universal (CC0 1.0)
|
||||
|
||||
------------------
|
||||
|
||||
(From Minetest Game:default mod)
|
||||
-default_wood_footstep.1.ogg
|
||||
(renamed to : castle_crossbow_bolt.ogg)
|
||||
Author : Mito551
|
||||
License : (CC BY-SA)
|
||||
|
||||
------------------
|
||||
|
||||
Author: Brandon Morris
|
||||
file: castle_orbs.ogg
|
||||
original file : completetask_0.mp3
|
||||
http://opengameart.org/content/completion-sound
|
||||
License: CC-BY 3.0
|
||||
http://creativecommons.org/licenses/by/3.0/
|
||||
|
||||
------------------
|
||||
|
||||
(From Ambience mod)
|
||||
|
||||
Author: Mike Koenig
|
||||
file: castle_owl.ogg
|
||||
original file : horned_owl.ogg
|
||||
http://soundbible.com/1851-Horned-Owl.html
|
||||
License: Attribution 3.0
|
||||
http://creativecommons.org/licenses/by/3.0/
|
||||
|
||||
------------------
|
||||
|
||||
(From Ambience mod)
|
||||
|
||||
Author: PsychoBird
|
||||
file: castle_birds.ogg
|
||||
original file : Best Cardinal Bird.ogg
|
||||
http://soundbible.com/1515-Best-Cardinal-Bird.html
|
||||
License: Attribution 3.0
|
||||
http://creativecommons.org/licenses/by/3.0/
|
||||
|
||||
------------------
|
192
tapestry.lua
@ -1,192 +0,0 @@
|
||||
local tapestry = {}
|
||||
|
||||
minetest.register_node("castle:tapestry_top", {
|
||||
drawtype = "nodebox",
|
||||
description = "Tapestry Top",
|
||||
tiles = {"default_wood.png"},
|
||||
sunlight_propagates = true,
|
||||
groups = {flammable=3,oddly_breakable_by_hand=3},
|
||||
sounds = default.node_sound_defaults(),
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.6,-0.5,0.375,0.6,-0.375,0.5},
|
||||
},
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.6,-0.5,0.375,0.6,-0.375,0.5},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = 'castle:tapestry_top',
|
||||
recipe = {'default:stick'},
|
||||
})
|
||||
|
||||
tapestry.colours = {
|
||||
{"white", "White", "white", "#FFFFFF"},
|
||||
{"grey", "Grey", "grey", "#4B4B4B"},
|
||||
{"black", "Black", "black", "#1F1F1F"},
|
||||
{"red", "Red", "red", "#B21414"},
|
||||
{"yellow", "Yellow", "yellow", "#FFD011"},
|
||||
{"green", "Green", "green", "#43A91C"},
|
||||
{"cyan", "Cyan", "cyan", "#00737B"},
|
||||
{"blue", "Blue", "blue", "#003A7E"},
|
||||
{"magenta", "Magenta", "magenta", "#DD0487"},
|
||||
{"orange", "Orange", "orange", "#D55014"},
|
||||
{"violet", "Violet", "violet", "#5D01AC"},
|
||||
{"dark_grey", "Dark Grey", "dark_grey", "#3A3A3A"},
|
||||
{"dark_green", "Dark Green", "dark_green", "#206400"},
|
||||
{"pink", "Pink", "pink", "#FF8383"},
|
||||
{"brown", "Brown", "brown", "#6D3800"},
|
||||
}
|
||||
|
||||
for _, row in ipairs(tapestry.colours) do
|
||||
local name = row[1]
|
||||
local desc = row[2]
|
||||
local craft_color_group = row[3]
|
||||
local defcolor = row[4]
|
||||
-- Node Definition
|
||||
minetest.register_node("castle:tapestry_"..name, {
|
||||
drawtype = "nodebox",
|
||||
description = desc.." Tapestry",
|
||||
--uses default wool textures for tapestry material
|
||||
tiles = {"wool_"..name..".png^[transformR90"},
|
||||
--uses custom texture for tapestry material
|
||||
--tiles = {"castle_tapestry_overlay.png^[colorize:" .. defcolor ..":205"},
|
||||
groups = {oddly_breakable_by_hand=3,flammable=3},
|
||||
sounds = default.node_sound_defaults(),
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.3125,-0.5,0.4375,-0.1875,-0.375,0.5},
|
||||
{0.1875,-0.5,0.4375,0.3125,-0.375,0.5},
|
||||
{-0.375,-0.375,0.4375,-0.125,-0.25,0.5},
|
||||
{0.125,-0.375,0.4375,0.375,-0.25,0.5},
|
||||
{-0.4375,-0.25,0.4375,-0.0625,-0.125,0.5},
|
||||
{0.0625,-0.25,0.4375,0.4375,-0.125,0.5},
|
||||
{-0.5,-0.125,0.4375,0.0,0.0,0.5},
|
||||
{0.0,-0.125,0.4375,0.5,0.0,0.5},
|
||||
{-0.5,0.0,0.4375,0.5,1.5,0.5},
|
||||
},
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5,-0.5,0.4375,0.5,1.5,0.5},
|
||||
},
|
||||
},
|
||||
})
|
||||
if craft_color_group then
|
||||
-- Crafting from wool and a stick
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = 'castle:tapestry_'..name,
|
||||
recipe = {'wool:'..craft_color_group, 'default:stick'},
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
for _, row in ipairs(tapestry.colours) do
|
||||
local name = row[1]
|
||||
local desc = row[2]
|
||||
local craft_color_group = row[3]
|
||||
local defcolor = row[4]
|
||||
-- Node Definition
|
||||
minetest.register_node("castle:long_tapestry_"..name, {
|
||||
drawtype = "nodebox",
|
||||
description = desc.." Tapestry (Long)",
|
||||
--uses default wool textures for tapestry material
|
||||
tiles = {"wool_"..name..".png^[transformR90"},
|
||||
--uses custom texture for tapestry material
|
||||
--tiles = {"castle_tapestry_overlay.png^[colorize:" .. defcolor ..":205"},
|
||||
groups = {oddly_breakable_by_hand=3,flammable=3},
|
||||
sounds = default.node_sound_defaults(),
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.3125,-0.5,0.4375,-0.1875,-0.375,0.5},
|
||||
{0.1875,-0.5,0.4375,0.3125,-0.375,0.5},
|
||||
{-0.375,-0.375,0.4375,-0.125,-0.25,0.5},
|
||||
{0.125,-0.375,0.4375,0.375,-0.25,0.5},
|
||||
{-0.4375,-0.25,0.4375,-0.0625,-0.125,0.5},
|
||||
{0.0625,-0.25,0.4375,0.4375,-0.125,0.5},
|
||||
{-0.5,-0.125,0.4375,0.0,0.0,0.5},
|
||||
{0.0,-0.125,0.4375,0.5,0.0,0.5},
|
||||
{-0.5,0.0,0.4375,0.5,2.5,0.5},
|
||||
},
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5,-0.5,0.4375,0.5,2.5,0.5},
|
||||
},
|
||||
},
|
||||
})
|
||||
if craft_color_group then
|
||||
-- Crafting from normal tapestry and wool
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = 'castle:long_tapestry_'..name,
|
||||
recipe = {'wool:'..craft_color_group, 'castle:tapestry_'..name},
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
for _, row in ipairs(tapestry.colours) do
|
||||
local name = row[1]
|
||||
local desc = row[2]
|
||||
local craft_color_group = row[3]
|
||||
local defcolor = row[4]
|
||||
-- Node Definition
|
||||
minetest.register_node("castle:very_long_tapestry_"..name, {
|
||||
drawtype = "nodebox",
|
||||
description = desc.." Tapestry (Very Long)",
|
||||
--uses default wool textures for tapestry material
|
||||
tiles = {"wool_"..name..".png^[transformR90"},
|
||||
--uses custom texture for tapestry material
|
||||
--tiles = {"castle_tapestry_overlay.png^[colorize:" .. defcolor ..":205"},
|
||||
groups = {oddly_breakable_by_hand=3,flammable=3},
|
||||
sounds = default.node_sound_defaults(),
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.3125,-0.5,0.4375,-0.1875,-0.375,0.5},
|
||||
{0.1875,-0.5,0.4375,0.3125,-0.375,0.5},
|
||||
{-0.375,-0.375,0.4375,-0.125,-0.25,0.5},
|
||||
{0.125,-0.375,0.4375,0.375,-0.25,0.5},
|
||||
{-0.4375,-0.25,0.4375,-0.0625,-0.125,0.5},
|
||||
{0.0625,-0.25,0.4375,0.4375,-0.125,0.5},
|
||||
{-0.5,-0.125,0.4375,0.0,0.0,0.5},
|
||||
{0.0,-0.125,0.4375,0.5,0.0,0.5},
|
||||
{-0.5,0.0,0.4375,0.5,3.5,0.5},
|
||||
},
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5,-0.5,0.4375,0.5,3.5,0.5},
|
||||
},
|
||||
},
|
||||
})
|
||||
if craft_color_group then
|
||||
-- Crafting from long tapestry and wool
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = 'castle:very_long_tapestry_'..name,
|
||||
recipe = {'wool:'..craft_color_group, 'castle:long_tapestry_'..name},
|
||||
})
|
||||
end
|
||||
end
|
@ -1,84 +0,0 @@
|
||||
--------------------------------------------
|
||||
|
||||
License Textures: Stuart Jones - WTFPL
|
||||
-castle_crossbow_bolt_inv.png
|
||||
-castle_crossbow_bolt_uv.png
|
||||
-castle_crossbow_hit.png
|
||||
|
||||
Licence Models: Stuart Jones - CC-BY-SA 3.0
|
||||
-castle_crossbow_bolt.b3d
|
||||
-castle_crossbow_bolt.blend
|
||||
|
||||
|
||||
--------------------------------------------
|
||||
|
||||
License Textures: Kilbith - WTFPL
|
||||
|
||||
-castle_tapestry_overlay.png
|
||||
|
||||
|
||||
--------------------------------------------
|
||||
|
||||
License Textures: Philipner - CC-BY-SA 3.0
|
||||
|
||||
-castle_chandelier.png
|
||||
-castle_chandelier_chain.png
|
||||
-castle_chandelier_wield.png
|
||||
-castle_corner_stonewall_tb.png
|
||||
-castle_corner_stonewall1.png
|
||||
-castle_corner_stonewall2.png
|
||||
-castle_orb_day.png
|
||||
-castle_orb_night.png
|
||||
-castle_workbench_back.png
|
||||
-castle_workbench_front.png
|
||||
-castle_workbench_side.png
|
||||
-castle_workbench_top.png
|
||||
|
||||
|
||||
--------------------------------------------
|
||||
|
||||
16 px textures based on Castle mod
|
||||
original textures by Philipner
|
||||
|
||||
License Textures: Napiophelios - CC-BY-SA 3.0
|
||||
|
||||
-castle_battleaxe.png
|
||||
-castle_crossbow_bolt_inv.png
|
||||
-castle_crossbow_hit.png
|
||||
-castle_crossbow_loaded.png
|
||||
-castle_door_jail.png
|
||||
-castle_door_oak.png
|
||||
-castle_dungeon_stone.png
|
||||
-castle_grey.png
|
||||
-castle_hide.png
|
||||
-castle_ironbound_chest_back.png
|
||||
-castle_ironbound_chest_front.png
|
||||
-castle_ironbound_chest_side.png
|
||||
-castle_ironbound_chest_top.png
|
||||
-castle_jail_door_inv.png
|
||||
-castle_jailbars.png
|
||||
-castle_oak_door_inv.png
|
||||
-castle_orb_day_weild.png
|
||||
-castle_orb_night_weild.png
|
||||
-castle_pavement_brick.png
|
||||
-castle_ropebox_side_1.png
|
||||
-castle_ropebox_side_2.png
|
||||
-castle_ropebox_top.png
|
||||
-castle_ropes.png
|
||||
-castle_rubble.png
|
||||
-castle_shield_back.png
|
||||
-castle_shield_front.png
|
||||
-castle_shield_front_2.png
|
||||
-castle_shield_front_3.png
|
||||
-castle_shield_side.png
|
||||
-castle_shield_side_2.png
|
||||
-castle_shield_side_3.png
|
||||
-castle_slate.png
|
||||
-castle_space.png
|
||||
-castle_steel.png
|
||||
-castle_stonewall.png
|
||||
-castle_straw_bale.png
|
||||
-castle_street_light.png
|
||||
-castle_workbench_bottom.png
|
||||
|
||||
--------------------------------------------
|
Before Width: | Height: | Size: 358 B |
Before Width: | Height: | Size: 360 B |
Before Width: | Height: | Size: 169 B |
Before Width: | Height: | Size: 316 B |
Before Width: | Height: | Size: 696 B |
Before Width: | Height: | Size: 682 B |
Before Width: | Height: | Size: 691 B |
Before Width: | Height: | Size: 344 B |
Before Width: | Height: | Size: 395 B |
Before Width: | Height: | Size: 146 B |
Before Width: | Height: | Size: 516 B |
Before Width: | Height: | Size: 280 B |
Before Width: | Height: | Size: 295 B |
Before Width: | Height: | Size: 878 B |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 543 B |
Before Width: | Height: | Size: 70 B |
Before Width: | Height: | Size: 618 B |
Before Width: | Height: | Size: 522 B |
Before Width: | Height: | Size: 537 B |
Before Width: | Height: | Size: 374 B |
Before Width: | Height: | Size: 522 B |
Before Width: | Height: | Size: 186 B |
Before Width: | Height: | Size: 253 B |
Before Width: | Height: | Size: 411 B |
Before Width: | Height: | Size: 112 B |
Before Width: | Height: | Size: 185 B |
Before Width: | Height: | Size: 109 B |
Before Width: | Height: | Size: 184 B |
Before Width: | Height: | Size: 700 B |
Before Width: | Height: | Size: 342 B |
Before Width: | Height: | Size: 286 B |
Before Width: | Height: | Size: 262 B |
Before Width: | Height: | Size: 278 B |
Before Width: | Height: | Size: 563 B |
Before Width: | Height: | Size: 620 B |
Before Width: | Height: | Size: 520 B |
Before Width: | Height: | Size: 701 B |
Before Width: | Height: | Size: 536 B |
Before Width: | Height: | Size: 94 B |
Before Width: | Height: | Size: 91 B |
Before Width: | Height: | Size: 101 B |
Before Width: | Height: | Size: 261 B |
Before Width: | Height: | Size: 151 B |
Before Width: | Height: | Size: 214 B |
Before Width: | Height: | Size: 660 B |
Before Width: | Height: | Size: 756 B |
Before Width: | Height: | Size: 465 B |
Before Width: | Height: | Size: 477 B |
Before Width: | Height: | Size: 383 B |
Before Width: | Height: | Size: 369 B |
Before Width: | Height: | Size: 391 B |
Before Width: | Height: | Size: 342 B |
Before Width: | Height: | Size: 336 B |
386
town_item.lua
@ -1,386 +0,0 @@
|
||||
|
||||
minetest.register_alias("darkage:box", "castle:crate")
|
||||
minetest.register_alias("cottages:straw", "farming:straw")
|
||||
minetest.register_alias("castle:straw", "farming:straw")
|
||||
minetest.register_alias("darkage:straw", "farming:straw")
|
||||
minetest.register_alias("cottages:straw_bale", "castle:bound_straw")
|
||||
minetest.register_alias("darkage:straw_bale", "castle:bound_straw")
|
||||
minetest.register_alias("darkage:lamp", "castle:street_light")
|
||||
minetest.register_alias("castle:pavement", "castle:pavement_brick")
|
||||
|
||||
minetest.register_node("castle:anvil",{
|
||||
drawtype = "nodebox",
|
||||
description = "Anvil",
|
||||
tiles = {"castle_steel.png"},
|
||||
groups = {cracky=2,falling_node=1},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.500000,-0.500000,-0.500000,0.500000,-0.250000,0.500000},
|
||||
{-0.187500,-0.500000,-0.375000,0.187500,0.312500,0.375000},
|
||||
{-0.375000,-0.500000,-0.437500,0.375000,-0.125000,0.437500},
|
||||
{-0.500000,0.312500,-0.500000,0.500000,0.500000,0.500000},
|
||||
{-0.375000,0.187500,-0.437500,0.375000,0.425000,0.437500},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "castle:anvil",
|
||||
recipe = {
|
||||
{"default:steel_ingot","default:steel_ingot","default:steel_ingot"},
|
||||
{"","default:steel_ingot", ""},
|
||||
{"default:steel_ingot", "default:steel_ingot","default:steel_ingot"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_node("castle:workbench",{
|
||||
description = "Workbench",
|
||||
tiles = {"castle_workbench_top.png", "castle_workbench_bottom.png", "castle_workbench_side.png", "castle_workbench_side.png", "castle_workbench_back.png", "castle_workbench_front.png"},
|
||||
paramtype2 = "facedir",
|
||||
paramtype = "light",
|
||||
groups = {choppy=2,oddly_breakable_by_hand=2,flammable=2},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
drawtype = "normal",
|
||||
on_construct = function ( pos )
|
||||
local meta = minetest.get_meta( pos )
|
||||
meta:set_string( 'formspec',
|
||||
'size[10,10;]' ..
|
||||
default.gui_bg ..
|
||||
default.gui_bg_img ..
|
||||
default.gui_slots ..
|
||||
'label[1,0;Source Material]' ..
|
||||
'list[context;src;1,1;2,4;]' ..
|
||||
'label[4,0;Recipe to Use]' ..
|
||||
'list[context;rec;4,1;3,3;]' ..
|
||||
'label[7.5,0;Craft Output]' ..
|
||||
'list[context;dst;8,1;1,4;]' ..
|
||||
'list[current_player;main;1,6;8,4;]' )
|
||||
meta:set_string( 'infotext', 'Workbench' )
|
||||
local inv = meta:get_inventory()
|
||||
inv:set_size( 'src', 2 * 4 )
|
||||
inv:set_size( 'rec', 3 * 3 )
|
||||
inv:set_size( 'dst', 1 * 4 )
|
||||
end,
|
||||
can_dig = function(pos,player)
|
||||
local meta = minetest.get_meta(pos);
|
||||
local inv = meta:get_inventory()
|
||||
return inv:is_empty("main")
|
||||
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 workbench 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 workbench 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 workbench at "..minetest.pos_to_string(pos))
|
||||
end,
|
||||
})
|
||||
local get_recipe = function ( inv )
|
||||
local result, needed, input
|
||||
needed = inv:get_list( 'rec' )
|
||||
|
||||
result, input = minetest.get_craft_result( {
|
||||
method = 'normal',
|
||||
width = 3,
|
||||
items = needed
|
||||
})
|
||||
|
||||
local totalneed = {}
|
||||
|
||||
if result.item:is_empty() then
|
||||
result = nil
|
||||
else
|
||||
result = result.item
|
||||
for _, item in ipairs( needed ) do
|
||||
if item ~= nil and not item:is_empty() and not inv:contains_item( 'src', item ) then
|
||||
result = nil
|
||||
break
|
||||
end
|
||||
if item ~= nil and not item:is_empty() then
|
||||
if totalneed[item:get_name()] == nil then
|
||||
totalneed[item:get_name()] = 1
|
||||
else
|
||||
totalneed[item:get_name()] = totalneed[item:get_name()] + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
for name, number in pairs( totalneed ) do
|
||||
local totallist = inv:get_list( 'src' )
|
||||
for i, srcitem in pairs( totallist ) do
|
||||
if srcitem:get_name() == name then
|
||||
local taken = srcitem:take_item( number )
|
||||
number = number - taken:get_count()
|
||||
totallist[i] = srcitem
|
||||
end
|
||||
if number <= 0 then
|
||||
break
|
||||
end
|
||||
end
|
||||
if number > 0 then
|
||||
result = nil
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return needed, input, result
|
||||
end
|
||||
|
||||
minetest.register_abm( {
|
||||
nodenames = { 'castle:workbench' },
|
||||
interval = 5,
|
||||
chance = 1,
|
||||
action = function ( pos, node )
|
||||
local meta = minetest.get_meta( pos )
|
||||
local inv = meta:get_inventory()
|
||||
local result, newinput, needed
|
||||
if not inv:is_empty( 'src' ) then
|
||||
-- Check for a valid recipe and sufficient resources to craft it
|
||||
needed, newinput, result = get_recipe( inv )
|
||||
if result ~= nil and inv:room_for_item( 'dst', result ) then
|
||||
inv:add_item( 'dst', result )
|
||||
for i, item in pairs( needed ) do
|
||||
if item ~= nil and item ~= '' then
|
||||
inv:remove_item( 'src', ItemStack( item ) )
|
||||
end
|
||||
if newinput[i] ~= nil and not newinput[i]:is_empty() then
|
||||
inv:add_item( 'src', newinput[i] )
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
} )
|
||||
|
||||
local function has_locked_chest_privilege(meta, player)
|
||||
if player:get_player_name() ~= meta:get_string("owner") then
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
minetest.register_craft({
|
||||
output = "castle:workbench",
|
||||
recipe = {
|
||||
{"default:steel_ingot","default:steel_ingot","default:steel_ingot"},
|
||||
{"default:wood", "default:wood","default:steel_ingot"},
|
||||
{"default:tree", "default:tree","default:steel_ingot"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_node("castle:dungeon_stone", {
|
||||
description = "Dungeon Stone",
|
||||
drawtype = "normal",
|
||||
tiles = {"castle_dungeon_stone.png"},
|
||||
groups = {cracky=2},
|
||||
paramtype = "light",
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "castle:dungeon_stone",
|
||||
recipe = {
|
||||
{"default:stonebrick", "default:obsidian"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "castle:dungeon_stone",
|
||||
recipe = {
|
||||
{"default:stonebrick"},
|
||||
{"default:obsidian"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_node("castle:crate", {
|
||||
description = "Crate",
|
||||
drawtype = "normal",
|
||||
tiles = {"castle_crate_top.png","castle_crate_top.png","castle_crate.png","castle_crate.png","castle_crate.png","castle_crate.png"},
|
||||
groups = {choppy=3},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
paramtype = "light",
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("formspec",
|
||||
"size[8,9]"..
|
||||
default.gui_bg ..
|
||||
default.gui_bg_img ..
|
||||
default.gui_slots ..
|
||||
"list[current_name;main;0,0;8,5;]"..
|
||||
"list[current_player;main;0,5;8,4;]")
|
||||
meta:set_string("infotext", "Crate")
|
||||
local inv = meta:get_inventory()
|
||||
inv:set_size("main", 8*4)
|
||||
end,
|
||||
can_dig = function(pos,player)
|
||||
local meta = minetest.get_meta(pos);
|
||||
local inv = meta:get_inventory()
|
||||
return inv:is_empty("main")
|
||||
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 crate 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 crate 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 crate at "..minetest.pos_to_string(pos))
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "castle:crate",
|
||||
recipe = {
|
||||
{"default:wood", "default:wood", "default:wood"},
|
||||
{"default:wood", "default:steel_ingot", "default:wood"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_node("castle:bound_straw", {
|
||||
description = "Bound Straw",
|
||||
drawtype = "normal",
|
||||
tiles = {"castle_straw_bale.png"},
|
||||
groups = {choppy=4, flammable=1, oddly_breakable_by_hand=3},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
paramtype = "light",
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "castle:bound_straw",
|
||||
recipe = {
|
||||
{"castle:straw", "castle:ropes"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_node("castle:pavement_brick", {
|
||||
description = "Paving Stone",
|
||||
drawtype = "normal",
|
||||
tiles = {"castle_pavement_brick.png"},
|
||||
groups = {cracky=2},
|
||||
paramtype = "light",
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "castle:pavement_brick 4",
|
||||
recipe = {
|
||||
{"default:stone", "default:cobble"},
|
||||
{"default:cobble", "default:stone"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_node("castle:light",{
|
||||
drawtype = "glasslike",
|
||||
description = "Light Block",
|
||||
sunlight_propagates = true,
|
||||
light_source = 14,
|
||||
tiles = {"castle_street_light.png"},
|
||||
groups = {cracky=2},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
paramtype = "light",
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "castle:light",
|
||||
recipe = {
|
||||
{"default:stick", "default:glass", "default:stick"},
|
||||
{"default:glass", "default:torch", "default:glass"},
|
||||
{"default:stick", "default:glass", "default:stick"},
|
||||
}
|
||||
})
|
||||
|
||||
if minetest.get_modpath("moreblocks") then
|
||||
stairsplus:register_all("castle", "dungeon_stone", "castle:dungeon_stone", {
|
||||
description = "Dungeon Stone",
|
||||
tiles = {"castle_dungeon_stone.png"},
|
||||
groups = {cracky=2, not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
sunlight_propagates = true,
|
||||
})
|
||||
|
||||
stairsplus:register_all("castle", "pavement_brick", "castle:pavement_brick", {
|
||||
description = "Pavement Brick",
|
||||
tiles = {"castle_pavement_brick.png"},
|
||||
groups = {cracky=2, not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
sunlight_propagates = true,
|
||||
})
|
||||
|
||||
else
|
||||
stairs.register_stair_and_slab("dungeon_stone", "castle:dungeon_stone",
|
||||
{cracky=2},
|
||||
{"castle_dungeon_stone.png"},
|
||||
"Dungeon Stone Stair",
|
||||
"Dungeon Stone Slab",
|
||||
default.node_sound_stone_defaults()
|
||||
)
|
||||
|
||||
stairs.register_stair_and_slab("pavement_brick", "castle:pavement_brick",
|
||||
{cracky=2},
|
||||
{"castle_pavement_brick.png"},
|
||||
"Castle Pavement Stair",
|
||||
"Castle Pavement Slab",
|
||||
default.node_sound_stone_defaults()
|
||||
)
|
||||
end
|
||||
|
||||
minetest.register_node( "castle:chandelier", {
|
||||
drawtype = "plantlike",
|
||||
description = "Chandelier",
|
||||
paramtype = "light",
|
||||
wield_image = "castle_chandelier_wield.png",
|
||||
inventory_image = "castle_chandelier_wield.png",
|
||||
groups = {cracky=2},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
sunlight_propagates = true,
|
||||
light_source = 14,
|
||||
tiles = {
|
||||
{
|
||||
name = "castle_chandelier.png",
|
||||
animation = {
|
||||
type = "vertical_frames",
|
||||
aspect_w = 16,
|
||||
aspect_h = 16,
|
||||
length = 1.0
|
||||
},
|
||||
},
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{0.35,-0.375,0.35,-0.35,0.5,-0.35},
|
||||
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_node( "castle:chandelier_chain", {
|
||||
drawtype = "plantlike",
|
||||
description = "Chandelier Chain",
|
||||
paramtype = "light",
|
||||
wield_image = "castle_chandelier_chain.png",
|
||||
inventory_image = "castle_chandelier_chain.png",
|
||||
groups = {cracky=2},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
sunlight_propagates = true,
|
||||
tiles = {"castle_chandelier_chain.png"},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{0.1,-0.5,0.1,-0.1,0.5,-0.1},
|
||||
|
||||
},
|
||||
},
|
||||
})
|
||||
|